4 ms·
>Python, Ruby I like js too, but both python and ruby are much better languages. It's just that js won distribution, which means it won adoption, which means y
by javajosh 4y ago
>Python, Ruby
I like js too, but both python and ruby are much better languages. It's just that js won distribution, which means it won adoption, which means you have 10MM devs smoothing it's rough edges. Just to take one language feature, consider pythons list and map comprehensions. js has nothing like that - but it also has 10 high quality libraries that do that and more, like lodash. Consider also the ridiculousness around javascript's "OOP" features, like the use of "this", or it's behavior around truthiness, or (arguably) the misfeature of prototypal inheretance - all of which can be forgiven because functions are, after all, first class in javascript, which means you can, with enough effort, fix all the things.
In truth if you want to understand absolutely everything about your runtime, and have some feeling of safety in a sandbox, then the jvm is the best. The vmspec is great, as is the langspec. It's very fast. The tools are mature. Lots of languages are written for it. It's behavior under load is well-understood. Like PHP there is a lot of bad code written for it, which gives it a bad name, but it's still a real gem.
- hombre_fatal 4y agoWell, they asked why someone would use JS if there were other options, and I'm saying that I don't think Ruby nor Python are better languages than JS. Part of that is due to their bolt-on async vs JS async everything, part of that is due to TS, but there's more. For example, you bring up Python's collection comprehensions, but I could easily point out Python's gimped lambda support and thus poor FP abstractions and the need for a special comprehension abstraction. I don't think it's worth arguing about. But I had to chime in before someone thinks there really are no objective nor subjective reasons why someone might prefer Javascript. I do. > then [X] is the best. Btw, there is no best. There are only trade-offs. One of my points is that you can't say something is the best. The only thing you can do is enumerate the trade-offs that made sense for you, and much of that is only personal/aesthetic.
- javajosh 4y ago>you can't say something is the best. You can. And you did. When you say something is your favorite, this is like saying it is the best, all things being equal, in your view. For network connected server processes, I say the jvm is the best runtime. Redbean, interestingly enough, may take that crown, but I'm only now playing with it, but I love its tiny simplicity. In some ways this is like love - do you shy away from saying that your woman is the best? I hope not. And I hope no-one holds your feet to the fire if you do.
- nl 4y agoArguing that there is no objective way to measure "the best" and the saying an opinion as an opinion is not the same thing.
- claytongulick 4y ago> the misfeature of prototypal inheretance Prototypal inheritance isn't a misfeature, it's an interesting and powerful language design choice used by several different languages [1] It may not be your cup of tea, but having written code in most mainstream languages since the 80's, I can tell you I definitely prefer it to alternatives like class based inheritance. Runtime mixins are one of the most powerful composable concepts in any language, and this is a breeze with js. Take a look at the hoops c# had to jump through to come up with something similar but less powerful, as an example. Or the nightmare of multiple inheritance in C++. [1] https://en.m.wikipedia.org/wiki/Prototype-based_programming https://en.m.wikipedia.org/wiki/Prototype-based_programming
- javajosh 4y agoSomething is wrong in this thread. People have misquoted me, twice. In this case you cut out "(arguably)" implying my position is stronger than it is. Elsewhere, they cut out the conditional in my endorsement of the jvm, implying my statement was absolute, and proceeded to lecture me on trade-offs. Not sure what it is, but I don't like it and won't participate.
- hombre_fatal 4y agoWell, you saw my personal opinion about why I prefer Javascript and proceeded to lecture me about things that you think are better. ;)