Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My take is that code is disposable, and often needs to be written to figure out what is really needed, then disposed off.

Learning this is worth writing the otherwise useless code.



This is why I strongly adhere to WET¹, you discover so much about the domain the first time you write something. By the time you have it 'working' you realize you should've written vastly different code to solve or cut-off edge cases.

That's why these days I just start writing code, get it to 'it works!' level. To then throw it all away and start again. Takes a little more effort, but the payoff is far less problematic code and tech debt.

¹: Write Everything Twice


Don't do WET with your entire system, though, or you're likely to end up with the Second System Effect.


I think the idea is you never release the first version.


My reaction to the article title was recalling how old assembly teachers would drill into our heads to make sure we have proof of 200% gains before implementing an optimization. However the article shows how sometimes such planning doesn't work.


Or one should spend a little more time at first to fully understand the problem, in both the mentioned case and the OP, use realistic data.


Writing code is very very often a big part of understanding any new problem. It's just that you should be quite comfortable discarding that code. Refactor mercilessly and all that.


Writing code that solves the problem is a huge way of proving you understand the problem.


Sometimes you can't have realistic data without writing some code first, that will allow you to gather that data.


I came to the same conclusion months ago with the advent of coding LLMs.... I used to treat code as precious, carefully saving, cataloguing and referencing git commits and SQL scripts and command line histories, because they were painful to write, and thus they are valuable. I mean, they were, because when I had the same need again, I could find previous instances and reuse stuff.

Now ? I just dump the problem into an LLM and it spits up a script that solves it, and then I throw away the script because it horribly bugged for any other case then my particular problem, but hey, I just solved my problem




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: