Dart or Not Dart? This is the question that’s still too early to tell.

I do hope that we can have a new, strict, well-structured, and well-perform program language which can completely replace JavaScript, and this is why I still put some hope on Dart.

JavaScript is a language which has pretty long history, it has good parts, but also many bad parts. Many JavaScript experts try to teach people how to write JavaScript in a good pattern; unfortunately, there are still many people doesn’t really understand those good patterns.

JavaScript does provide a lot of freedom and flexibilities, but those advantages have also became it’s biggest disadvantages when having many engineers to develop a project jointly, especially for those over-designed projects.

It’s like living in hell when you need to find out an attribute from a huge object which has over 9 layers inheritances, and you have no idea who the f**k unexpectedly overwrite this attribute. Because JavaScript is too easy to modify those attribute, engineers tend to simply overwrite the attribute without thinking too much just to get things done quickly.

You can’t really blame them because tracing one attribute from over 9 layers of object inheritances is just like finding a locker key from a landfill.

Simple and flat are difficult for engineers

Simple is better than complex
Flat is better than nested.

from The Zen of Python

Those two principles are not only for writing good Python code, but also for writing good JavaScript code. Writing a simple and flat code is much harder than writing a complex and nested code because it requires a lot of thinking before you start typing your code. For some strict type programming languages, I will probably write a lot of stupid code without thinking too much, but seems like the situation is much worse in JavaScript.

There are some engineers who doesn’t really understand JavaScript who thinks JavaScript is nothing just because they can build something on JavaScript without knowing this language. Their JavaScript probably has a lot of errors from the 1st line to the last line, but who cares? It works anyway!

Node.js and ECMAScript is trying to solve this kind of problem, but it’s really hard to solve those problems completely, not to mention the client-side JavaScript. This is why even I think JavaScript is beautiful and powerful, I still hoping to have a new language to replace JavaScript.

However, to replace a language like JavaScript is never easy.

Here are two reasons I think Dart is a good start for replacing JavaScript.

I’s time to re-think about web service programming language

JavaScript is an old language and it wasn’t designed for building a big software-like structure, and I am pretty sure that JavaScript creators didn’t even know this language will be used for server-side programming.

Of course we can use V8 or Browser rendering engine to enhance the performance, but it still limited by the language itself. If we really want to have huge improvement the performance for web experience; maybe it’s time for us to have a new language which is design for our modern technologies, such as multi-core.

A strict, well-structured language is better for developing a large project

Since JavaScript has become the major language for web service development, I think it’s important for us to have a strict and well-structured language.

So, do I think Dart will be the one to replace JavaScript?

Well…I think it’s a little bit too early to say right now because Dart seems like more focusing on server-side, and I don’t really see much different for client-side. If Dart really plans to replace JavaScript, they probably need to provide some future plans for client side support.

  1. I haven’t see enough information about Dart’s support for client-side execution in a multi-core environment. Not just doing things in parallel but in concurrency. BTW, I love the way how Go handle concurrency, and I think it might be great to have similar support for client-side too.
  2. For client-side support, I always think that accessibility should always be the top item. Many of engineers are struggling between usability and accessibility when developing things, which shouldn’t be a problem at all in this modern age. However, I haven’t heard any information about this part from Dart yet. If we are going to have a new language to replace JavaScript, I think this is the must solved item for this new language.
  3. Significant client-side performance change. This is the part I would love to see from Dart.

Dart or not Dart? This is a question that’s too early to tell. JavaScript does have a lot of problems, but to replace a language like JavaScript, strict, well-structured, simple, or class are not strong enough for JavaScript experts to move. You need to be more than that.

Wießeckel: There are some new competitors like Google Dart. Why?

Crockford: I don’t know. You have to ask someone from Google. It doesn’t make any sense to me. There are lots of problems with JavaScript and JavaScript should not be the last programming language. I would like to encourage lots of experimentation in new languages. Programming languages are the most important tool available to programmers. We still haven’t gotten it right and clearly JavaScript didn’t get it right.

So we need to keep doing those experiments, we need to keep practicing. It takes us about 20 years to make an advance in programming languages, so we need to get going faster than that. So I’m very happy to see the experiment. The thing that is problematic with Google is they seem to already claiming victory and they haven’t finished the design yet. Dart doesn’t make sense to me, I don’t know what Google is trying to do there. Dart is worth the experiment and Google should be applauded. It may be a plot to replace JavaScript but it seems unlikely.

from Douglas Crockford: “Java was a colossal failure…JavaScript is succeeding because it works.”

Still, I am looking forward to have a new language which can really replace JavaScript, but we probably don’t need a language that’s just a better version of JavaScript.


2 thoughts on “Dart or Not Dart? This is the question that’s still too early to tell.

  1. Once Google puts the Dart VM in chrome it will start taking off. Dart is twice as fast as JavaScript and that will show in large websites and especially games. Notch is even coding a game in Dart. Until then Dart is pointless and will remain under the rug.

    • I saw their current performance report which really impressed me, and I do hope that Dart VM can be embed by other browsers. However, we still have a long way to go.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s