|
|
|
|
|
by catnaroek
3836 days ago
|
|
I have no idea what you mean by JavaScript being "easier" to learn than C++. My experience has been the exact opposite. C++ is a giant beast, but most of it was relatively easy to learn after I internalized the general principles that guide the language's design. These principles were the first coherent account I ever found of how programs manipulating ephemeral resources should be written. [I am aware that Rust improves on C++, but it builds on, rather than replace, the general principles established by C++.] On the other hand, in JavaScript I have never found anything even remotely close to methodological guidance for writing programs. JavaScript seems to make sense of anything as long as it is syntactically valid - a very low bar. As a result, I felt like I had to navigate a really huge space, hoping to eventually find a correct program somewhere. JavaScript's ability to run in the browser is, as far as I can tell, its only advantage over C++. |
|
You are a tiny minority in this. I've taught C++ and JS and have never once seen JS be harder to pick up.
> On the other hand, in JavaScript I have never found anything even remotely close to methodological guidance for writing programs.
The #1 selling JS book is (was) literally called "JavaScript: The Good Parts". It teaches "methodological guidance" for writing JavaScript programs. Just as modern C++ books teach the "good parts" of C++.
> JavaScript seems to make sense of anything as long as it is syntactically valid - a very low bar.
That's (a) not true, with the static resolution semantics in modules; (b) to the extent that it is true is mostly a criticism of dynamic typing, which has a lot of advantages and is not a criticism of JavaScript.
> JavaScript's ability to run in the browser is, as !far as I can tell, its only advantage over C++.
Memory safety? GC? A module system (as compared to #include)? Dynamic typing? This is silly.
(NB: I also think C++ has a lot of advantages over JS for certain domains. I'm a language pluralist.)