Serious question: why do people like JavaScript so much? I thought people found it horrible. Also, because JS isn't type safe, does this mean it's prone to bugs and crashes because of this?
Now we have ES6 version of javascript that has classes etc., I haven't explored much, but I have seen it makes you write code in different way like other mature programming languages
I don't particularly like JavaScript and wouldn't choose Node by default, but it's not a strict dichotomy. Circumstance is everything and there are a lot of circumstances where JavaScript really is the right choice, mostly because it's ubiquitous and models can be expressed the same across all environments. We got to this point not because of JS's greatness, but because of pragmatism. That can't be ignored.
A few reasons. It's syntax is easy to learn, and it opens the door to both client and server side development. You have to know it to do anything on client side, once you learn that much why not learn Node.js?
It's drawbacks are well documented in "Javascript, the good parts". Typescript will help improve it, but it will never help prevent programmer mistakes anywhere near as well as Swift (for example). But no language is perfect.
Is has been my experience that as your software gets larger and more complex, the lack of type safety causes more and more problems. That's why we use Typescript to compensate for the lack of type safety in JavaScript. I think that is one of the reasons JavaScript is becoming so popular. It doesn't matter what you develop in if the ecosystem allows everything to be compiled into JavaScript. Javascript and V8 are similar to the Microsoft CLR and Java JVM -- a universal run time.
Except that JVM and CLR are specifications, V8 is an implementation of no specification. There are multiple Java byte code interpreters, multiple JVMs. There is just one V8, and a hack build on top of it called NodeJS. NodeJS doesn't run on any other JavaScript runtime except V8.
NodeJS is like JavaScript as Microsoft VisualJ is like Java.
People don't really love it. It just happens to be the only language the browsers speak and they had to learn it. Then it expanded to other systems and things became more interesting. Even with all the improvements, JavaScript still feels hacky.
Here is an article I read some time ago by Eric Elliott about static types. Static types doesn't seem to have enough impact on bug density based on his analysis.
I can't speak for anyone when it comes to Javascript love, but there is a quote from Bjarne Stroustrup ( creator of C++ ) that I like:
There are only two kinds of languages: the ones people complain about and the ones nobody uses.
I imagine all programming languages are horrible, if they were not, we would stop coming up with new ones.
Serious question: why do people like JavaScript so much? I thought people found it horrible. Also, because JS isn't type safe, does this mean it's prone to bugs and crashes because of this?
Now we have ES6 version of javascript that has classes etc., I haven't explored much, but I have seen it makes you write code in different way like other mature programming languages
Yes, but we can ignore the obvious flaws and use things like TypeScript to transpile our code rather than admitting there are better tools.
I don't particularly like JavaScript and wouldn't choose Node by default, but it's not a strict dichotomy. Circumstance is everything and there are a lot of circumstances where JavaScript really is the right choice, mostly because it's ubiquitous and models can be expressed the same across all environments. We got to this point not because of JS's greatness, but because of pragmatism. That can't be ignored.
A few reasons. It's syntax is easy to learn, and it opens the door to both client and server side development. You have to know it to do anything on client side, once you learn that much why not learn Node.js?
It's drawbacks are well documented in "Javascript, the good parts". Typescript will help improve it, but it will never help prevent programmer mistakes anywhere near as well as Swift (for example). But no language is perfect.
Is has been my experience that as your software gets larger and more complex, the lack of type safety causes more and more problems. That's why we use Typescript to compensate for the lack of type safety in JavaScript. I think that is one of the reasons JavaScript is becoming so popular. It doesn't matter what you develop in if the ecosystem allows everything to be compiled into JavaScript. Javascript and V8 are similar to the Microsoft CLR and Java JVM -- a universal run time.
Yes. And this is where Elm fits into the ecosystem really nicely.
Except that JVM and CLR are specifications, V8 is an implementation of no specification. There are multiple Java byte code interpreters, multiple JVMs. There is just one V8, and a hack build on top of it called NodeJS. NodeJS doesn't run on any other JavaScript runtime except V8.
NodeJS is like JavaScript as Microsoft VisualJ is like Java.
Maybe this was true back in 2017, but now there's a NodeJS build for the ChakraCore runtime as well.
People don't really love it. It just happens to be the only language the browsers speak and they had to learn it. Then it expanded to other systems and things became more interesting. Even with all the improvements, JavaScript still feels hacky.
"People don't really love it"
False, it's my favorite language.
And it's the only programming language that you know well, isn't it? =)
Bingo.
Here is an article I read some time ago by Eric Elliott about static types. Static types doesn't seem to have enough impact on bug density based on his analysis.
I can't speak for anyone when it comes to Javascript love, but there is a quote from Bjarne Stroustrup ( creator of C++ ) that I like:
I imagine all programming languages are horrible, if they were not, we would stop coming up with new ones.
Not all programming languages are applicable to all problems. Also tech changes. A lot.
complain != horrible. Javascript is horrible to work with. I complain about python all the time.
Those are diff statements.