Live data from Hacker News

How to write unmantainable code (2015)

github.com

31–40 of 87 posts

Re: How to write unmantainable code (2015)

#31

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-en…

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 (2015)

#33

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-en…

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 (2015)

#34
I just reworked some java code that is deployed INSIDE an oracle database. You can load java classes into oracle and use them like functions.

So I would say: find the most obscure place you can deploy code, and make sure it is not testable.

Re: How to write unmantainable code (2015)

#35
post #18

My favorite is when the codebase is so deeply buried in macros and headers that send you on a wild goose chase to find any actual code that it becomes much easier to just dump the binary in ida/binja. The source code can lie but at least the compiled binary directly does what it says

That feeling when you finally, finally find the bit of code you’ve been looking for… and you can no longer remember why you were looking for it, because you’ve completely purged your short term memory.

Re: How to write unmantainable code (2015)

#36

Heh. The author forgot the most important one: Use micro-services! The more the better! And write each micro-service using a different programming language and build system. Make sure the protocols are not documented. And that the micro-services are called p376, f190 etc. Make sure that some micro-services need to access a specific server setup to build!

Pfft. You haven’t lived until you have introduced a circular dependency between two or three modules.

Re: How to write unmantainable code (2015)

#40

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-en…

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

Post reply on HN