Live data from Hacker News

JavaScript. The Core: 2nd Edition

dmitrysoshnikov.com

31–40 of 96 posts

Re: JavaScript. The Core: 2nd Edition

#31
post #15

I wish Douglas Crockford would update his great "JavaScript: The Good Parts". It's still great and aged okayish, but doesn't cover ES2015+.

Is there a good similar book that covers modern JS?

The 3rd edition of Eloquent Javascript (including ES6) should be online next month. Marijn Haverbeke was fundraising and reached his target. https://eloquentjavascript.net/3rd_edition/

Re: JavaScript. The Core: 2nd Edition

#32
post #22

Earlier quoted context omitted.

Sure this car get dust on the ventilation, and you can mess up if you use the 3rd gear and you can't really use the blinkers without being careful and the seat warmers are wtf. But in the end of the day, stick to this car long enough and it works for you. Plus the most popular road of the world only accept this car so take it or leave.

I fail to get the flak that javascript faces ! Coming from java it was a breath of fresh air. This was the car that let me drive without a seatbelt when i wanted, let the doors be open if i wanted, stepping on the gas accelerated without fail and the brakes functioned fine, i could change the gearbox orientation, choose which side the steering wheel i wanted to be in general let me do what i wanted to without getting…

It gets flak for the same reason php gets flak.

They both more or less accidentally became popular. None of them were very well designed. They both lacked type safety.

Unlike php though javascript became not only popular but it actually ended up being the only alternative.

Re: JavaScript. The Core: 2nd Edition

#33

> "ECMAScript is an object-oriented programming language, having concept of an object as its core abstraction." I'm curious as to whether or not this definition makes sense to other developers? ECMAScript does have a built-in "Object" data type, though I wouldn't say that this is it's "core abstraction". Further, firmly object-oriented languages, such as Java, seem to lack this abstraction. Perhaps I'm missing someth…

Huh? All objects in Java implicitly derive from java.lang.Object. Same for .NET and System.Object. The exceptions being value-types and structs.

Re: JavaScript. The Core: 2nd Edition

#34
post #32
post #22

Earlier quoted context omitted.

I fail to get the flak that javascript faces ! Coming from java it was a breath of fresh air. This was the car that let me drive without a seatbelt when i wanted, let the doors be open if i wanted, stepping on the gas accelerated without fail and the brakes functioned fine, i could change the gearbox orientation, choose which side the steering wheel i wanted to be in general let me do what i wanted to without getting…

It gets flak for the same reason php gets flak. They both more or less accidentally became popular. None of them were very well designed. They both lacked type safety. Unlike php though javascript became not only popular but it actually ended up being the only alternative.

It's jealousy.

Most languages had major design flaws. Rubyists will gladly complain about how OO is bolted on in Python, Python users will gladly talk about how slow Ruby's interpreter was and how god awfully complex the syntax is. Both of them have limitations in their runtimes and are actually catching up to JS in some areas (see Python's adoption of async).

We can talk about how baroque CL is or how much Java sucked in 1995, how massively complex C++ is, etc, etc. Those arguments have been made for decades, though. JS is no worse than most languages in various ways, but people are pissed off because their chosen language isn't as popular.

Maybe that's a cynical point of view, but these criticisms never get past the most superficial concerns, so it's not obvious why people really care so much.

Re: JavaScript. The Core: 2nd Edition

#35

Earlier quoted context omitted.

>It also clearly shows that Javascript is not the mess that it looks like from a beginner's perspective. Let's agree to disagree. I suspect your bar is too low. You could have made that argument for early versions of PHP (i.e. before 5)

It's hard for me to take these comments seriously unless you feel this way consistently across most other dynamically-typed languages -- at least it'd be consistent. I've used most dynamically-typed langs at this point and I've run out of reasons to use something aside from modern Javascript if I would have originally used Clojure or Ruby in the past. Though it feels sheepish to reward your low-effort comment with a…

Curious, for server side, why do you prefer JS over Clojure? (I assumed by your comment that you would still prefer modern JS already knowing Clojure. Maybe I misinterpret?)

Re: JavaScript. The Core: 2nd Edition

#36

Earlier quoted context omitted.

Not everybody can afford a Tesla or a BMW. For some of us, A Toyota Corolla or a Honda Accord is more than capable of getting the job done.

Hey, Toyota and Honda are good quality cars, did you mean chevrolet, ford or renault?

Hey, I own a Fiesta SE and ST and they are great. Ford quality is way up.. Actually, maybe that's a perfect analogy for javascript :)

Re: JavaScript. The Core: 2nd Edition

#37

> "ECMAScript is an object-oriented programming language, having concept of an object as its core abstraction." I'm curious as to whether or not this definition makes sense to other developers? ECMAScript does have a built-in "Object" data type, though I wouldn't say that this is it's "core abstraction". Further, firmly object-oriented languages, such as Java, seem to lack this abstraction. Perhaps I'm missing someth…

The core notion is little-"o" objects, which are a collection of properties, which in turn are a collection of attributes.

There is also the big-"O" Object (sometimes called the "Object object," hah). This is a place to hang useful functions and also serves as the default prototype.

Re: JavaScript. The Core: 2nd Edition

#38

Earlier quoted context omitted.

It's hard for me to take these comments seriously unless you feel this way consistently across most other dynamically-typed languages -- at least it'd be consistent. I've used most dynamically-typed langs at this point and I've run out of reasons to use something aside from modern Javascript if I would have originally used Clojure or Ruby in the past. Though it feels sheepish to reward your low-effort comment with a…

Curious, for server side, why do you prefer JS over Clojure? (I assumed by your comment that you would still prefer modern JS already knowing Clojure. Maybe I misinterpret?)

Right, I would generally prefer JS over Clojure on the server side these days. Or, rather, I would default to JS and then possibly disqualify it based on my needs (like team composition).

I spent over three years using Clojure and eventually learned how unimportant technical superiority is for most of my projects. For example, the first time I met a co-founder and they simply weren't interested in using Clojure. Well, that was easy.

JS has major upsides like ubiquity and I'm-already-using-it-in-the-browser and its simple concurrency model that aren't so easy to paint over.

I'm not saying everybody should default to JS like I do. But I think a lot of these avoid-JS-at-all-costs posts need to update their intel. For example, JS has pretty great static analysis compared to anything I've used in the other dynamically-typed languages. It's also one of the few where gradual typing actually caught on.

For all its upsides, its warts aren't any worse than things like the overuse of metaprogramming in Ruby or the aversion to FP in Python or the tooling dependencies of Clojure.

Re: JavaScript. The Core: 2nd Edition

#39
This is good, with one major critique:

> ECMAScript is an object-oriented programming language, having concept of an object as its core abstraction.

This is technically correct but misses that Javascript is not OO in the way that many other languages are, but is instead prototypical in nature. That's an important distinction because creating long prototype chains in JS is a very bad and negative habit, where as the same behavior is absolutely fine in Java.

Re: JavaScript. The Core: 2nd Edition

#40
post #32
post #22

Earlier quoted context omitted.

I fail to get the flak that javascript faces ! Coming from java it was a breath of fresh air. This was the car that let me drive without a seatbelt when i wanted, let the doors be open if i wanted, stepping on the gas accelerated without fail and the brakes functioned fine, i could change the gearbox orientation, choose which side the steering wheel i wanted to be in general let me do what i wanted to without getting…

It gets flak for the same reason php gets flak. They both more or less accidentally became popular. None of them were very well designed. They both lacked type safety. Unlike php though javascript became not only popular but it actually ended up being the only alternative.

I don't think they accidentally became popular.

The features which make a language rise rapidly might just be different to the features that make a language "good".

PHP in particular is amazing for getting started at speed. I remember taking a HTML file and popping in a couple of lines of PHP in the middle. I still haven't found anything anywhere near that easy for making a server backed website.

Post reply on HN