r/ProgrammerHumor • u/Alfred1400 • Mar 15 '19
My experience with programming so far..
https://i.imgur.com/rQIb4Vw.gifv176
u/NotYetiFamous Mar 15 '19
I was asked to audit code this week. I ended up auditting the vode, rewriting large parts of it and retraining the maintainers on standards. So much truth.
43
u/randomentity1 Mar 15 '19
I ended up auditting the vode
It was so bad it wasn't even code.
7
-3
u/greenSixx Mar 15 '19
Standards: the excuse coders like you use to justify their job despite not actually doing any meaningful work.
Right?
There is always someone else who has standards that your code doesnt comply with.
4
44
Mar 15 '19
[removed] — view removed comment
14
u/NotYetiFamous Mar 15 '19
Or is it the best..? I get a strange sense of satisfaction from yak shaving.
80
u/diarewse Mar 15 '19
Yeah 😄 especially when I'm asked to fix code after my colleagues who didn't bother do a proper job first time around.
21
Mar 15 '19
Go into embedded. Then you can fix the hardware guys fuckups too.
10
u/EddieJones6 Mar 15 '19
It gets super fun when the workaround for the hardware defect doesn't quite satisfy the requirements. Then its software's fault again.
4
u/DurianExecutioner Mar 15 '19
Hardware engineer here. If you guys didn't try to do stupid, inefficient things just because they're a required part of some API, we wouldn't have to go looking for corner cases and spec holes to hide bugs in. :P Why can't you keep things simple?
Like I get that you don't want performance to degrade by 50% on the fourth Tuesday of every month, but the spec never actually said that couldn't happen and besides we saved a whole four DFFs doing it this way.
2
u/EddieJones6 Mar 16 '19
You’re right. And no problem, we will just scatter some loops and degrade performance by 50% except for those days.
5
u/stuckinmotion Mar 15 '19
They probably wanted to do it right, but didn't have time for that. They had yet another sprint planning meeting to attend, or design review, or Janice's retirement party to smile and wave at. Or surprise bugs jumped out at them from the last time someone whipped some code together to keep the burndown chart happy. And so the cycle continues..
2
57
Mar 15 '19
[removed] — view removed comment
1
u/jiminiminimini Mar 15 '19
And sometimes the person whose bad code you've just fixed turns out to be the past-you.
30
u/The_Ty Mar 15 '19
This is so true.
So earlier this week I was developing a Wordpress plugin which uses the WooCommerce REST API.
Except WooCommerce wouldn't generate API keys properly, I can't view them. Turns out this was caused by the main plugin file generating "unexpected characters".
This in turn was caused by me using <script> in the main plugin php file (using echo), because I needed to pass a PHP Wordpress function/value onto javascript, to properly navigate the plugin directory to load a json file.
To fix that, I had to find an alternate way of passing the PHP function/value onto javascript, which then fixed all the above.
And the best part was I couldn't find a single solution for the "unexpected characters" issue, so it took me 4 hours to narrow the problem down.
0
u/greenSixx Mar 15 '19
Nothing you said makes sense.
This api isnt a standard api? I must just be web centric. Its either oauth, custom authorization, maybe a cli api? Would you call running an executable from command like an api?
You had to inject javascript into the api to navigate the plugins files to find some file with json in it?
Main plugin file....?
You sure its not just your newline chars? Like your ide changed linux newline to windows?
Nothing you say makes sense.
What sort of plugin, php plugin, will eval javascript and run it?
You are making huge assumptions and not sharing them with us. Makes it hard to understand.
1
u/The_Ty Mar 15 '19 edited Mar 15 '19
Yes main plugin file. As in the plugin which matches the folder name, that wordpress look at first
It sounds like you're just confused for no reason. Which is understandable if you haven't worked with WordPress plugins (which is specifically what I was referring to)
You can run javascript in a php file by using echo (like I said) to write <script> tags as you would in normal html
Like:
Echo '
<script> Var root_url ="'.echo plugin_dir_path().'" </script>
';
Cant remember the exact wordpress function I used but the above is how I did it (at first)
(Edit: Never mind, based off your post history you're just a contrarian, I assumed you were acting in good faith)
13
u/oupablo Mar 15 '19
And that's just your own code. Better hope you never inherit an old application.
2
u/Catthew918 Mar 15 '19
This. I've inherited a nice tangle at the job I started 3 months ago. I still shake my head while I'm clicking around looking for the one thing I need.
2
10
10
14
7
6
5
u/leonard_face Mar 15 '19
“Hal, could you replace the lightbulb in the kitchen?”
“I’m sorry Dave, I’m afraid I can’t do that.”
5
5
u/CosmackMagus Mar 15 '19
I've sent this to my boss before when asked as to why something wasnt done
4
u/HDmac Mar 15 '19
My boss: that button still has the wrong text in it, what have you been doing?! Me: ...
0
4
Mar 15 '19
Best repost
4
Mar 15 '19
Would be great to see someone make the effort, get a high quality version and put proper relevant text on it.
Well it's not going to be me.
4
u/code_monkey_001 Mar 15 '19
Ah, I remember my days as a maintenance developer. It's like being an auto mechanic, finding a piece of baiing wire wrapped around the alternator of a car, and untwisting it because you have no idea why it's there. Then you hear the clang as the rear axle falls off the vehicle.
3
u/ITrollRedditEveryDay Mar 15 '19
a function in a function in a function in a funct.... WHAT DOES IT LOOK LIKE IM DOING HERE
1
3
3
3
2
2
2
•
u/XXAligatorXx Mar 15 '19
Your submission has been removed.
Rule[2] violation.
Rule[2]: All posts that have been on the first 2 pages of trending posts within the last six months, is part of the top of all time, or is part of common posts is considered repost and will be removed on sight.
If you feel that it has been removed in error, please message us so that we may review it.
4
1
1
1
1
u/greenSixx Mar 15 '19
You know what the best part about good enough is right?
Its that it is good enough
1
0
36
312
u/Oxdefac8 Mar 15 '19
truth