Math-heavy code tends to involve a lot of very similar algorithms, leading to a copy-paste-rename situation that isn't really helped by using a function.
As such it's incredibly common to end up with bugs from assigning to "x, y, y" and not "x, y, z" etc. Sometimes a clever compiler will warn you that you have done something odd, other times you'll be left to discover the runtime error.
Re:Move Fast without Breaking Things
by ArkyBeagle on Tuesday March 29, 2016 @01:34PM
(#11383183)
Yeah, there's that. I've printed out code like that and colored different variables with different color highlighters to deal with it.
Probably happens more frequently than you think in dynamic languages. Even in compiled languages I imagine its reasonably common to compare something to a hard coded string that could easily be mistyped.
Re:Move Fast without Breaking Things
by ArkyBeagle on Monday March 28, 2016 @07:34PM
(#11378366)
I wasn't thinking of dynamic languages at all. I'd agree.
Here's one more recent than 20 years: http://www.theregister.co.uk/2009/07/30/typo_caused_massive_...
You're right though, with care and skill, typos really shouldn't be an issue
I do see lots of cases where people didn't test it or used the wrong mechanism.
I have to go slowly because somebody already went fast and broke it.
And a friend once told me "LZW can compress code faster than you can." :) Which does not go to the value of orthogonality of purpose in source code, but I enjoyed the irony of the comment very much.