12

Can anyone tell me why is it good to use some crap language that transpiles to javascript? Yes i hate js too but 90% of my time using reason/ts/elm is just

>ddg how to do x in y
>no answer
>Js.unsafe.eval "js code"

Like???? None of them is a 100% complete wrapper???

Comments
  • 1
    the advantage of elm is that the transpiler is friendly, helpful and doesn't allow bugs. It is imutable out of the box. But yeah in the end it's html css js.
  • 5
    One issue with JS is type bugs, especially after refactoring. You never really know what "this" shit is, and you will only find out at runtime. Or you just made a typo, so a new variable is instantiated, but no error message. Happy debugging and wasting time.

    That sucks, so people want to have a typed language where such bugs are detected statically and automatically - by the compiler.

    But how would you execute the result? Java promised "write once, run everywhere", but due to various historical reasons, it is JS that actually keeps this promise. So you transpile that to JS and can execute it in any browser while still enjoying a less sick language for development.
  • 3
    @heyheni yeah, fair point, the transpiler warnings are useful
  • 5
    JavaScript is valid TypeScript. TypeScript is a superior supersets of JavaScript. If written consistently, the transpiler prevents bug before you run them. The older I get and the more I program, the more I want type safety.

    TypeScript is not perfect, as in the end is still produces JavaScript, yet it also targets different version of JavaScript (you can create code that runs in almost every browser, or make use of the most modern version), yet it saved my sanity more than once.
  • 0
    I personally like just using ES5 but that's not for everyone considering some companies still want to support Internet Explorer
Add Comment