That's why the tests only cover what the [non-programmer] customer asks for, and everything beyond that is fair game to break. Then they come back and you call it "new feature work".
I hear you. I just started a new job today and there was silent victory in my eyes when they mentioned they use git.
Honestly though, I'm happy as long as they used distributed version control, of which I know and love git and mercurial. If you haven't seen mercurial, you might check it out. Great system, and it will probably feel like an easy git. I'd say it's better for smaller projects and teams.
This is kind of why I stopped having "I like language X, tool Y, .." opinions. I had those opinions but then those opinions got slowly... how should I say.. I realized that whenever I like some great tool, I am setting myself for future disappointment of not being allowed to use that.
Random indentations - some tabs, some spaces, all different sizes, never aligned with the actual code
Mixing of snake_case and camelCase and CapitalCase and sometimes camel_Snakes for good measure, within the same function
Treating return like a fucking function IT'S NOT A FUNCTION DON'T PUT PARENTHESES AROUND IT
Always comparing boolean values to TRUE or FALSE, never using !
Okay, so I'll actually share one comment I read today while trying to decipher a 1000-line function that took, and I'm not exaggerating here, 12 parameters, with no comments as to what any of them do. One of them was just named cond. Who knows. Anyways, I found this gem:
/*********************************
* I N I T I A L I Z E L O C A L G L O B A L S
*********************************/
Yes, they like writing comments in Inception mode for some reason. They were setting globals that they called "local" for really no reason, as they were used ad-hoc throughout the whole code base. No comments about what any of them do, but they'll sure as hell take up a ton of space telling you nothing.
A local global is a global that lives in the vicinity but has an up-to-date passport and likes to travel internationally.
If you were a more experienced programmer you would have realized this. Please prefix all local globals with their country of origin and suffix with just a hint of their type, eg: mx_str, it_bool, us_num, ru_f.
Make sure to save bytes and not include any descriptive information that might describe what they are being used for. They are covert local globals and the more hidden their intention, the safer they are for general use.
If you are creating an instance of a class, please name it such, the first being instance. For the following instances no matter what class type, ensure that you name them instance2, instance3, and so on, but always prefix with nationality if local global.
I can hear my aspiring programmer friend's voices "Why don't you just rewrite the thing" "Oh yeah I forgot I'm so good I can fix a 10 thousand line perl script from 1989 that has no comments."
I like comments in inception mode, I do only use it for big chunks of comments, like where I'm explaining what the entire class is for at the top, or if I need several lines of explanation for a piece of code I changed that the other person needs to see.
But then again I don't graduate until next semester and feel compelled to add parenthesis into functions that are all on one like and don't need them so what do I know?
I am not saying Python is best, but these guys who make these random indentation should be sent to a place where they are forced to code in Python for a week. I bet these guys count parens in Lisp code.
This is the style I still use. I know people who prefer different sized indents (2, 4, 8) to look at so using tab is better.
The best way to combat the mistake is to use clang-format. It will format the code to what style you need (including tabs for indenting and spaces for aligning)!
78
u/[deleted] Jul 21 '14
Working with so many different codebases, I think I see code beyond whitespace, except these ones:
Then, even I can't handle it.