What factors contribute to programmers making frequent mistakes? Are there specific habits or practices that tend to lead to errors in code?
Follo...
For further actions, you may consider blocking this person and/or reporting abuse
There are infinite thing that can cause errors, but some of the most common are ...
hp
instead ofheightOfPerson
, for example)... and more.
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).
Let me continue with fairly more complex, but yet not uncommon reasons!
Testing (or lack thereof).
It's super important to make sure that your code works for all inputs, valid or invalid (and handles them gracefully). For example, what if the math works out to a division by zero in a certain statement? Or if the file name itself has a '.' in it and now your code thinks the file extension is "InsertFileNameHere"?
A few things that come to mind:
And finally, the bane of my existence...
Time and staffing constraints are the root of all software quality evil. “Just get this done” is a great ethos for getting something, but it sucks at guaranteeing long-term satisfaction with what you got.
I’ve seen companies refuse to grant more time for testing, and then punish the team for releasing bugs.
It is far too much to ask developers to be perfect. AI won’t be perfect either.
I'm tempted to take a step back and suggest the only real source of errors is human nature. The rest is detail including the details of trying reduce the likelihood and impact of errors and we have many methods for that, with a cost/benefit function that follows the standard Pareto curve (or 80/20 rule). When it's important, like a plane's control system, an x-ray machine, a banks back end) we can produce as good as failure free performance (as the curve is assymptotic and perfection an unattainable myth we can only ever push hard against the limits at great expense).
Where the consequences of errors are low and other features take priority (literally features or time to market for example) errors will be part of the product.
Blindly trusting tests, linters, and code assistance leads to coding mistakes?
1) Unrealistic deadlines that can't be moved
2) Developer Burnout
3) Middle management
Usually come all together leading to failure.
There must be many reasons, but what comes to mind is, for example: