3 ms·
Some many times this. I absolutely hate seeing commented out code. There's a reason we use source control. If a developer doesn't want to lose code they've del
by deevus 13y ago
Some many times this. I absolutely hate seeing commented out code. There's a reason we use source control.
If a developer doesn't want to lose code they've deleted they can tag the revision in their repo so they can always get back to it quickly if needed.
- Joeboy 13y ago> Some many times this. I absolutely hate seeing commented out code. There's a reason we use source control. How is an unfamiliar developer supposed to find out that the deleted code exists?
- antonpirker 13y agoWhy should he/she want to find out?
- route66 13y ago"It worked different three months ago...". But I agree that this is no reason to gave to wade through commented out sections[1] but to simply use the powers of <vcs-of-choice> diff. [1] Including if(0){} abominations
- danieltillett 13y agoWhen the code was rewritten for efficiency. Whenever I read 'clever' code I wish I had an 'idiot' version that was written purely for me to understand.
- levosmetalo 13y agoSo true. Whenever having to write a complicated code, I always keep a simple pseudo code in comments. That helps me both to understand later what I wanted to achieve, as well as help me focus on actual implementation details after figuring out he high level algorithm.
- Joeboy 13y agoIn my day job, I sometimes get told to make changes that I suspect will cause problems in some edge case which we might not see for months. It seems like the responsible thing to do is to leave the trustworthy version of the code there for the benefit of whoever has to fix the problem when the shit hits the fan.
- darklajid 13y agoI understand that reality is more complex than this, but git bisect That should identify the/your commit in (usually) < 10 tests. At which point the previous code is still intact. Or git blame and look at the problematic lines, see who changed it and when. Now look at the git log (filtered just for this file if you want) and identify the last changes to this part of code that way. More complex than just // timestamp, initials: Changed foo, commenting the following 100 lines out maybe, but makes the day to day code so much more readable.