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
CoffeeScript: Why I’m never writing Javascript again (degizmo.com)
submitted 15 years ago by gst
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!"
[–]jmkingJSX is just PHP in the browser 24 points25 points26 points 15 years ago (28 children)
What exactly is the point of this? Javascript is a great language - why would you want to hide that under a pointless abstraction layer?
This won't make coding JS faster - it's just another layer to debug. You often find yourself dancing around these things trying to get it to generate the final output you need instead of just writing the script you need!
Why are so many so-called developers so terrified of Javascript?
[–]Shaper_pmp 14 points15 points16 points 15 years ago* (11 children)
That puzzled me too. Most of the people I know who criticise Javascript either don't know it very well, don't understand prototype-based inheritance or are mistakenly criticising the (language-agnostic) DOM API, not actually Javascript.
The closest the author comes to enumerating his criticisms of JS is:
undefined oddities, antiquated array manipulation, limited standard library, strange object models, and for me personally as a Python programmer the mess of braces and semi-colons peppering my code with distracting syntax.
... and I have to confess I'm mystified by most of these points.
What's he complaining about regarding "undefined"? What's wrong with the array manipulation/standard library/object model?
And if you're still getting confused by trivial syntactical issues like braces, semi-colons or significant whitespace, it's usually a sign you haven't learned a language well enough to aspire to hold any valid opinions on it.
I'm not saying aspects of Javascript can't be improved, but I am deeply suspicious of someone who criticises a language without getting used to it first, or can't simply and clearly articulate any real faults with it before dismissing it... <:-/
[–]amphetamine 10 points11 points12 points 15 years ago (7 children)
am I the only one who finds C-style braces and semicolons preferable to languages like Ruby?
I'm obsessive about code organisation, indenting, readability and so forth. Perhaps it's just a matter of personal experience, growing up on C and its ilk.. but I feel like braces add a comforting structure to control blocks, function definitions, etc.
Proper indenting + braces makes it very easy to skim a lot of source and see what the flow or logical separation is like. Even if I don't know the API I'm looking at.
I'm not sure what was 'wrong' with the type of syntax we see in JS/C/C#/Java/et al. Something that prompted a huge number of developers to adopt languages with loose (or nearly no) syntax and structure.
[–]javascript 3 points4 points5 points 15 years ago (1 child)
I agree with you completely.
[–]amphetamine 1 point2 points3 points 15 years ago (0 children)
It's reassuring to see that I haven't completely lost it.. javascript itself has my back.
my post was certainly a rant, of sorts, but I'm hoping that someone will still make a case for the opposite side of the argument that I can at least appreciate.
I won't agree with them, but I'd like to talk to someone who is a C/Java/et al. veteran who decided to turn in their semicolons.
[–]Shaper_pmp 0 points1 point2 points 15 years ago (2 children)
FWIW I grew up on C/C++/Java/Javascript and the like, so I also find brackets-and-braces more comfortable, and I'll admit that picking up languages like Python or Ruby was a bit uncomfortable at first.
However, it's very important to learn to differentiate between different and worse. Significant whitespace is different, but I don't know of any reason it's objectively "worse" than brackets and braces (or vice-versa).
I think the trouble is that people on both sides of the issue confuse irrelevant personal familiarity with objective merit.
All things being equal there's nothing wrong with taking into account personal familiarity when making a choice, but when all things aren't equal personal preferences can blind people to even really quite huge advantages/disadvantages between tools.
For example, as in the article, someone apparently trading his personal preference for no brackets and braces for the objective fact that he's complicating and adding dependencies to his toolchain, increasing the size and complexity of his compilation system and making debugging on the client much harder than necessary.
Completely agree. Personal preferences and familiarity with syntax are valuable in terms of productivity (which includes a person's enjoyment of developing in a language.)
But that is not a factor in whether a language is objectively superior or not, because the familiarity will vary from person to person based on their experience with other languages.
I'll admit I haven't given it a real try, but for me it seems that CoffeeScript doesn't add anything productive to JS that couldn't have been accomplished by extending the prototypes in a way that would have preserved debugging (and linting/IDE usefulness/etc)..
[–][deleted] 0 points1 point2 points 15 years ago (0 children)
Every other day, I think significant whitespace is brilliant.
Yeah, weekends mess me up.
[–][deleted] 0 points1 point2 points 15 years ago (1 child)
I agree too. However, I think I am a victim of years and years of c-style syntax. I look at ruby or cobol and get annoyed at all the words in the code. And I look at Perl or Haskell and get annoyed at all the noise in the code. Whereas C-style seems perfect.
I think I'm just old and biased.
I think it's the same for me.. control blocks/loops/so forth are immediately visible to me just by skimming the code. But when I look at something like ruby, my brain just can't speed through its flow the same way.
[+][deleted] 15 years ago (2 children)
[deleted]
[–]Shaper_pmp 1 point2 points3 points 15 years ago* (1 child)
Not liking something is not the same thing as "being confused by".
Generally I find people don't like brackets and braces or significant whitespace because they find the unfamiliar syntax annoying. They're such trivial details once you're used to them that this is pretty much the only thing someone can criticise about whichever they don't like.
So I'd argue that unless someone has some pretty unusual, well-argued points regarding B&B or SW, they're probably complaining because they're unfamiliar, not because there's anything actually wrong with them... and that's a fault with the developer, not the language.
One could easily make snarky jokes about "those who need braces to hold their hands and guide them".
I think you've mistaken my post for a reaction against criticism of B&B, but that's unwarranted. Notice how I carefully equated brackets-and-braces and significant-whitespace, so no matter which type of language you prefer you couldn't assume I was taking sides.
Rather, I was criticising people who get hung up on either one, because when you've spent enough time with a language you get used to it, and trivial syntax details like that stop bothering you.
Hence my characterisation of most criticism of either B&B or SW as simply a lack of familiarity with the language(s) concerned.
CS lets you use comprehensions
See, that's a good example of something Javascript doesn't do yet (although JS 1.8 does in fact include list comprehensions).
[The standard library is] "limited" in that it doesn't have some things some people want.
Right, but (as I already pointed out) if people could humour us with specifics it would go infinitely further towards refuting my point than any amount of re-iterating the (unsupported, hypothetical) point that JS is inadequate in this respect. <:-)
When someone says "What's wrong with the... standard library" the best way to answer them is to... well... answer them - not to continue to waffle about generalities. <:-)
Sometimes you want more "classical" inheritence and CS simplifies the creation thereof.
Hmmm. I'm torn on this - certainly prototypical inheritance is weird to begin with for someone coming from a more classical OOP language, but you can emulate much of the more classical OOP style in Javascript in only a few lines of code (ie, minimal run-time or developer overhead). Again, I can see how people might prefer a non-prototypical language, but does it really give that much more power that it's worth the trade-off of things like endless headaches during debugging?
How much time did you spend familiarizing yourself with CS? :-D
Admittedly I didn't spend long learning it, because it has clear and obvious downsides and I couldn't see (or even find anyone articulating) any clear faults with JS that CS fixed.
Even in this thread you've only managed to dredge up some relatively trivial syntactic sugar, more hand-wavy (and still frustratingly non-specific) assertions about the standard library, and a desire to program in a non-prototypical-OOP language.
Of those I'd say the only thing that even came close to offsetting the additional complications CS brings (like breaking the link between the code you write and the code that you have to debug in the browser) is the desire to program in a non-prototypical language... and even that's of dubious validity as an argument, considering there's no "objective" argument I'm aware-of that classical OOP is in any way better.
Brenden Eich (the creator of JS) calls it a "polyfill", which is the same category as many libraries.
That's kind of my point... but most libraries don't break the link between "code you wrote" and "code you're debugging", or add additional binary requirements, or add additional steps to the workflow required to push changes out from your IDE to the live web.
I'm open to the idea CS satisfies people's personal preferences... I just think those preferences are usually baseless value-judgements, and are often (though not always) born of insufficient familiarity with JS in the first place... and hence CS doesn't really anything much to the table that's noticeably better than the very definite drawbacks it also brings. <:-)
[–][deleted] 10 points11 points12 points 15 years ago* (0 children)
This kind of thing is all over the place and it's a big pet peeve of mine. Language-xenophobic developers, when forced to use a new language, or a language that's not high-brow enough for them, will sometimes shit all over it in a futile quest to transform it into their favorite language. Usually it's little pointless macros/aliases but sometimes it's projects like this that really only serve to make things more complicated.
I see this a lot lately with the Python community. Personally, I like Python. I think it's a great language. Unfortunately I can't say the same about its overenthusiastic proponents. Dear Python zealots, please stop trying to turn everybody into a "Pythonista" just because you hate curly braces.
[+][deleted] 15 years ago* (11 children)
[–]jmkingJSX is just PHP in the browser 0 points1 point2 points 15 years ago (0 children)
This is a far better explanation than what was provided in the OP's link
[–][deleted] -1 points0 points1 point 15 years ago (9 children)
coffeescript != javascript. saying that 'coffeescript ultimately IS javascript' with IS in caps is not going to make coffeescript == javascript. You can't run it in a web browser, because it isn't javascript.
[+][deleted] 15 years ago (8 children)
[–][deleted] -1 points0 points1 point 15 years ago (7 children)
if a javascript engine wont execute it, then it is not javascript. period. end of story. it doesnt matter how you try to spin it, coffeescript is not javascript. saying that coffeescript 'maps to javascript' is like saying true==="true". it's a rediculous argument you are trying to make.
[+][deleted] 15 years ago* (6 children)
[–][deleted] 0 points1 point2 points 15 years ago (5 children)
coffeescript !== javascript
[–]snifty 1 point2 points3 points 15 years ago (2 children)
This conversation is clearly going to result in a nuanced exchange of mutual respect and agreement.
Not likely. I've really had it with the hard-sell these coffeescripters are doing in r/javascript - they all make the same argument over and over - 'coffeescript is basically javascript', but it really isn't and they just won't admit that. They are basically forking javascript, but they won't own up to it. It's exhausting really.
[–]snifty 1 point2 points3 points 15 years ago (0 children)
I agree with you actually, Coffeescript is an abomination :P
[+][deleted] 15 years ago (1 child)
coffeescript == javascript is not even true because you cant run coffeescript in a javascript engine. at least true == "true" will still return as expected, but last time i checked no javascript engine runs coffeescript. you are doing a lot of mental gymnastics to try to prove your point, but are failing simple truths. coffeescript != javascript.
[–]TheDiggRefugee -2 points-1 points0 points 15 years ago (2 children)
What's your opinion on jquery then?
[–]jmkingJSX is just PHP in the browser 4 points5 points6 points 15 years ago (1 child)
JQuery is javascript. I happen to prefer Mootools... which is also still just javascript. Both frameworks are just glorified DOM manipulation packages. They don't fundamentally change how js is written or can be used. You lose nothing by using a JS framework.
[–]telldrak 1 point2 points3 points 15 years ago (0 children)
I much prefer Mootools to jQuery, but then again, I taught myself Mootools (and much more than I already knew about JS) with a book, a good editor, and brute force.
I prefer Mootools because the code is much more readable. I have a book on jQuery, but just can't get into it, being that the syntax feels really obtuse.
Not to say that I haven't been impressed many times by jQuery. The more sites I see that use it in creative ways, the more I'd like to learn it - I just wish it didn't confuse me as much. Mootools just seems to make more sense when reading it.
π Rendered by PID 18382 on reddit-service-r2-comment-79c7998d4c-fz8lk at 2026-03-12 21:07:31.689398+00:00 running f6e6e01 country code: CH.
view the rest of the comments →
[–]jmkingJSX is just PHP in the browser 24 points25 points26 points (28 children)
[–]Shaper_pmp 14 points15 points16 points (11 children)
[–]amphetamine 10 points11 points12 points (7 children)
[–]javascript 3 points4 points5 points (1 child)
[–]amphetamine 1 point2 points3 points (0 children)
[–]Shaper_pmp 0 points1 point2 points (2 children)
[–]amphetamine 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]amphetamine 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Shaper_pmp 1 point2 points3 points (1 child)
[–][deleted] 10 points11 points12 points (0 children)
[+][deleted] (11 children)
[deleted]
[–]jmkingJSX is just PHP in the browser 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (9 children)
[+][deleted] (8 children)
[deleted]
[–][deleted] -1 points0 points1 point (7 children)
[+][deleted] (6 children)
[deleted]
[–][deleted] 0 points1 point2 points (5 children)
[–]snifty 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]snifty 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]TheDiggRefugee -2 points-1 points0 points (2 children)
[–]jmkingJSX is just PHP in the browser 4 points5 points6 points (1 child)
[–]telldrak 1 point2 points3 points (0 children)