7 ms·
Sometimes the nightmare is some mix of organized and chaotic. I had the responsibility of rewriting from scratch a C codebase that was deliberately obfuscated.
by netbioserror 3y ago
Sometimes the nightmare is some mix of organized and chaotic. I had the responsibility of rewriting from scratch a C codebase that was deliberately obfuscated. The spacing and bracketing and general code style was almost perfect. But every name was obfuscated into nonsensical single letters and contractions, and every ostensibly simple math operation was separated into a multiline series of single stateful operations on a variable. Plus, global variables.
Surprised I managed to do it at all, but it was circumstantial evidence for what each operation did that helped immensely, plus a few logical and mathematical lightbulb moments. Rewriting it in Nim has also helped me make it well-organized and self-documenting. I have a document full of pseudocode but it looks basically exactly the same as the Nim code!