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…
How to write unmantainable code (2015)
81–87 of 87 posts
Re: How to write unmantainable code (2015)
#82This is the way it seems to go in the public sector, at least here in Norway. 1. Get an n year government contract for some huge public IT overhaul. E.g building a new hospital journal system for a large region(this example is real, google "helseplatformen") 2. Spend years developing this huge proprietary .net monolith with a waterfall model, and minimal user interaction and testing during most of the contract. 3. Re…
The worst part is that the people who work for these companies who work for the government think that they're efficient. In reality, there are often startups out there which could build the same system better in 1/10th of the time. The bigger an organization is, the more easy money they have, the worst their expectations are when it comes to software development. I once worked for such a company as a software develop…
Then even if you get such contract you probably stop being efficient - because of red tape and lack of incentives to still be efficient because money will flow either you are efficient or not.
Re: How to write unmantainable code (2015)
#83They 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.
Re: How to write unmantainable code (2015)
#84My 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…
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 (2015)
#85They 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.
Re: How to write unmantainable code (2015)
#86> 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)
#87Earlier 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.