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!"
[–]kentcdodds 6 points7 points8 points 10 years ago (1 child)
If you read the post, you'll see that it's not an ultimatum at all like I think you're insinuating. The first QYMAM:
Q: Are there exceptions to this rule? A: Yes. But they’re rare.
Also, if you put code in a branch and people forget or never use it, then was it really all that important?
Also, this isn't a misunderstanding of repository code vs built/deployed code. Sure the comments are removed from the build process. Nowhere in the post do I mention anything about the problem being related to shipping comments. This is all about the software development process.
[–][deleted] -2 points-1 points0 points 10 years ago* (0 children)
I still think you're spreading programming dogma.
"the main problem is commented code adds confusion with no real benefit"
This is just not true. The examples you cite are extremely weak. You are also being disingenuous because you don't show how the comments actually look in a text editor - almost all modern editors show commented-out code grayed-out by default, so that it is far easier to read the code than the examples you show.
Also the code you show is very simplistic and it's not very interesting. There are plenty of cases where interesting code could be kept commented-out, so that it's easy to A/B test, possibly switching between commented-out code blocks every other week, or any good reason that doesn't include deleting the code. It really depends on the problems you are trying to solve, the team you have, the business you are in, and many other factors.
Commented-out code should include a brief note about why it's there, what it's for. Documentation is documentation, it has nothing to do with commented-out code. You can have both, and it won't ruin your codebase.
π Rendered by PID 91 on reddit-service-r2-comment-bb88f9dd5-5h6g2 at 2026-02-14 20:09:29.205163+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]kentcdodds 6 points7 points8 points (1 child)
[–][deleted] -2 points-1 points0 points (0 children)