3 ms·
If the variables had been named timeOfTenPercentHeightOnTheFallingEdge and timeOfTenPercentHeightOnTheRisingEdge it probably would have still been hard to notic
by guelo 10y ago
If the variables had been named timeOfTenPercentHeightOnTheFallingEdge and timeOfTenPercentHeightOnTheRisingEdge it probably would have still been hard to notice that they had been swapped in that one line.
- niccaluim 10y agoYes, but the likelihood of mistyping them would be far less. 'f' and 'r' are right next to each other. 'Falling' and 'Rising' are a bit harder to unnoticeably fat-finger.
- Dylan16807 10y agoIt was probably a mental mistake. It's not particularly easy to fat-finger in that specific way.
- DSMan195276 10y agoI think the catch is that the 'f' and 'r' keys are right next to each-other, so if you accidentally type one instead of the other then you'd get the other variable by mistake. That said, you raise a fair point - we don't know how this bug got there. If it was a simple typo like above then the verbose names would have prevented it. If it was a logic error by the programmer (For whatever reason), then you're right that the name wouldn't matter because they typed the one they intended, it just wasn't the right one to use.
- adrianratnapala 10y agoFat-finger is only one kind of error -- and one far less common than the good-ole brain-spasm which can easily replace "Falling" with "Rising". The ability to read the code an find see the error is more important. And one that score even though ttpfe is a terrilbe name "timeOfTenPercentHeightOnTheFallingEdge", is even worse.