Programming lamentations to learn from
I was reflecting on some of the things I’ve experienced while in the software engineering field. There are some big mistakes I’ve witnessed and made. I’m going to share what they were and I hope you gain insights of how to approach some situations… especially if you are new to the industry.
Clever code
During my first job, I was helping to write a generic report builder application. We needed a method to parse a Date out of an oddly formatted string. Being fresh out of college, I was excited to show that I could write something that would parse immensely fast — and I did. There was one major problem, no one else understood it. When it came time to refactor, a senior engineer said this to me and I’ll never forget it:
Programming languages are designed to be understood by humans.
If your code is good enough to stick around it will have to be maintained and probably by someone else. There are exceptional cases of course, but remember that compilers often make the same optimizations (or better) than the ones you cleverly devised. Learn from my mistake, don’t be clever. Continue reading