Live data from Hacker News

How to write unmantainable code (2015)

github.com

51–60 of 87 posts

Re: How to write unmantainable code (2015)

#51

It's a fun read, but it is pretty much impossible unless you're running a one-man show, with zero oversight or checks at place. Code like that should set off alarms very fast, and any code review should catch it early on.

That is why you make sure your team mates are either in on it or too weak to protest.

Re: How to write unmantainable code (2015)

#54
post #49

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…

T_PAAMAYIM_NEKUDOTAYIM

Hebrew for 2 dots haha

Re: How to write unmantainable code (2015)

#55
post #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.

Grunt. Yarn it!

Re: How to write unmantainable code (2015)

#57
One of my favorite tricks is to combine functions that get called recursively (ideally four-five calls before you get back to the first one in the circle) with objects that are gradually unpacked such that their identically named member functions do subtly different things.

Re: How to write unmantainable code (2015)

#58
Inherited one project where the previous developer enjoyed writing if cases like this

    if (article > 0)
confusing early on becuase you would start thinking this is a beginning of arithmetic comparison of numbers when it actually was just a check if the article existed or not.

Re: How to write unmantainable code (2015)

#59

They forgot the masterpiece I saw years ago: 1. Give all your Python class members a tedious naming convention. 2. Be DRY by writing helper functions that do name lookup based on a string of the last half of the member name. 3. Be even more DRY by having the function guess a little if the match isn’t exact You now have an application where you cannot search for where members are referenced.

Oh, you mean like the oh-so-great Laravel framework, which is structured like this exclusively?

Re: How to write unmantainable code (2015)

#60
post #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

Counter is Zähler, not Zahlen, though.
Post reply on HN