Re:I was a 10x engineer and I’m sorry
by dragontamer on Thursday July 18, 2019 @01:29PM
(#20472070)
Not really.
If the comment "what the fuck" were instead "estimate floating-point exponent with bit-wise arithmetic" and "SingleStep forward with Newton's Method", then the code would be better documented
The comment "what the fuck" and "evil floating point bit level hacking" don't help anybody. And "1st iteration" is only helpful if you knew it was an iteration of Newton's method.
Agreed, this is really far from technical debt. It's self-contained, the purpose of the function is clear. Add a comment or two, a unit test, and this is perfect.
What I would call technical debt is if he had inlined those tricks all over his code, making it very hard to debug a wrong result or move away from this technique.
FISR is a beautiful hack, but it hardly technical debt. This is the original code. Note how the trick has been hidden behind a normal API such as `Q_rsqrt`:
This is how you walk the fine line between technical debt and useful hack.