5 ms·
I've maintained such a log in a text file, but only for bugs where I actually facepalmed when I realized how I screwed up (and how much time I just spent debugg
by MauranKilom 6y ago
I've maintained such a log in a text file, but only for bugs where I actually facepalmed when I realized how I screwed up (and how much time I just spent debugging a really elementary problem). Thankfully it happens only a few times per year.
Most of them are along the lines of not fully implementing (either in typing or in touching all nearby places) some minor change while I'm iterating on an algorithm.
Here are a few (condensed and simplified) examples:
"Unfinished business..."
if (target.size() == 2)
sliceValue =
valuePerSlice[z] = sliceValue;
(Our linter would of course catch this, but it runs automatically only on the CI.)
---
"Variables change when they are assigned!"
ret[0] = scale * normalVector[0];
ret[1] = scale * a;
if (normalVector[1] < 0)
{
ret[0] = std::sqrt(2) - ret[1];
ret[1] = std::sqrt(2) - ret[0];
}
(The reassignments inside the if previously used their own instead of the other index.)
---
"Back when I didn't trust my refactoring tools"
Original code:
for (unsigned tr0 = 0; tr0 < triangles0.size(); ++tr0)
{
if (std::find(triangles1.begin(), triangles1.end(), triangles0[tr0]) != triangles1.end())
return triangles0[tr0];
}
After my change:
for (unsigned tr0 : triangles0)
{
if (std::find(triangles1.begin(), triangles1.end(), triangles0[tr0]) != triangles1.end())
return tr0;
}
(Don't refactor absent-mindedly!)
- eyelidlessness 6y ago> Our linter would of course catch this, but it runs automatically only on the CI This is why, unless it’s a significantly degraded experience, I run a local watch version of what I expect to run in CI during dev. And if it is a significantly degraded experience I stop what I’m doing to either fix that (if possible) or refine it to at least approximate the CI validation automatically.