Remix.run Logo
snvzz 4 days ago

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.

BigJ1211 4 days ago | parent | next [-]

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

wizzwizz4 4 days ago | parent [-]

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

MathMonkeyMan 4 days ago | parent [-]

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

4 days ago | parent | prev | next [-]
[deleted]
5pl1n73r 4 days ago | parent | prev | next [-]

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.

Cthulhu_ 4 days ago | parent | prev | next [-]

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.

TillE 4 days ago | parent | next [-]

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.

scott_w 4 days ago | parent | prev | next [-]

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

yetihehe 4 days ago | parent | prev [-]

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

ddalex 4 days ago | parent | prev [-]

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