Re:Delete your Code
by Davidbrcz on Thursday October 05, 2017 @04:20AM
(#15407443)
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.
Re:Delete your Code
by Mysterix on Thursday October 05, 2017 @03:54AM
(#15407330)
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.
Re:Delete your Code
by thyrsus on Thursday October 05, 2017 @03:46AM
(#15407298)
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.
Re:Delete your Code
by ruairidhwm on Thursday October 05, 2017 @04:50AM
(#15407600)
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.
Re:Delete your Code
by Xoros on Thursday October 05, 2017 @10:18AM
(#15409355)
I used to do that (and there are out there many commented lines on old projects that are still active).
Now, I backup the source file somewhere for archive, run multiple tests on the new code, and make an obligation for me to deliver a cleaned source file, with no other comments than the one needed.
It's more clear when you go back to your code to not be distracted by old thoughts.
Usually it ends up distracting me outside of a few days or if it's not my own code. I end up thinking, "why is/was this here? Is it an old implementation? Did it work? Is it a work in progress? Is it the actual implementation and the code next to it a work in progress?"
Re:Delete your Code
by ruairidhwm on Thursday October 05, 2017 @04:49AM
(#15407595)
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 :)
[1] https://en.wikipedia.org/wiki/IKEA_effect
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.
Now, I backup the source file somewhere for archive, run multiple tests on the new code, and make an obligation for me to deliver a cleaned source file, with no other comments than the one needed.
It's more clear when you go back to your code to not be distracted by old thoughts.
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 :)