Should I use Dart?

dart

(This post started as a response to a question in the Dartisans Community on Google+ however, since I’m so long winded I decided to make it a separate blog post. This post is aimed at non-developer perspective. Someone with minimal programming experience in the past.)

So, should you learn Dart? To be honest, it depends on what you want to do.

I love dart, it’s a very capable language on the client and the server. It can be used for everything from creating webpages and web-based games (with pure DOM or WebGL/Canvas). It can also be used to create text based games on the CLI (command line interface). I’ve also used it in the past to write a MUD (basically a multi-player text game that you telnet into). I’ve used it for scripting, polling, and managing remote equipment and storing the responses in a database which can be polled, evaluated and generate pretty graphs with.

But Dart is not a ‘cure all’ either. For instance, you can’t write an operating system with it. You can’t get the same performance as you can with C for writing computer games (non-web based). It’s not as finely tuned for processing large amounts of scientific data as other languages. Dart is but one tool in the toolshed. Just like a hammer is little use for scraping paint off a wall.

I’m assuming, since in the original post you were looking at Dart and MeteorJS (though it could be any other framework out there as well), that you’re more interested in web-based stuff. Which is great, the web is such a capable place now and getting better every day. Before diving into a big framework like Meteor, it’s good to get an understanding of the language you may or may not want to work with (this was a big problem for many people years ago who jumped on the Ruby on Rails bandwagon without ever properly learning Ruby first). So now you’re looking at JavaScript and Dart.

Javascript can do all the things I mentioned above that you can do with Dart. You can create a MUD, or games etc. It also has the benefit of many many libraries to start with. Though as I mentioned, personally I suggest avoiding them initially as they can lead to poor programming. I know many developers who learned Javascript by way of the jQuery library and it took me a long time to ‘fix’ the code they wrote. Because they didn’t know Javascript, they knew ‘jQuery’, it lead to some really bad practices that killed their website performance.

Using just the standard Dart libraries, Dart has an advantage over what Javascript has “out of the box”. Many of the APIs already account for differences in browsers, where in Javascript that’s a manual process. (Fortunately that’s less of a problem now than it was 4 years ago when Dart was released for preview). Dart standard libraries provide a lot of functionality that is not readily available in Javascript. Some of that functionality you would need to either write yourself, or use a library for in Javascript, which I’ve already suggested avoiding. Here’s another issue with using too many Javascript libraries (especially getting started): they don’t all work together. Sometimes not at all. They use variable names which directly conflict with others or they literally change the Javascript language to suit their needs which in turn can impact the expected behaviour from another library.

Dart packages (libraries), mitigate that significantly. They can have incompatibilities, most often because they themselves may be using incompatible versions of a library. But generally speaking the likelihood of having a conflict between packages is significantly lower. Regrettably however, the number of available packages is also drastically lower than what you have with Javascript. So at the point you do want to start incorporating outside libraries, your options are much more limited. (Side note: This can be a good thing though, as it means less packages you have to evaluate to see if they will provide the functionality that’s right for your project).

The final factor to take into account when trying to decide if you choose Dart or not, is the information that’s available. Javascript has been around for a long long time. It will continue to be around for a long long time. There are tutorials and examples and groups and communities all over the place. There are groups and communities for specific styles of using Javascript, for specific uses of Javascript, for libraries, for just about any aspect of Javascript there is a community. Dart on the other hand is much smaller community. It’s also a community of individuals who, for the most part, came from other languages. They had a base level of knowledge before entering into Dart. Perhaps from a Javascript background, or Java or C#. Some use Dart professionally, some as a hobby, but the vast majority did not use Dart as a first language. As a result, it can be difficult for some of the community to recall the initial struggles you might have learning the language, as it was a struggle they.. skipped over.

Because the Dart community is more experienced, and also a smaller community than Javascript, it has less articles for learning the language, particularly from a non-developer point of view. There are books and articles out there, but they are much more limited in quantity than what is available for Javascript. They balance this however, by having a very devoted community who looks to constantly endorse the language. To share it and encourage others. It makes for a much more open, welcoming community than others I’ve seen.

On a final note, when it comes to differences between JavaScript and Dart, many of the experienced developers I spoke of previously choose Dart because the language (and standard libraries) do relieve many pain points they have experienced with other languages. Be it Javascript’s inheritance mechanism, or scoping differences. Be it a quicker development cycle with Dart and its tools over the Code-Compile-Test cycle from languages like C# or Java. Experience programmers look at Dart and choose Dart because of the benefits the language provides them. It’s my personal preference in a programming language.

Whatever choice you do make however, don’t believe for a minute it is the final choice. As a budding developer, your job is to always continue learning. Continuing growing your tool box of resources. You may gain an affinity for your first language, but it will unlikely be your only language.

[P.S. For the record. I’m extremely biased towards Dart. I can honestly say that my life is different because of Dart. That because I was an early adopter of the language, and have been part of the community for as long as I have, I have had opportunities that I may not have ever had otherwise. I’ve contributed early to the SDK, documentation. I have had to opportunity to interview with Google for a Dart related position years ago, and I currently work full time with the Dart language.]

This entry was posted in Dart and tagged . Bookmark the permalink.

Have Something To Add?

Loading Facebook Comments ...
Loading Disqus Comments ...