Live data from Hacker News

How to write unmantainable code (2015)

github.com

41–50 of 87 posts

Re: How to write unmantainable code (2015)

#41
> If you call your variables a, b, c, then it will be impossible to search for instances of them using a simple text editor.

My friends, it’s time we all learn regex. You’ve heard it’s unknowable, but a simple \b on either side of your target search is your friend too! It just means “there isn’t an alphanumeric character next to me!” It wants to get to know you! If you can’t search for a variable named a, it wants to help!

Re: How to write unmantainable code (2015)

#42

Earlier quoted context omitted.

I feel like every coder has to overdo it at least once to truly grok why it is a balancing act. And I think that oftentimes leads to the discovery that every best practice is a balancing act.

A good rule is two maybe even three duplications is ok. After that, probably tome to refactor at least a little. Often this rule of thumb saves some efforts.

W.E.T. then D.R.Y.

(Write Everything Twice)

Re: How to write unmantainable code (2015)

#43
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

I think it was a much longer word, and to be clear - neither of the dudes was German.

Re: How to write unmantainable code (2015)

#47
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.

[deleted]

Re: How to write unmantainable code (2015)

#48

> If you call your variables a, b, c, then it will be impossible to search for instances of them using a simple text editor. My friends, it’s time we all learn regex. You’ve heard it’s unknowable, but a simple \b on either side of your target search is your friend too! It just means “there isn’t an alphanumeric character next to me!” It wants to get to know you! If you can’t search for a variable named a, it wants to…

I did unspeakable multiplication with regex this weekend to help a friend fix an ebook. Feel free to ask me how

Re: How to write unmantainable code (2015)

#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

Re: How to write unmantainable code (2015)

#50
post #40

Earlier quoted context omitted.

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.
Post reply on HN