←back to thread

873 points belter | 1 comments | | HN request time: 0.216s | source
Show context
ZaoLahma ◴[] No.42947654[source]
> Most programming should be done long before a single line of code is written

Nah.

I (16+ years developer) prefer to iteratively go between coding and designing. It happens way too often that when you're coding, you stumble across something that makes you go "oh f me, that would NEVER work", which forces you to approach a problem entirely differently.

Quite often you also have eureka moments with better solutions that just would not have happened unless you had code in front of you, which again makes you approach the problem entirely differently.

replies(16): >>42947849 #>>42948402 #>>42948536 #>>42948683 #>>42948786 #>>42949252 #>>42949429 #>>42949588 #>>42950167 #>>42950238 #>>42950409 #>>42953785 #>>42955243 #>>42956358 #>>42957524 #>>42964457 #
VyseofArcadia ◴[] No.42948536[source]
Iterative work is THE way to work in large legacy codebases. The minute you wade into the code, all of your planning is moot. You don't know what's lurking below the surface. No one knows what's lurking under the surface. Except maybe Dave, because he vaguely remembers about 15 years back talking to some guy who wrote some code 30 years back about it.

Greenfield, absolutely design up front you lucky devils, but iterative is the way otherwise.

replies(6): >>42948610 #>>42949170 #>>42949340 #>>42951151 #>>42956824 #>>42962429 #
bluGill ◴[] No.42949170[source]
Greenfield lasts only for at best 2 years or the first public release. After that it is legacy.

I'm am the "Dave" on my current code since I was one of the first engineers on the project and the others before me have long moved to management. There is a lot I don't know about how the code works. There are dark corners we just lifted completely from an earlier project where the guy who wrote it 30 years back is retired. This is normal.

I'm fighting desperately to keep this code in shape as I don't want to go to management to ask for $$$ (billions) to rewrite it. I regret many choices. I'm making other choices in response that I fear someone will regret in 15 more years. I'm hoping to retire before then - better talk to me now because soon the people who have talked to the person who wrote the code 30 years ago will also be a memory. (the guy who write the code 30 years ago is still alive and someone has his phone number - they talk once a year about something weird to see if why is remembered)

replies(1): >>42961838 #
1. arkh ◴[] No.42961838[source]
> I'm making other choices in response that I fear someone will regret in 15 more years.

Junior dev made to maintain some code base: "wtf, all this old code suck. People were really bad at their job".

Same dev 5 years later: "wellll, this looks bad but there must be a reason.". Usually the reason is someone sold a new feature without asking the implementers or even checking what the impacts could be. So it has to be ready yesterday and you'll never get approval to refactor or clean-up anything, until it breaks.