3 ms·
What are the 7 deadly sins of programming?
- Hackbraten 6y ago> Hard-coding data. I’m not convinced. Is the constant Pi not data? A multi-byte file magic? A constant matrix used for rotation? > Put strings (like labels, messages, hints …etc ) directly in the code instead of externalizing them. Many enterprise software projects are custom-built for a handful of users and don’t need externalization. Besides, log messages. > Not using meaningful names for variables. Strongly agree. > Using name instead of verb in method/function declaration. What about getter methods? In some languages, `get` or `is` prefixes are not idiomatic. > Rolling his own security What is that even supposed to mean? Of course we roll our own security. It needs to be baked into the product from the design phase on. What the author probably meant was: security algorithms. Maybe reflect on why they seem to assume all programmers are men. > Jump staging right to the production. What about ad-hoc debug helpers that sometimes have to be inserted while debugging in production? > No comment ! Some pieces of code just don’t need comments.
- bediger4000 6y agoWhy limit yourself to 7? There's way more t han that. This is analogous to "The 10 Commandments of Programming", or "of Java" or "of Visual Basic". Why limit yourself to 10? Why got all the way to 10 (remember 5 plus or minus 2)?