Code Should be Readable
On the first day of my first job, at age 23, I learned the most important lesson of my life about programming: code should be readable . Four years of CS at university did not prepare me for this, but one day of work did (thanks Achiel!). I had created something "clever" and was barked at by the Senior Engineer of the team that my solution was too complicated. For a second I thought he was suffering from low IQ, but he explained that: He was not able to instantly understand my code. Lesson : It was apparently vital that other people in the team understood my code. In fact, it was not even my code, the team owned it . The problem I was solving was simple and not worth spending much mental capacity on. Lesson : writing code is just a small part of what happens with it, code is much more frequently read, tested, debugged and refactored. All these activities take time and mental capacity. In 6 months, I would have forgotten the code and would look at it the...