Things in the source code I hate perhaps the most in my everyday work
There's things which one can tolerate. And there's things which just choke you down and turn your brain inside out and you suddenly jump up and start screaming and throwing things to other things.
Here's my list.
Holy crap, the MOST irritating is to see the following:
That's making me facepalm every time I see it.
I mean, what the fuck?
You are DEVELOPER, muthafucka!
You MUST see the errors while you are working, how the hell you are supposed to debug anything without error reporting?!
The only place where you should put such an embarassing shit like the above is the bootstrap script at your PRODUCTION, just ONE of your deployment environments!
Here's how you supposed to do it, you moron!
Even better with feature-detecting instead of environment-detecting and proper code style:
ALL OTHER TIME IT'S MEANINGLESS TO DISABLE ERROR REPORTING, REMEMBER IT, FUCKER!!
I see even the freaking web frameworks doing this idiotic shit and inventing some crazy nonsense like their own debugging facilities with their own flag constants.
JUST WRITE EVERYTHING YOU CAN TO ME IN CASE OF ERROR, YOU WORTHLESS PIECE OF CRAP.
Second is, of course, the following shit.
BLAM! PHP Notice about access to undefined hashmap key.
YES SONUVABITCH I WORK WITH E_STRICT ENABLED because I do care about any possible sign that I screwed somewhere.
Here's the most usual usage of this shit:
PHP Notice in that view file means the user got the whole page crashed because of a single nonexistend data item, and all we wanted to do with that data item is render it, it wasn't something mission-critical.
If you want to write possibly nonexistent data just prepend a fucking
@ that's all!.
Unnecessary strict comparison
$some_fetch_result === null crap.
Yeah, that's right! Why the fuck you want to know whether the result of fetching something from somewhere is exactly
null? What if someone who wrote that API method decided to return
false in case of empty result? Even if there's an empty array (in which case even I agree that it should not be considered same as null) what are you going to do with it, anyway?
Just forget about this brain-hurting nonsense:
Write the fucking
!$records and that's all! By doing that
=== crap you stress out that
null is of significant value having a special meaning, when it obviously isn't, you just wanted to check whether we failed to return anything.
I DON'T EVEN START TO TALK ABOUT NOT RETURNING NULL VALUES THERE, YOU MORON STILL STUCK IN 90'S.
Prefixes before object properties
OMG, words can't describe the amount of disgust I experience when seeing the piece of crap like the following:
Freaking degenerates coming to PHP from C/C++ completely missed the whole point with
m_ prefix before member variables here. Remember, you brainless ape!
MEMBER VARIABLES, DO YOU GET THEM NOW?
We can't differentiate between member and other local variables without special cues like the proper naming or FQN, so the
m_ convenience was invented. In PHP we always refer to member variables from $this object so we always know what variable is internal to class and what variable conforms to fucking Demeter's Law.
There's nothing uglier in PHP code than
$this->_shit. WTF is this
->_ noise, are we in Perl now? HATEHATEHATE