Re:How to Write Unmantainable Code
by heavyset_go on Saturday December 24, 2022 @09:14PM
(#34123402)
That last anecdote is too relatable.
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.
Re:How to Write Unmantainable Code
by kugelblitz on Sunday December 25, 2022 @03:12AM
(#34125342)
Grunt. Yarn it!
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]
Re:How to Write Unmantainable Code
by xyzelement on Saturday December 24, 2022 @11:42PM
(#34124329)
I think it was a much longer word, and to be clear - neither of the dudes was German.
Re:How to Write Unmantainable Code
by stingraycharles on Sunday December 25, 2022 @02:07AM
(#34125095)
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.
T_PAAMAYIM_NEKUDOTAYIM
Hebrew for 2 dots haha
Re:How to Write Unmantainable Code
by WesolyKubeczek on Sunday December 25, 2022 @07:55AM
(#34126833)
Two double dots
Ten levels of C++ templates and typedefs are a pretty good way of proving how smart you are and making the code completely opaque.
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.
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.
Re:How to Write Unmantainable Code
by rolenthedeep on Sunday December 25, 2022 @07:03PM
(#34132960)
What kind of monster would do this
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.