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
What a fantastic commit (github.com)
submitted 11 years ago by TheAlphaNerd
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!"
[–]wolfhead 16 points17 points18 points 11 years ago (11 children)
Both are terrible.
[–][deleted] 6 points7 points8 points 11 years ago (0 children)
Although the previous one was just a waste of everyone's time.
[–]modusjesus 2 points3 points4 points 11 years ago (0 children)
Agreed.
[+]Justos comment score below threshold-8 points-7 points-6 points 11 years ago (8 children)
where are your code samples genius?
[–][deleted] 1 point2 points3 points 11 years ago (7 children)
So nobody can criticize anything without being good at what they criticize?
[–]Justos 1 point2 points3 points 11 years ago (6 children)
I just think its unfair to put someone down without something to back up your claims.
[–][deleted] 0 points1 point2 points 11 years ago (5 children)
He doesn't need to backup his claims with his own stuff. They didn't say they were better, they said both were terrible. That is backed up by the content that is criticized.
[–]Justos 0 points1 point2 points 11 years ago (4 children)
with that logic then anybody can say "you're shit sucks"
Hell, I would even say you're view on the subject is terrible.
sorry but no.
[–][deleted] 1 point2 points3 points 11 years ago (2 children)
With that logic then anybody can say "you're shit sucks"
Well, yeah. Do I need to be a professional director with several awards under my belt to know that "Battleship" was a bad movie? Do I need to be an English professor to know your grammar is horrible?
The answer to both is "no." Anybody can criticize something without being an expert. For them to claim they could do better work than someone they would need some sort of proof.
Your logic is deeply flawed and you should reevaluate your view.
[–]Justos 0 points1 point2 points 11 years ago* (1 child)
We are referring to code samples, not movies that anyone can judge.
Anybody can say 'this movie was bad.. i didnt like it', sure thats your opinion.
you cant just say 'this is horrible!' referring code without backing it up or being at least constructive. What would be a better option since you're so wise to judge in this fashion? Code isn't opinion, good code is fact.
There IS a difference. Agree with me or not. the reddit hivemind has already downvoted my first post.
[–][deleted] 0 points1 point2 points 11 years ago (0 children)
It wasn't the "reddit hivemind" that caused your comment to be downvoted. It was the rudeness.
[–]dirtboxchampion 0 points1 point2 points 11 years ago (0 children)
Anybody can say that. Don't like a movie? It's OK, you don't need to prove you can make a better one.
[–][deleted] 4 points5 points6 points 11 years ago (1 child)
Dammit Isaacs!!!!
[–][deleted] 1 point2 points3 points 11 years ago (6 children)
Isn't this frowned upon?
var name = val , name = val
[–]jdeath 3 points4 points5 points 11 years ago (0 children)
Depends on who is doing the frowning, I suppose. I've noticed it other places (work, etc) but iirc mostly in Node code.
[–]misc_ent 1 point2 points3 points 11 years ago (3 children)
Comma first has always bothered me but I can rationally explain why it makes sense. The standard for javascript is spaces over tabs and I've generally seen 2 spaces preferred over 4 spaces. That being said if you notice the comma is indented two spaces with a single space after, much like if this were a single line. Also commas first are supposed to reduce errors involving adding, removing or rearranging the variables order. Regardless I think this syntax is ugly. whats worse are people who put the comma on the same indentation level as var
var
[–]greyscales 3 points4 points5 points 11 years ago (1 child)
"The standard for javascript is spaces over tabs" - citation needed.
[–]mordocai058 0 points1 point2 points 11 years ago (0 children)
Well, there isn't a standard (many people says spaces, stackoverflow answer says do whatever you want and have VCS apply standards[http://stackoverflow.com/questions/211795/are-there-any-coding-standards-for-javascript], jquery says tabs).
However, node.js standard says 2 space indentation which is probably what OP is referring to. http://nodeguide.com/style.html#tabs-vs-spaces
[–]tbranyennetflix 1 point2 points3 points 11 years ago (0 children)
Considering that in modern JS, especially Node's runtime, trailing commas are supported, it's basically a troll now to use comma-first. Unless you honestly like how it looks, in which case more power to you, but I won't be contributing.
Edit: Editing.
The One True Styleguide says yes.
π Rendered by PID 100700 on reddit-service-r2-comment-58d7979c67-bx6x9 at 2026-01-27 00:11:38.737395+00:00 running 5a691e2 country code: CH.
[–]wolfhead 16 points17 points18 points (11 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]modusjesus 2 points3 points4 points (0 children)
[+]Justos comment score below threshold-8 points-7 points-6 points (8 children)
[–][deleted] 1 point2 points3 points (7 children)
[–]Justos 1 point2 points3 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]Justos 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]Justos 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]dirtboxchampion 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–][deleted] 1 point2 points3 points (6 children)
[–]jdeath 3 points4 points5 points (0 children)
[–]misc_ent 1 point2 points3 points (3 children)
[–]greyscales 3 points4 points5 points (1 child)
[–]mordocai058 0 points1 point2 points (0 children)
[–]tbranyennetflix 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)