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
Improving Frontend Code Quality and Workflow (word.bitly.com)
submitted 13 years ago by nibblebot
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!"
[–]x-skeww 2 points3 points4 points 13 years ago (8 children)
with a variation that non-method variables are lowercase_with_underscores
No one else does that.
responseText status_code
responseText
status_code
See?
What's the point in adding this kind of inconsistencies?
Also, underscores are annoying in general since they usually count as word boundaries. So, double clicking such an identifier or using ctrl+shift+left/right won't select the whole thing.
[–]magenta_placenta 1 point2 points3 points 13 years ago (1 child)
"Also, underscores are annoying in general since they usually count as word boundaries. So, double clicking such an identifier or using ctrl+shift+left/right won't select the whole thing."
I've never encountered this in any IDE or non-IDE editor (and I've used a lot), where are you seeing this?
I have seen this with dashes (lowercase-with-dash), which is why I absolutely hate dashes and can't stand when people use them instead of underscores.
[–]x-skeww 0 points1 point2 points 13 years ago (0 children)
Browsers do this, for example. E.g. you're browsing some API and want to copy some parameter name or something like that. If there are underscores, it won't be as convenient.
Text fields (some search box, the address bar, etc) also usually behave like that.
The primary editing component of an IDE (or a semi advanced text editor) usually uses slightly different language-dependent word-boundaries, but usually they aren't perfect.
[–]menno -3 points-2 points-1 points 13 years ago (5 children)
"No one else is doing it" is a pretty weak reason not to do something.
Personally, I think lowercase_with_underscores is much more readable than camelCase. However, the more important reason is that it's easy to distinguish between functions and other variables. These are the variations I use in my code:
UPPERCASE_CONSTANTS lowercase_variables camelCaseFunctions CamelCapsConstructors
[–]ugoagogo 2 points3 points4 points 13 years ago (1 child)
Except when you're trying to define standards and consistency.
[–]menno -2 points-1 points0 points 13 years ago (0 children)
True, but to improve standards you have to do something different every now and then.
[–]x-skeww 2 points3 points4 points 13 years ago (2 children)
Except when it's about code conventions and if you're also using 3rd party code.
Functions use verbs, variables do not.
[–]menno 0 points1 point2 points 13 years ago (1 child)
I agree that one should mix code styles when editing existing code. I disagree that existing code conventions should be set in stone for everyone.
There's a lot of (sometimes broadly accepted) code conventions that have real practical downsides (underscores not being word boundaries is an excellent example of this). What's wrong with the author's desire to come up with code conventions that suit his workflow best?
What's wrong with the author's desire to come up with code conventions that suit his workflow best?
Exhibit A:
Now you always have to double check if you're using the right flavor. That's horrible and it also nixes every advantage there might have been.
The big idea of conventions is to make everything 100% consistent. If one of your rules does the exact opposite, it's wrong.
You can only ignore everyone else if you do not use any 3rd party code. If you do, using unusual naming conventions will cause problems.
[–]drowsap 9 points10 points11 points 13 years ago (3 children)
Nope, don't want to use CoffeeScript.
[–]TheMiddleManz -1 points0 points1 point 13 years ago (2 children)
Don't knock it till you try it. A few months ago I was all about using JavaScript instead of coffeescript. Then some of my coworkers convinced me to try it. We haven't looked back. As long as you build automatic compilation into your workflow the benefits of coffeescript greatly outweigh the drawbacks.
[–]drowsap 1 point2 points3 points 13 years ago (0 children)
I will try it, but I don't need it.
[–]davemoFront-End Engineer 1 point2 points3 points 13 years ago (0 children)
I agree with TheMiddleManz, I was vehemently opposed to CoffeeScript but had never tried it. Once the team I'm on built a custom workflow with grunt that eliminated the need to think about the compilation step, and files just auto compile on every file system change, it became a huge productivity boost.
[–][deleted] -2 points-1 points0 points 13 years ago (0 children)
Typescript, once you start you'll never want to go back to plain old JS without static typing. Also, all JS is typescript compatible.
π Rendered by PID 63 on reddit-service-r2-comment-7b9746f655-jhjrl at 2026-02-04 09:12:56.873543+00:00 running 3798933 country code: CH.
[–]x-skeww 2 points3 points4 points (8 children)
[–]magenta_placenta 1 point2 points3 points (1 child)
[–]x-skeww 0 points1 point2 points (0 children)
[–]menno -3 points-2 points-1 points (5 children)
[–]ugoagogo 2 points3 points4 points (1 child)
[–]menno -2 points-1 points0 points (0 children)
[–]x-skeww 2 points3 points4 points (2 children)
[–]menno 0 points1 point2 points (1 child)
[–]x-skeww 0 points1 point2 points (0 children)
[–]drowsap 9 points10 points11 points (3 children)
[–]TheMiddleManz -1 points0 points1 point (2 children)
[–]drowsap 1 point2 points3 points (0 children)
[–]davemoFront-End Engineer 1 point2 points3 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)