Live data from Hacker News

For modern development Javascript indeed is a shit language

live.julik.nl

131–140 of 243 posts

Re: For modern development Javascript indeed is a shit language

#131
post #65

Earlier quoted context omitted.

> I've been playing around with it a bit... Tell us more!

I'm afraid that there's not much to show yet, apart from some little prototype scribblings, and the basic idea: The web that we build for today is a rich, almost entirely backwards-compatible stew of nearly two decades of browser development and standards work, resulting in a triumvirate of very different languages that need to come together in order to make a web application happen: HTML + CSS + JS. Two of them are…

so basically YAML and/or Jade + SASS + CoffeeScript. I dig it.

Re: For modern development Javascript indeed is a shit language

#132

> They are not solvable by making a new ECMA spec. As it turns out, many of the issues outlined are not only very much solvable by making a new ECMA spec but either already solved in ES5 or solved in ES6. > JS has callable attributes > This is a shitty design decision I strongly recommend not following the provided link, which is basically inane, uses the term "slots" in a rather disturbing manner and makes completel…

ES6 has not been finished yet as far as I know.

It is not[0], but when TFA asserts

> They are not solvable by making a new ECMA spec.

I consider using the upcoming ("new") ECMA spec more than fair game to refute his assertions.

[0] although a number of its features are shimable, precede it by a few years, are already (possibly partially) implemented in some runtimes or are available through ES6 -> ES5 compilation via Traceur. See http://kangax.github.io/es5-compat-table/es6/

Re: For modern development Javascript indeed is a shit language

#133
post #11

Sadly I agree, you can just start with this: > [1,10,5,-15,-2,4].sort(); [-15,-2,1,10,4,5] And yes saying "oh but it is because it has weak types" doesn't excuse it, it is broken and that's that. Naming the brokeness with a label or showing why historically it is there, doesn't fix it. On the other hand they do have nice closure support, I do like some of that. But in large, the language makes me angry every time I h…

    > [1,10,5,-15,-2,4].sort();
    > [-15,-2,1,10,4,5]

    [1,10,5,-15,-2,4].sort(function(a,b){return a-b})
    [-15, -2, 1, 4, 5, 10]

Re: For modern development Javascript indeed is a shit language

#134
post #11

Sadly I agree, you can just start with this: > [1,10,5,-15,-2,4].sort(); [-15,-2,1,10,4,5] And yes saying "oh but it is because it has weak types" doesn't excuse it, it is broken and that's that. Naming the brokeness with a label or showing why historically it is there, doesn't fix it. On the other hand they do have nice closure support, I do like some of that. But in large, the language makes me angry every time I h…

[1,10,5,-15,-2,4].sort (a, b) -> a-b You're right; that was totally difficult.

  Safari/Chrome:  SyntaxError: Unexpected token '>'
  Firefox: SyntaxError: syntax error
In a discussion about Javascript maybe it would be a good idea to give examples of Javascipt that actually run in a Javascript console?

Re: For modern development Javascript indeed is a shit language

#135

Earlier quoted context omitted.

What are other runtime options? - Flash? That's almost the same as JavaScript and it's getting obsolete. - Java? No one enables it on the client, thanks to security problems. - Asm.js/LLVM? These are immature and can't be used for production.

- GWT - Dart - ClojureScript

Which compiles into JavaScript...

Re: For modern development Javascript indeed is a shit language

#136
post #82

Earlier quoted context omitted.

CoffeeScript was obviously inspired by Ruby. While CS is great, I've never gotten over the usage of "->" or "=>" to signify a function. To me, Ruby's "def" or "do" reads so much better. Especially with "end", to signify a barrier, as opposed to whitespace. Have you considered porting Ruby directly to JavaScript? By the way, thanks for your work on _ & Backbone!

> Have you considered porting Ruby directly to JavaScript? It's been done. Check out Opal. I can't say I miss Ruby's ends in CS.

Opal is cool. I prefer CoffeeScripts approach to adding functionality though, without including an entire new standard library.

Re: For modern development Javascript indeed is a shit language

#137
post #83

Earlier quoted context omitted.

CoffeeScript was obviously inspired by Ruby. While CS is great, I've never gotten over the usage of "->" or "=>" to signify a function. To me, Ruby's "def" or "do" reads so much better. Especially with "end", to signify a barrier, as opposed to whitespace. Have you considered porting Ruby directly to JavaScript? By the way, thanks for your work on _ & Backbone!

The arrow is standard mathematical notation for function definition

That's a good point, it has historical significance.

Re: For modern development Javascript indeed is a shit language

#138
post #65

Earlier quoted context omitted.

> I've been playing around with it a bit... Tell us more!

I'm afraid that there's not much to show yet, apart from some little prototype scribblings, and the basic idea: The web that we build for today is a rich, almost entirely backwards-compatible stew of nearly two decades of browser development and standards work, resulting in a triumvirate of very different languages that need to come together in order to make a web application happen: HTML + CSS + JS. Two of them are…

I've been prototyping a HTML CSS javasxript all in one language to do exactly this, in particular great support for in-code representation of the data structures common in HTML. Hopefully you'll beat me to it so I can stop spending time on it and use yours instead =D

Re: For modern development Javascript indeed is a shit language

#139
post #90

Earlier quoted context omitted.

CoffeeScript was obviously inspired by Ruby. While CS is great, I've never gotten over the usage of "->" or "=>" to signify a function. To me, Ruby's "def" or "do" reads so much better. Especially with "end", to signify a barrier, as opposed to whitespace. Have you considered porting Ruby directly to JavaScript? By the way, thanks for your work on _ & Backbone!

> Especially with "end", to signify a barrier, as opposed to whitespace. But in any programming language you're already indenting blocks for humans. Why repeat the same work? Especially when it allows for inconsistency between how a human and how a machine would read the code.

To increase the clarity, for future collaborators.

Re: For modern development Javascript indeed is a shit language

#140

Earlier quoted context omitted.

[1,10,5,-15,-2,4].sort (a, b) -> a-b You're right; that was totally difficult.

Safari/Chrome: SyntaxError: Unexpected token '>' Firefox: SyntaxError: syntax error In a discussion about Javascript maybe it would be a good idea to give examples of Javascipt that actually run in a Javascript console?

Firefox Nightly

    [1,10,5,-15,-2,4].sort ((a, b) => a-b).toString();
    "-15,-2,1,4,5,10"
Post reply on HN