Skip to content

Comment on Ruby vs. JavaScript as a first programming languageparent

Comments

Class is a bit of a shambles. Yeah, it does make it easier to create constructors. But it also papers over the underlying prototype inheritance structure and can mislead beginners into assuming there is class system in place.

Class was one of the things that summed up ES678* for me - its nice, but it's pure syntactical sugar.

The fat arrow notation and destructuring are part of my everyday code lexicon, promises are hawt, im genuinely excited you can cancel a fetch() now, but so many other thing (proxies ffs) feel like they haven't added anything meaningful.

Which isn't to say I dislike the sugar, I have a hella sweet tooth, it's just that ES8 feels like it contains perhaps a little too much abstraction.

I don't think you can cancel a fetch - cancelling Promises was abandoned.

Do you mean cancellable promises were cancelled, or AbortSignal was cancelled? Because they went with the latter in the end. It got a bit fuzzy for a couple of years tbh. Personally I wanted cancellable promises because reasons, but i can appreciate the DRY aspects of AbortController and stuff going on in other APIs.

As recently as September the AbortSignal approach was implemented in Edge 16 and Firefox 57!

Pertinent piece from prominent professional Promise proponent Jake 'i don't only write about bloody promises' Archibald...

https://developers.google.com/web/updates/2017/09/abortable-...

Yeah, 'class' is a lie, but for practical purposes - ie how to make a thing that other things will inherit from, most of tech uses the term 'class'. Also a prototype that is never used directly itself could be considered a class if you squint the right way ;-)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.