Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
b2plane63951yWhy 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
-
@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. -
asgs115631y@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
-
hjk10157311yTldr; 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.
Related Rants
How did you fix that bug?
rant
programming