Live data from Hacker News

ECMAScript 6 looks promising

kishorelive.com

61–70 of 94 posts

Re: ECMAScript 6 looks promising

#61

Earlier quoted context omitted.

Because it's kind-of a mish-mash, and syntactic elements imported from other languages (I know) tend to behave differently in subtle ways, usually making them worse or weird. Also having a single token change so much meaning (fat vs thin arrow) feels icky and hard to read/notice.

You've obviously never used CoffeeScript.

You're also a Go user are you not? If you're not, you should start, you've already got the reaction down pat.

Re: ECMAScript 6 looks promising

#62

CoffeeScript is popular and there is Dart. Instead of using another language and translate to JavaScript, what are the hindrances to improve JavaScript so that the "bad parts" are removed? Maybe a 'half-clean' break from existing javaScript? Sorry for my ignorance.

There's a very high interia, as there are at least 5 major implementations still being developped (MSIE's Chakra, Mozilla's SpiderMonkey, Google's V8, Apple/Webkit's JavaScriptCore and Opera's Carakan).

Work has not stopped, but it's basically about cat-herding, and each player does his own additions. As an example, Mozilla has kept working on core Javascript with "internal" versions:

1.6 added Array Extras and String and Array generics (array extras have since then been adopted by everybody else) as well as E4X (literal XML syntax in JS) and a `for each` loop.

1.7 added generators and iterators, array comprehensions (listcomps), let definitions, statements and expressions and destructuring assignments

1.8 added a function shorthand (function (foo) { return bar; } => function (foo) bar), generator comprehensions (lazy listcomps) and two missing array extras (left and right folds)

1.8.1 and 1.8.5 mostly added ES5 and draft APIs (e.g. the Object.* stuff and the Proxy type)

Re: ECMAScript 6 looks promising

#64

CoffeeScript is popular and there is Dart. Instead of using another language and translate to JavaScript, what are the hindrances to improve JavaScript so that the "bad parts" are removed? Maybe a 'half-clean' break from existing javaScript? Sorry for my ignorance.

You can already remove a bunch of the bad parts via "use strict".

Re: ECMAScript 6 looks promising

#65
post #48

Earlier quoted context omitted.

That's a fair perspective, although what you call a "mish-mash" I'd call borrowing the best syntax for every feature :) The syntax came out of a community effort over the course of many months, and a lot of thought went into the decisions that were made. (And of course it's still under development!) Since you mentioned the => operator in particular, I'll defend it briefly-- it's a feature JavaScript sorely needs, and…

> Since you mentioned the => operator in particular, I'll defend it briefly-- it's a feature JavaScript sorely needs, and in the situations where it's useful it's a godsend, turning a pile of ugly JS into a single operator. Oh I understand the need for it, my issue is not with the fat arrow in and of itself, but in the fat arrow and the thin arrow. > It does seem like a small difference, but do you mix up == and -= m…

> The thin and fat arrows, by comparison, are used in the exact same contexts. This makes them much more error prone.

You can say that, but in practice it doesn't really happen. They look somewhat different, they do somewhat different things. It's programming, ya know?

Not that I'm trying to make you like it or anything-- of course you have the right to your own aesthetic sensibility.

Re: ECMAScript 6 looks promising

#66
post #47

Earlier quoted context omitted.

>> I doubt that the creators of ruby did not put any thought into this, and I'd be interested in their justification. I don't know what Matz's thinking was, but it may just be that Ruby owes a great deal to Perl. Interpolation in double-quoted strings is present in Perl (and used constantly).

I think the bad part of string interpolation is that it encourages to use it constantly, in place, instead of extracting it to method. Gluing strings together is the weak point of application, and should be hard to do, to encourage people to wrap it in functions, that can also validate input, escape what needs to be escaped, etc. Maybe that's my "discipline and bodage" part talking :)

I'm a very small-scale, amateur programmer, but that sounds like over-engineering to me. Getting variable values into strings is often necessary. A programming language shouldn't make something common hard, just to enforce a particular view of best practices. Note: I'm not saying that "make it a method" is a bad idea - in general or in the case of a specific project or a specific size of codebase. But I don't like the idea of the language enforcing such a restriction.

Having said that, my first language was Perl, and I'm still a fan of TMTOWTDI and making common things easy.

Re: ECMAScript 6 looks promising

#67
post #25

Earlier quoted context omitted.

Because it is badly designed? Or because it is too different from js?

Because it's kind-of a mish-mash, and syntactic elements imported from other languages (I know) tend to behave differently in subtle ways, usually making them worse or weird. Also having a single token change so much meaning (fat vs thin arrow) feels icky and hard to read/notice.

[deleted]

Re: ECMAScript 6 looks promising

#68
post #25

Earlier quoted context omitted.

Because it is badly designed? Or because it is too different from js?

Because it's kind-of a mish-mash, and syntactic elements imported from other languages (I know) tend to behave differently in subtle ways, usually making them worse or weird. Also having a single token change so much meaning (fat vs thin arrow) feels icky and hard to read/notice.

What's any language, if not a mish-mash of its predecessors?

Re: ECMAScript 6 looks promising

#69
post #25
post #22

Earlier quoted context omitted.

The syntax is one of the things that keeps me from using CoffeeScript.

Because it is badly designed? Or because it is too different from js?

Because it looks like the type of syntax a Haskell developer might create...

Re: ECMAScript 6 looks promising

#70
post #17

Earlier quoted context omitted.

I think it would be slightly more consistent to re-use the multi-line quite like Python does: var foo = /* Hello there How are you? */; But less typing is good too.

So does that string literal include the spaces between "/ * [space]" and "Hello", and "you?" and "[space] * /", or not? By the fact that you included spaces in your example, does that imply it doesn't include the surrounding spaces in the string? Maybe your example implies that spaces are not included, but maybe they are or maybe they aren't, since comments don't require them, but usually have them and look ugly with…

Sorry, I read the part about HN making it difficult to format your post, but I still don't quite get your point. I think it's pretty simple what was proposed: everything between the stars is included.
Post reply on HN