4 ms·
> Node allows you to run isomorphic JavaScript that runs on both your server side and client side But then you're writing JavaScript on the server side, and I
by zeveb 10y ago
> Node allows you to run isomorphic JavaScript that runs on both your server side and client side
But then you're writing JavaScript on the server side, and I think I'd rather shove live weasels down my trousers than write one line more of JavaScript than I absolutely must.
- eyelidlessness 10y agoYou could of course write something that compiles to JavaScript. There's a ton of options, some are even pretty nice (I like ClojureScript; want to try out Elm).
- jensvdh 10y agoThis is where Typescript comes in. It's beautiful.
- dandv 10y agoJavaScript sucked indeed. ES6 though, has brought many improvements, and the language now is quite decent. With the advent of async/await in ES7 (which is available now if you transpile with Babel), the callback hell is completely gone, and the language is actually beautiful, powerful, and concise.
- Fire-Dragon-DoL 10y agoI think we are exaggerating here. Javascript was terrible but with es6 it's just getting better, I know various languages and only Javascript manages to make me scream with its quirks, the others at most I feel disappointed. So "good" is an exaggeration, reasonable seems fine, but currently is either an OOP language where 'this' changes every time, or a functional language without native support for immutability, curried functions by default and a whole bunch of utilities that you expect from a language claiming to be functional. If it's a language with both mixed, must be compared to ruby which has consistent oop and functional programming with support for laziness and a super powerful ability to create dsl. And in Javascript, it's still a nightmare importing a file. You either have a or you are on nodejs.
- BinaryIdiot 10y agoJavaScript is a fantastic language. I don't get this animosity towards it. A decade ago it was made fun of by people who "use real programming languages" but JavaScript has grown up. It's actually very good and very fast. ES6 brought improvements but honestly ES5 is still a great language.
- talyssonoc 10y agoTotally agree. The lack of understanding of JavaScript's paradigm from some people make them blind about the language power, it has the enough amount of every needed paradigm there, including OOP, functional and evented. I see in the comments here people complaining about things like dynamic `this` when they just don't understand it's one of the biggest powers of JS.
- scriptkiddy 10y agoJS is not object oriented. A prototype is not the same thing as an object. There are no classes in JS.
- renku 10y agoWhat you mean to say: JavaScript is not class-oriented. Sure, there are features that JavaScript lacks compared to other object-oriented languages, but saying that it's not object-oriented is like saying that it's statically typed. It's just wrong, the language is full of objects.
- talyssonoc 10y agoOk, tell me where on "object-oriented programming" is the word "class". Objects are not necessarily related to classes. And yes, a prorotype is a object that you can extend from, as well as from any other object, like prototype-based OOP works.
- nathan_long 10y agoJavaScript is not a fantastic language. It does a lot of things that make no sense. It converts between types in nonsensical ways. Eg in Ruby, you can't accidentally do `5 + "hi"` and get "5hi". If you really want to treat the number as a string, you can do `5.to_s + "hi"` and it works, but you don't do such crap accidentally. In JavaScript, `4 / "cake"` returns `NaN`, which is sensible, but if I wanted to check whether I just accidentally did a bad division, `(4 / "cake") === NaN` will lie to me. There are LOTS of quirks like this. JS is like a floor with boards missing all over the place. Yes, if you've walked on it every day for years, you've already stepped in every hole and know where they are. But that doesn't make it a good floor. A good language is consistent. JS is not. The fact that it now has fast implementations has nothing to do with it. This car goes 300mph, but don't use the left turn signal on Tuesdays because that sucker will blow you up.
- talyssonoc 10y agoDamn, I see so much frustration from you for not being able to understand JavaScript here... once you understand it's a different language instead of trying to write your favorite language with JavaScript syntax it'll get better, buddy, relax :)