Language design

Kevin Smith zenparsing at gmail.com
Fri Jun 12 23:11:12 UTC 2015


https://i.imgflip.com/mtot6.jpg

On Fri, Jun 12, 2015 at 6:55 PM KOLANICH <kolan_n at mail.ru> wrote:

> Hello all. I have opened the page
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla
> and was horrified. What happened with JS? Why do we need all this methods?
> Why a lot of functionality is now doubled, and a lot of new badly designed
> API and language features was introduced? I understand the word
> "compatibility", but I think that no compatibility worth enough to be
> preserved sacrificing the language design making it self-contradictary.
> For example, Object.is compares identity. Operator === also compares
> identity but in a bit differrent way. Why not just make == check equality
> only between compatible types, === check identity (that the object is the
> same) and throw out Object.is. Operator [] casts its argument to string ...
> but not when used with Symbol (why not just allow the key to be any object
> and match using ===). New iterator API relyes on Symbol.iterator. Why do we
> need it? Why not just use strings and prototypes? fromCodePoint doubles
> fromCharCode, but differs a bit. Why didn't you repurpose fromCharCode,
> just allowing it to take a string arguments describing codepages?
> Iterability and enumerability are distinct, but iterability is just
> enumerability with numeric key (yeah, I know that it is possible to create
> endless or random iterator, but in fact this means that you just don't need
> to use the key provided). Why there is iterability, but not enumerability
> with properties of iterability and enumerability united? Why we need
> enumerability to make it work with for ... in and iterability to make it
> work with for ...  of? Why can't we use methods definitions to define
> methods as a function declaration? Why JS is so badly designed?
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150612/f602440e/attachment.html>


More information about the es-discuss mailing list