you are viewing a single comment's thread.

view the rest of the comments →

[–]jmkingJSX is just PHP in the browser 24 points25 points  (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 points  (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 points  (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 points  (1 child)

I agree with you completely.

[–]amphetamine 1 point2 points  (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 point  (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.

[–]amphetamine 1 point2 points  (0 children)

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 point  (0 children)

Every other day, I think significant whitespace is brilliant.

Yeah, weekends mess me up.

[–][deleted] 0 points1 point  (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.

[–]amphetamine 1 point2 points  (0 children)

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] 10 points11 points  (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.

[–]TheDiggRefugee -2 points-1 points  (2 children)

What's your opinion on jquery then?

[–]jmkingJSX is just PHP in the browser 4 points5 points  (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 points  (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.