3

How did you fix that bug?

Comments
  • 1
    Why is it bad to leave commented code when committing? Genuine question. I was told on pull requests to always remove commented code. Its harmless and doesnt fuck up anything
  • 6
    @b2plane when using versioning it doesn't really matter, except for stuff that changes often. In that case it might just be less work. In some cases it might be useful for testing/debugging purposes.

    I guess the idea with unneeded code is, that you can restore it in a versioned environment, thus not need for it to exist in commented form.
  • 7
    @b2plane plus, code commented out is usually buggy and irrelevant to the current version of implementation. So, having it around is a distraction and induces comparisons which could lead to bugd
  • 1
    Tldr; after clean-up a third smaller codebase emerged. Readability improved a lot.

    My previous colleagues were still commenting out stuff for (historic) reference and in case they might need it again in some form. Besides messing with statistics and copy pasting from outdated sources the readability was the greatest problem. When trying to follow some code that is otherwise ordered but interrupted here and there is super annoying. Over time it just accumulates to become a serious problem.
Add Comment