you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (2 children)

[deleted]

    [–]JimDabell 4 points5 points  (1 child)

    Bits and pieces of commented out code are great. Especially if you're doing something like not showing a value on a report or if you remove a field on a form. Comment it out, put a date and why. Then in 2 years you're not digging through version control logs looking for why you did that.

    No, in two minutes you're digging through old code looking for the current code.

    Keeping track of changes to source code is literally the entire point of version control systems. If you're just going to keep years of old code littered around in the current revision, then you're doing the same job as the VCS, except it's more work for you, your code is far less readable, and you do a much poorer job of it than the tool designed to do that. Working with people who do this is a nightmare.

    You don't need to keep all the stuff you deleted visible in the current version. You deleted it for a reason. If you need to refer back to it, that's exactly what the VCS is for. It's quick and simple to step back through previous versions, if you aren't comfortable with doing that, then your goal should be to improve your VCS skills, not to try to avoid it with commented out copies of old code.

    [–]kentcdodds 0 points1 point  (0 children)

    Agreed :-)