My nine and a half commandments
In software engineering every little thing matters. These are some of the principles I really like to follow -
- Write tests before writing code unless there is no logic in your code. If there is no test then there should be no code. If you write the test after you write the code, you most likely will be testing behavior and not what you intended to code
- Write clear, clean, and concise code that works no matter what
- Do not try to cure a global pandemic while writing a little feature. The business need for that will be part of a different story if it can be afforded
- Yes, O(n^2) vs O(n) vs O(log n) vs O(n log n) matters! It’s not enough if the code looks pretty
- Think about costs. If your beautiful code goes live and ends up wasting a million dollars for nothing, it’s not great
- Learn to use the powers of the IDE. It doesn’t cost $199 for nothing
- Always think about the code you are writing. At least twice. Maybe even three times if you can afford it. Check, double check and triple check if you can
- It’s essential to have graceful degradation. Broken software results in angry users
- Do not reinvent the wheel because you want to, but also do not add a huge library for 3 lines of logic