News for hackers. Stuff that matters.
Re:JavaScript is Good, Actually by cm2187 on Wednesday May 16, 2018 @06:48AM (#17081361)
The difference between the hostility to php and the hostility to js is that there are many alternatives to php whereas, right now, if you want code to execute in the browser or on many different platforms, you don't have a choice. So where I would normally tell people who boo php to use whatever language they prefer, and get over it, that's not possible with js.
Re:JavaScript is Good, Actually by egeozcan on Wednesday May 16, 2018 @08:11AM (#17081728)
> So where I would normally tell people who boo php to use whatever language they prefer, and get over it, that's not possible with js.

Maybe 5 years ago. For nowadays, I beg to differ: https://github.com/jashkenas/coffeescript/wiki/list-of-langu...

A significant amount of the choices there produce generally better-performing code than the hand-written JS, there's also the WebAssembly.

Re:JavaScript is Good, Actually by cpburns2009 on Wednesday May 16, 2018 @09:46AM (#17082299)
While technically true, don't you still have to debug and diagnose issues from the generated JavaScript? I'd love to write front-end code in anything else, but if I have to know exactly how it gets converted to JavaScript it kind of defeats the point.
Re:JavaScript is Good, Actually by slikts on Wednesday May 16, 2018 @10:35AM (#17082713)
Elm stands out in this regard, as it gives fairly robust guarantees of no runtime errors, so the debugging you'll do when working with Elm will almost always be limited to its compiler or Elm Debugger. The price to pay for this is limited interoperability with JS, but it may be acceptable to trade interop for type safety, depending on the use case.

Generally, the alt-js languages provide 'source maps' so that developer tools know to map errors in the 'transpiled' code to their source, and it's possible to avoid JS to a practical degree.

Re:JavaScript is Good, Actually by egeozcan on Wednesday May 16, 2018 @11:32AM (#17083208)
Usually you get source maps, so you can debug in the source language, right from the DevTools.
Re:JavaScript is Good, Actually by isoos on Wednesday May 16, 2018 @08:14AM (#17081739)
Compile-to-JS exists, and there are good ones out there. E.g. you can develop in Dart for web, server and mobile, and it is a solid alternative in every segment (the language and tooling is anyway).
Re:JavaScript is Good, Actually by petagonoral on Wednesday May 16, 2018 @08:16AM (#17081754)
No alternatives to JS browser runtimes & environments maybe but you can use one of many transpile-to-JS languages and you shield yourself from most of JS badness.