Actually most programmers are bad programmers. No really, they are. The problem is that everyone can be a programmer. This isn’t true for other jobs. Not everyone can work as a lawyer or doctor for example. However nobody forbids you to work as a programmer, you don’t need a special license, there is no mandatory education either. If a company hires you as a coder, no matter if you ever had any education on this matter or not, you work as a coder; period. And this itself is not even bad. Some of the best coders on earth never had any education in computer science, still they are brilliant coders. However, many people had no education and are just horrible coders.
I’m forced to work in teams - not every project can be a one-man-project. I just got disappointed too many times, so I don’t really trust other team members. Right now there is exactly one person on my team I trust to write decent code. She still isn’t doing things the way I would do them, but I’ve seen some of her code and is pretty good; thus I have no fear to delegate a task to her and I know she will do a good job implementing it. Regarding the rest of the team, we usually split tasks into independent sub-tasks, each handled by a different programmer. Usually I prefer to not even see the code of the other programmers. I will just rely that their code worked as we said it should and if not, they shall please fix their own code. Whenever I have to read and fix other people’s code it only takes me a couple of minutes to get the point where I feel like hitting my head straight onto the desk. Can anyone write any less readable code?, Ever considered that RAM and CPU time are limited resources?, Wow, is there a more complicated way to solve this simple problem? I don’t think so; these are the usual thoughts going through my head. That’s why I don’t want other people playing around with my code on the team.
Often when I tell someone how they shall implement it, they start writing a horrible mess of something that slightly reminds one of code, then they get all desperate because it does not work and get mad at me for telling them how to implement in the first place. Usually it ends with me saying Come on, stop whining - I’ll do it. After half of the time they already spent on it and with about half as many code the task is done; exactly like I suggested it in the very beginning. I fail to see how somebody can write 1000 lines of code and spend 4 hours on the task if the implementation doesn’t even take 500 lines and can be completed in less than 2 hours.
I think the problem is, not everyone loves coding the way I do. I started programming in Basic when I was still in primary school, I learned x86 assembly only one year later (not enough to write any meaningful applications with it, but enough to understand how CPUs work), I learned Pascal, I learned Java, I learned C, I learned PHP, I learned Perl… just for the fun of it. I love my job, it is actually my hobby and my job at the same time. So I love my code. The lesson I had to learn is that not everyone is like this.
Doing something with love makes you doing it well. The saying something has been made with love (e.g. when baking a cake) is really a meaningful one. If I hire someone to remove all wall in my living room and replace it with a new one, he may not love doing that, he may hate doing it, but he does it, why? It’s his job, I pay him for doing it and he needs the money for a living. So he will do his job, he will try to make a decent job, but he won’t do it with love. You can see this by the result. It is not his living room, I’m sure if he does the same at home for himself, he will make a much better wall. If I do it myself, it is my living room, I want it to look perfect, I will do my best to perfectly align the bricks, I will make the plaster on it as smooth as possible (maybe polishing it with sand paper to make it perfectly smooth before painting it), etc.
This is the way how I code. I want to solve a problem with as little lines of code as possible, using as little RAM as possible, making it run as fast as possible on current CPUs, writing as readable code as possible. Coding is for me like art, the program is a painting. I love being a coder and thus I write all my code with love. I want my code to be beautiful and I want to be able to proud of my code (even if it isn’t my code later on - it is owned by my company). I’m sure I’m not the best coder on earth, others may be able to write faster code or more beautiful code - but it’s not important to be the best, it’s important to know that you did your best! Coding is not just a job I do because I need the money. If I couldn’t be a coder any longer and had to work in another business, I’d still write code at home and if it is just for myself, since it is my hobby and I won’t give it up for no money in this world. Or I’d start writing code for open source projects so other people could benefit from it.
As a closing word: I tried to participate in open source projects, but I can’t. I see the code and I see it has not been made with love. It is far from being good code. Actually I was horrified to see some code of Firefox. Firefox is the browser I love, I use it daily - but some code of it is so ugly. It is way too complicated (it could be much simpler, one third of the code), this also makes it very hard to read. And what horrified me even more, it wastes tons of CPU time for nothing. Some information is regathered hundreds of times a second, even if storing the information would only take 4 byte of memory (this is ridiculous little memory) and in case the information is outdated, the system will notify the application (so one could easily cache it and only update the cache if the system notifies Firefox that this information has changed). Same holds true for other parts where polling is used, even though polling is absolutely unnecessary. Seeing code like this brings up a strong desire to rewrite major parts of it, but I don’t feel like rewriting 2000 lines of code from ground up if I in fact only planned to fix a tiny bug I found - so I refrain from touching this code at all.