DEV Community

Discussion on: What Leads to Coding Mistakes?

Collapse
 
kaamkiya profile image
Kaamkiya • Edited

There are infinite thing that can cause errors, but some of the most common are ...

  • Not being on the same page as co-workers or other people on your team
  • Not understanding the codebase
  • Using C++
  • Writing unreadable code
  • Not commenting code
  • Using nondescript variable names (naming a variable hp instead of heightOfPerson, for example)

... and more.

Collapse
 
programcrafter profile image
ProgramCrafter

Let me continue with fairly more complex, but yet not uncommon reasons!

  • Overcertainty that input will have certain properties (often coupled with not having project structure in mind);
  • Trying to change existing code to do similar, but another, thing;
  • Writing functions with large amount of parameters of one type, then accidentally swapping them;
  • Separating logically connected variables into separate objects, then expecting them to be consistent.
Collapse
 
thumbone profile image
Bernd Wechner

Tee hee, had to chuckle a little as part of me thinks that one source of errors is in fact the misapplication of ideas, like "infinite" (there most certainly is not an infinite source of errors I can assure you, not even almost).