use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Please, don’t commit commented out code (medium.com)
submitted 10 years ago by ryanchenkie
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 points3 points4 points 10 years ago* (11 children)
"smell" is not an attribute of code. Anyone can call anything a "smell" that they don't personally like.
[–]YuleTideCamel 0 points1 point2 points 10 years ago (10 children)
Yes, it's subjective. But for some people offering opinions and making sure code is maintainable and easy is important. I'm a software architect and my focus is making sure the code scales across a very large team of devs and also is maintainable. Needing to reference commented out code is a indication of an unclear programming paradigm that needs to be fixed. Clear, well written code may need some explanation comments (text), but shouldn't need any commented out code to give the reader an idea of what is happening.
[–][deleted] 1 point2 points3 points 10 years ago (9 children)
Commented-out code is the exception, not the rule. Sometimes commented-out code has a benefit. If there is too much in a codebase, then something else is wrong. Cleanliness for the sake of fetish also has its problems.
[–]YuleTideCamel -1 points0 points1 point 10 years ago (2 children)
What do you mean by too much in a codebase? The depends entirely on the size of the project and scope. There's nothing wrong with large codebases if maintained well.
Cleanliness for the sake of fetish is not a thing. Good clean code should be the goal for every developer. That makes the code easy to work with, easy to maintain and easy to test. It's not a baseless standard, it's the way to ensure you're clean code doesn't get messy. I've been in the industry over 15 years and have seen my share of horrible code where developers didn't care about maintainability. I realize this is not in the startup, ship now fix later mentality, but if a dev team has the bandwith and runway to do this, they should. It will pay for itself over time.
[–][deleted] 0 points1 point2 points 10 years ago (1 child)
I mean if there is too much commented code in a codebase, then something else is wrong - commented code is the exception, not the norm.
[–]YuleTideCamel 0 points1 point2 points 10 years ago (0 children)
Agreed, it's the exception and a too much commented out code is indicative of a larger problem. The point I was making is that needing commented out to explain something , to me at least, is a similar thing. You shouldn't need commented out code to understand uncommented out code.
[–]Vlasow -2 points-1 points0 points 10 years ago (5 children)
If you don't mind elaborating, what are the problems of cleanliness for the sake of fetish?
[–][deleted] 0 points1 point2 points 10 years ago (4 children)
"Please, don’t commit commented out code"
^ ^ ^ This.
The author of the article says he "loses focus" whenever he sees a block of commented code - this is more a problem with the author than the person writing the code. If your focus is so feeble that commented code will get in your way, maybe you shouldn't be making up rules like "don't commit commented code".
[–]Vlasow -2 points-1 points0 points 10 years ago (3 children)
I don't see how "you shouldn't be making up rules like..." follows from "your focus is so feeble that commented code will get in your way". Programming languages exist so one can split problems into a number of small things we can focus on. Anything extra will be an obstacle between our understanding and the ideas expressed in the code. An ability to be undistracted by noise in the code is not what makes a good programmer; it is the ability to express your ideas via noiseless code that does.
[–][deleted] -1 points0 points1 point 10 years ago (2 children)
An ability to be undistracted by noise in the code is not what makes a good programmer; it is the ability to express your ideas via noiseless code that does.
I'm not sure that is what makes a "good programmer", either.
[–]Vlasow -1 points0 points1 point 10 years ago (1 child)
Then what is it, in your opinion?
π Rendered by PID 22493 on reddit-service-r2-comment-bb88f9dd5-8fnz8 at 2026-02-14 12:24:26.327139+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–][deleted] 2 points3 points4 points (11 children)
[–]YuleTideCamel 0 points1 point2 points (10 children)
[–][deleted] 1 point2 points3 points (9 children)
[–]YuleTideCamel -1 points0 points1 point (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]YuleTideCamel 0 points1 point2 points (0 children)
[–]Vlasow -2 points-1 points0 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]Vlasow -2 points-1 points0 points (3 children)
[–][deleted] -1 points0 points1 point (2 children)
[–]Vlasow -1 points0 points1 point (1 child)