News for hackers. Stuff that matters.
Re:JavaScript at 20 by lee on Friday May 15, 2015 @10:05PM (#9554747)
> The differences between these languages aren't that big and they're largely aesthetic.

They are pretty big. At work I work on a Django-backed project that has a very fat JavaScript front-end client, and JavaScript is incredibly painful to work with compared to Python.

It's not merely aesthetics, but JavaScript in the browser is severely lacking in language features that allow it to scale to larger code-bases.

Re:JavaScript at 20 by megaman821 on Friday May 15, 2015 @10:41PM (#9554833)
I use Django a lot too, but JavaScript (ES6 specifically) just isn't a big mental shift anymore. I prefer Python syntax, but Python, Ruby, and JavaScript are pretty comparable at this point.

Also JavaScript has a pretty good variety of languages that compile to it. If you like C#/Scala/Swift use TypeScript. If you like Java use Dart. If you like Lisp ClojureScript.

Re:JavaScript at 20 by tosh on Saturday May 16, 2015 @01:39AM (#9555171)
If you come from Python or Ruby you'll probably have an easier time with Dart than with JavaScript.

Dart comes with a batteries included standard library inspired by Smalltalk (https://www.dartlang.org/docs/dart-up-and-running/ch03.html).

Dart should also feel familiar to people coming from C#. async/await support in Dart was designed by Erik Meijer (who worked on the feature for C#) and iirc he believes it is the Dart implementation is the cleanest implementation yet.

I don't see much similarity between Dart and Java.

Re:JavaScript at 20 by sredna on Saturday May 16, 2015 @02:39AM (#9555242)
I've done many many years Java, then hit Dart and was very impressed.

Since that I have had to do a fair bit of python, php and JavaScript at work. I think if I hadn't seen Dart first I would have quite liked python.

The problem with Dart is that once you've been developing in it for a while it spoils you from liking anything else. I really cringe with python, JS etc autocompleting to a million irrelevant things.

And going back to Java you have the slow dev loop that comes with a compiled language.

At the end of the day I've simply never had a development experience anywhere near as productive and enjoyable as Dart.

Re:JavaScript at 20 by BrendanEich on Friday May 15, 2015 @10:07PM (#9554757)
Use ES6 via http://babeljs.io/ already, and be happy :-P.
Re:JavaScript at 20 by girvo on Saturday May 16, 2015 @12:45AM (#9555078)
Definitely! Though, unit-testing becomes interesting, as `rewire`, `proxyquire` and other ways of changing the dependencies inside your modules when they are `import`-ed breaks.

However, it turns out having an AST of your Javascript code is really useful, and lets you do things like this: https://github.com/speedskater/babel-plugin-rewire

Re:JavaScript at 20 by tosh on Saturday May 16, 2015 @01:42AM (#9555174)
I also came from a Python (Django, Flask, …) background and had the same issues. Tried CoffeeScript and it helped a little but eventually fell in love with Dart.

Give it a try. I like that it comes with a useful and well designed standard library (like Python).

Re:JavaScript at 20 by lee on Saturday May 16, 2015 @08:26AM (#9555844)
Thanks. I did try Dart and our team spent a full month giving it our best for our client.

It was a dream to use compared to JS. One show-stopper though: browser support. At the time, IE11 was just released and Dart had issues with IE11. Also, the Dart supported browser window is only the latest 2 versions of a given browser.

This totally killed our Dart prospects, as our target users in our business are generally non-tech savvy and we need to support older browsers like IE8/IE9.

Re:JavaScript at 20 by tosh on Saturday May 16, 2015 @08:50AM (#9555909)
I hope we all will be able to target evergreen browsers sooner rather than later. Microsoft seems to go into the right direction at least.