Dart vs Javascript

Jorge Luis Vargas
2 min readOct 6, 2014

I decided to write this post, because there are not many guides about dart development. Dart documentation is pretty good, and with the help of StackOverflow. You can do pretty much whatever you want to. However the idea of this post is to guide people that are just starting with dart and help them with the big question, why dart?

So why would you want to relearn a new coding language(Dart), if javascript is so sexy and everything now is javascript? Welp first of all this thing is fast! Seriously the benchmarks show how fast dart is. And Google is working on making it even faster. And with the experimental isolates, this open a new world of fast browser apps.

Second you might say, hey at the end of the day you’re compiling to javascript using dart2js. Also dart(and any browser in the year 2014) supports javascript anyway, right? Well yeah, but the thing is javascript is a mess. It’s weak typed, it’s a lot of overloaded classes/functions and at the end of the day, you can mess up your code. Making it harder to maintain and to read. And based on my personal experience there’s nothing nice trying to debug your live application just because a string turned magically into a float(I’m looking at you PHP). Also dart is as weak or strong typed as you want, which gives you the flexibility you want.

Third the editor is superb, autocomplete works as charm(for typed vars), amazing debug, fast, integrated with dartium. And also compiles your code in real time if you want to test your app vs the real world(javascript).

Fourth and last reason, remember that at the end of the day dart is javascript? Well that means dart is interoperable with javascript. This means is flexible enough to work with other javascript libraries and old code. This means that if your site has that jQuery plugin that took you a lot of time to code, well you can keep using it while coding a new part of your site using dart.

These are the reasons to love dart, that I found after a year of using it. Dart is not perfect, it still has some small bugs, and they keep deprecating core functions(and sometimes breaking my code, meh), but it is getting better and faster. In the next post I will write how to start a site in an agile way using one of the most used frameworks, Bootstrap.

--

--

Jorge Luis Vargas

Full Stack Developer. Serverless, automation and processes enthusiast. AWS, PHP, NodeJS, JS, TypeScript.