From my personal experiences of doing ppl's handover code, there are actually some types of programmers that is naughty:
- A programmer that is very careful (type 1)
- A programmer that leave his footprints in the code, and make it like a novel, or essay (type 2)
- A programmer that write nothing (type 3)
- A programmer that don't know exactly what he is doing (type 4)
- A programmer that don't understand the most basic concept of programming languages (type 5)
Programmer type 1 is so careful that he always commenting out old source codes and then copy paste it to a new uncommented code. Then he does all the changes he need in the new pasted block. He thought that if someday, somehow, something happened because he made the changes, he could roll back to the old "semi-stable" code by commenting the new code, and un-commenting the old code. Maybe he forgot that people has invented a code version control application, or maybe he's just too lazy to use it, or maybe he does not understand what is it for?
Copy pasting source code itself is already a greatest sin a programmer could ever made. Even commenting out source code, keeping 2 versions of source code by commenting them, is very very naughty =)) So, what should we do, if we need to made some changes in an old "semi-stable" code? Ppl invented source code version control software. They were spending years developing it, testing it, distributing it, promoting it. They even made it open source for everyone. So, use it instead of commenting codes. With it you can compare, trace history, rollback, or even blame someone.
Programmer type 2 somehow maybe, is so enjoying his work as a programmer. He always write comments for everything he has done, too much comments actually, making it looks like a novel. By example, every time he do some changes, he write: "//changes by xxxxx" or "xxxx's code", and then some explanations why he was doing that. Actually, writing comments like this in the middle of a block of code, could be ignoring and make the code hard to understand by another ppl. It's enough to make a block of comment in the top of every files, listing a table of changes. Well, you can write a novel in this block if you want to.
Programmer type 3 write nothing, nothing at all, even how to use the method he has made. Not any parameters or arguments explanation. Even the variable and object naming has been done in a meaningless way such as a bunch of random alphabets or temporary names: a, b, x, y, tempVar, dummyVar, etc. No documents, no diagrams, no simple text files, no unit tests. He expect everyone (including himself), to re-read every lines of the codes he has written.
Programmer type 4 is a serious kind of naughty programmer. This kind of programmer, searching from all over the sample of from a programming book, or the Internet, or a forum, and then copy pasted them into his project's code without really understand what the sample code does. Sometimes even the fancy names of the object for educational purpose is still left unchanged. Before doing something with something, you should really read the docs carefully and learn what it does. Don't easily put a bunch of code that you don't understand what it's doing, coz it make no sense and someday you'll have problem with it.
Finally programmer type 5, maybe is not an IT graduated or maybe is a fresh graduate, that's why he doesn't understand the basic programming, which is "forgivable", for a fresh grad. Well, if you choose a job as a programmer, don't run away from reading. Reading educational articles/books make a programmer a real programmer.
Again, before doing something with something, you should really understand what "something" is. Don't just try copy pasting some codes and hope it will works, that's not what a programmer should be doing.
I write this not to blame someone, just to list out some bad habit of programmers that should be avoided. Well, ppl ain't created perfect. But professional programmers do exist, and though they used to be a naughty programmer.