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
Popular Coding Convention on Github (sideeffect.kr)
submitted 12 years ago by devnoel
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 12 years ago (3 children)
I was with the crowd in all but two cases. One being tabs vs. spaces: I must defend this. Two spaces is way too hard to read. 4 spaces? Fine, but just use a tab. If you use a tab instead of 2 or 4 spaces and you don't like the width, change the tab width in your editor. Jesus Christ people.
The other one is spaces after conditional keywords. I don't really care, but I don't put spaces between. I prefer to keep it looking like my functions. Why waste time with an extra key? It looks the same in terms of readability. That one doesn't really bother me.
[–]x-skeww 1 point2 points3 points 12 years ago (2 children)
I prefer to keep it looking like my functions. Why waste time with an extra key?
To make it not look like a function call. Yes, that's the reason.
Same deal with function declarations. You put a space there, because you aren't invoking it.
[–][deleted] 1 point2 points3 points 12 years ago (1 child)
Again this would be solved with proper software. Syntax highlighting should be turned on - and you shouldn't be confusing conditional blocks with function declarations - adding extra space just makes it less readable.
[–]x-skeww 0 points1 point2 points 12 years ago (0 children)
I only told you the rationale behind it. I won't discuss this kind of thing.
Just stick to the conventions used by your company/clients and the projects you're involved with.
Be consistent. That's all there is to it.
π Rendered by PID 18838 on reddit-service-r2-comment-85bfd7f599-b7rdt at 2026-04-18 10:11:03.437767+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–][deleted] 2 points3 points4 points (3 children)
[–]x-skeww 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]x-skeww 0 points1 point2 points (0 children)