
Delete your Code - kiyanwang
https://hackernoon.com/delete-your-code-c5d2dc59f1ff
======
Davidbrcz
Good pieces of code are written twice. The first one is always a draft, _no
matter how big it gets_. The second one benefits from hindsight and experience
you gained when writing the first one. Once the second piece of code reaches
the same level of functionality, you simply start over the process for the
new/missing features.

------
Mysterix
This is a cognitive bias known as the "IKEA effect" [1] First time I read it
applied to coding, the author is completely right. You are much faster the
second time you write the piece of program, and it will be probably more
effective.

[1]
[https://en.wikipedia.org/wiki/IKEA_effect](https://en.wikipedia.org/wiki/IKEA_effect)

------
thyrsus
I thought this would be about deleting lines of code instead of commenting
them out "for historic insight". I'd like to see a discussion of whether the
cleanliness or the "don't go here" is more useful.

~~~
ruairidhwm
Hey

That's an interesting perspective. Personally I don't leave lines of commented
out code as I opt for cleanliness, but I do keep a journal for each project I
do where I write down little gotchas I discover, or paste in a snippet that
either works well, or doesn't and the reasons why.

------
chewbacha
Obligatory “plan to throw one away; you will, anyhow.”

------
intellix
Well you have the history in version control anyway so delete away and it's
never really gone anyway

~~~
ruairidhwm
Hey, author here!

Totally agree, which is why I didn't feel so bad about deleting it from my
system. It was more of a psychological barrier to do so I think, as it
represented starting over :)

