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!
How to write unmantainable code (2015)
41–50 of 87 posts
Re: How to write unmantainable code (2015)
#42Earlier 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.
(Write Everything Twice)
Re: How to write unmantainable code (2015)
#43My 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
Re: How to write unmantainable code (2015)
#44Re: How to write unmantainable code (2015)
#45Re: How to write unmantainable code (2015)
#46Re: How to write unmantainable code (2015)
#47My 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)
#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…
Re: How to write unmantainable code (2015)
#49My 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…
Re: How to write unmantainable code (2015)
#50Earlier 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.