this post was submitted on 26 Nov 2023
699 points (89.1% liked)

Programmer Humor

19463 readers
18 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] ChickenLadyLovesLife@lemmy.world 4 points 11 months ago (2 children)

comments are for explaining why you did things a certain way

A while back I spent more than a year modifying my company's iOS apps so that they would work properly with VoiceOver (Apple's screen reader technology for blind people) and be compliant with FCC regulations for accessibility (and save us from $1 million per month fines lol). The thing about VoiceOver is that it's bizarrely buggy (or was - maybe they've fixed the problems since then) and even when I didn't run into VO bugs, the way that developers tended to architect these apps often made getting them to behave properly with VoiceOver extremely difficult.

I often had to resort to very strange hacks in order to get things to work, and I would always leave comments explaining what I had done for this. My manager was one of the new breed who not only thought comments were unnecessary in ALL cases but also thought comments were a "code smell" and indicative of professional incompetence on the part of anyone who used them. Whenever he reviewed my code, he would leave in the hacks (after trying and failing to fix the problems without them) but remove my comments. This resulted in many cases later of developers contacting me to ask me why some bizarre bit of code was in the app in the first place. I always referred them to my manager with an NMP (Not My Problem any more).

[–] magic_lobster_party@kbin.social 3 points 11 months ago

I think most people fail to understand what code smell really is. They think code smell means bad code. A code smell is actually an indication that something else might be bad with the code. The code smell itself might not be bad.

So when a code smell appears, it means you should identify the reason it exists and potentially fix it. In this case the bad code is a buggy external library, which is difficult for you to fix. Therefore, leaving the “code smell” is the best course of action.

Your manager was in the wrong and you were right to write comments.

[–] zalgotext@sh.itjust.works 2 points 11 months ago (1 children)

This resulted in many cases later of developers contacting me to ask me why some bizarre bit of code was in the app in the first place. I always referred them to my manager with an NMP (Not My Problem any more).

I hope this isn't a real story. It would have taken you just as long to refer them to the commits with your comments still in, and run a git blame to show your manager took them out. Instead you just make yourself look unhelpful and incompetent.

[–] docAvid@midwest.social 5 points 11 months ago

Bold of you to assume they were using source control under that manager...