News for hackers. Stuff that matters.
Re:How to Write Unmantainable Code by xyzelement on Saturday December 24, 2022 @08:23PM (#34123080)
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.

Re:How to Write Unmantainable Code by heavyset_go on Saturday December 24, 2022 @09:14PM (#34123402)
That last anecdote is too relatable.
Re:How to Write Unmantainable Code by dfee on Saturday December 24, 2022 @09:28PM (#34123492)
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!
Re:How to Write Unmantainable Code by haginile on Saturday December 24, 2022 @09:37PM (#34123566)
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.
Re:How to Write Unmantainable Code by kwkelly on Saturday December 24, 2022 @10:36PM (#34123959)
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

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.
Re:How to Write Unmantainable Code by ruune on Sunday December 25, 2022 @07:35AM (#34126694)
Maybe Zählvariable or something like that?
Re:How to Write Unmantainable Code by dayjaby on Sunday December 25, 2022 @03:40AM (#34125449)
Counter is Zähler, not Zahlen, though.
Re:How to Write Unmantainable Code by tored on Sunday December 25, 2022 @01:53AM (#34125050)
T_PAAMAYIM_NEKUDOTAYIM
Re:How to Write Unmantainable Code by orrymr on Sunday December 25, 2022 @03:03AM (#34125308)
Hebrew for 2 dots haha
Re:How to Write Unmantainable Code by WesolyKubeczek on Sunday December 25, 2022 @07:55AM (#34126833)
Two double dots
Re:How to Write Unmantainable Code by gfaregan on Sunday December 25, 2022 @06:52AM (#34126423)
Ten levels of C++ templates and typedefs are a pretty good way of proving how smart you are and making the code completely opaque.
Re:How to Write Unmantainable Code by zcw100 on Sunday December 25, 2022 @08:31AM (#34127080)
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.
Re:How to Write Unmantainable Code by ascotan on Sunday December 25, 2022 @11:15AM (#34128406)
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