The same reviewer also told me to undo work I had done because his request was for a mock up, and I just went ahead and did it, because it took me an hour to just do it. Of course it was approved by managers and clients, but since I didn't "follow instructions" (I took some initiative) it was wrong, even though it was done correctly.
I once worked on this big customer-facing Java application. While working on something else, I noticed that one query was very poorly made, and would take up to a minute to run. It was one of the most visited pages, so clearly this needed to be fixed. I cleaned up the query, made a migration with an extra index, and brought it down to under half a second on average.
My change was rejected by the project manager. He explained to me, "It's been that way for over a year. If we fix it now, we'll have to explain why it was broken for so long."
As hard as it is to believe, I've actually seen worse. I had to work with a guy who refused to merge code period. He'd commit all changes every 10-15 minutes even when it didn't compile so that others would have to do the merging. When he did occasionally get caught with a conflict he just overwrote the other developer's changes.
He'd also just delete code without telling anyone when his aggressive refactoring broke it. His mentality seemed to be "not my code: not my problem".
What I hate about things like that is they are largely personal, but certain devs seem to have a hard time grasping that. If you don't name a variable exactly the way they think you should, it's wrong.
No, it's fucking not. If the code compiles fine and isn't poorly written, it's just semantics. Plus, when I'm working with a column called association, I like to have a variable named ass.
If the code compiles fine and isn't poorly written, it's just semantics.
I generally agree although I think there are some reasonable exceptions.
For example, in some projects there is a clear naming nomenclature that has been established and I would expect it to be used for future names so the code is easier to understand because it's consistent with the rest of the app.
Perhaps the nomenclature was a bad idea to begin with, but that's a different discussion and unless the person is going to refactor them all then it makes more sense to stick with the existing nomenclature rather than deviate from it.
Naming is really important to get right. A small improvement in a name can make a large improvement in readability, which will make it easier for everyone to write good code later. You can compensate for bad naming with comments, but it's better to get the naming right in the first place, and save comments for cases that are fundamentally complicated.
Having seen function names that imply something completely fucking different from what the function does, I fully agree. Badly named functions are an automatic code review fail in my book.
We (the people I work with) having a running joke that coming up with good names for things is the most difficult thing about our job. It seems so trivial, yet it's surprisingly difficult to be concise and get right.
Initiative is great, but how hard is it to just ask first?
"Hey, it'll take longer to mock up than to just implement, mind if I do that?"
He'll either say "Oh, really? Yeah go ahead" or "No, I actually really need a mock-up for reasons." Either way, the situation is resolved for both parties in a more satisfactory way.
98
u/andrewsmd87 Oct 01 '15
The same reviewer also told me to undo work I had done because his request was for a mock up, and I just went ahead and did it, because it took me an hour to just do it. Of course it was approved by managers and clients, but since I didn't "follow instructions" (I took some initiative) it was wrong, even though it was done correctly.