Hacker News new | ask | show | jobs
by xyzelement 1275 days ago
My first job out of college, my boss and I took over some code that was written by two genius PhDs (one math, one physics - we were working in finance.)

I noticed a variable (long word starting with z) used in a lot of places. Turns out it was the German word for "counter".

It was my first hint that most of the backend codebase was written as a competition between the two of them to seem the smartest.

On the front-end, I remember opening some many thousand line long file trying to figure it out. I scrolled pages and pages to the top of the file looking for a comment. I found one. The comment:

/* What is this shit? */

Written by someone who tried to help those guys.

8 comments

Similar story: a few years out of college I too inherited a codebase written in the 1990s by some genius phd, also in the finance field. Someone else clearly tried to clean it up before me. The word “WTF” was in comments throughout the codebase.
The word with Z may be related to “zahlen” which is where Z as the letter commonly used to represent the integers comes from. [1]

[1] https://en.wikipedia.org/wiki/Integer#History

I think it was a much longer word, and to be clear - neither of the dudes was German.
That’s an important detail, I assumed they were German. That makes it much sillier.
Maybe Zählvariable or something like that?
Counter is Zähler, not Zahlen, though.
Could be worse - my first was a program where someone had written the source in Delphi and run it through a Delphi -> C converter and then they threw away the original Delphi code. The resulting spaghetti was the only production code available.
What kind of monster would do this
Gulp. I’ve left a comment like that or two. Probably isn’t helping the cause, but it’s waving a flag for the next person who’s got budget to clean it up.
Grunt. Yarn it!
T_PAAMAYIM_NEKUDOTAYIM
Hebrew for 2 dots haha
Two double dots
Maybe this would be a good use for AI code generation. Reversable non-obfuscated obfuscated code. If you just obfuscate it it's pretty obvious what you're doing but if an AI can obfuscate it in a what that looks like something that is plausible that you could have written it you'd get away with it. Reversable so that you could undo it make updates and then reobfuscale.
Ten levels of C++ templates and typedefs are a pretty good way of proving how smart you are and making the code completely opaque.
That last anecdote is too relatable.