5 ms·
Throwaway since embarrassed to ask this: What is the knock against Javascript? Not trolling, besides lack of types it seems like a pretty darn solid, ubiquious
by ocaml201627 8y ago
Throwaway since embarrassed to ask this: What is the knock against Javascript?
Not trolling, besides lack of types it seems like a pretty darn solid, ubiquious, elegant/straightforward language to get things done.
For people with strong opinions about this, what is so horrifying about Javascript to you?
- cies 8y agoI tend to disagree with: darn solid and elegant. It is easy to write flaky code in JS and rarely the language helps you to go for the elegant solution. On this front ReasonML brings huge value to the table.
- boyswan 8y agoSince moving from javascript to reason/ocaml, i'm genuinely nervous about refactoring Js now. Helpful compiler errors are literally life changing, and being able to handle options with Some/None means no more nasty undefined bugs. You can do a lot of funky things with javascript, and it's easy to convince yourself that because you can do it, you should do it. With reason I've found I can achieve pretty much anything with a far more concise set of tools, and I can't hack my way around problems - I'm forced to deal with them the correct way. Being forced to do things in a certain way has a massive benefit, and encourages consistency. You can look at 5 different javascript projects and each one of them will most likely be completely different.
- Can_Not 8y agoI love JavaScript, but also recognize when some other things are better (in the useful, pragmatic, non-edgy, non-trendy sense). Bucklescript/reasonML seem to be a way to use something better and keep what I like about JS without starting at zero in the job market or ecosystem. Specific example: if reasonML gets big enough then all react jobs are potentially reasonML jobs. In the bigger picture, purescript/elm/bucklescript/reasonML/clojurescript all have one problem. There's a lot of hype about how much better they are, but also the job market for them is nearly empty. This makes it difficult to justify spending a lot of time evaluating them before the jobs exist. I end up using flow or typescript in the short run.
- oweiler 8y agoIt's not just the lack of static typing. It's weakly typed, so implicit conversions can happen when you don't expect them. A standard library which lacks the most basic functionality. Historical baggage(arguments, var, ...). Prototypical inheritance without proper language support. null vs. undefined. Async by default (that point may be debatable ;)).
- xamuel 8y agoJS got a bad reputation from the pre-ES6 years. Before ES6 it really was a dumpster fire. It'll probably be many years before all that bad reputation can be redeemed as people slowly discover how good ES6 is.
- yomly 8y agoJavascript has mutable datatypes and weak typing by default - that makes it easier to write buggy code than making it harder to do so. To write nice JS, you have to be disciplined and very cognizant of what you're doing. And then you have to deal with the rest of the ecosystem, which is massive and of varying quality. I recently ran into mutable date types in momentJS, which is a frustrating gotcha - it's not flip the table lose your shit annoying, but it's simply a non-existent issue in other languages.