Thursday 28 July 2016

Why I like Dart more over Typescript

If you are new to web development you can feel lost. Understanding web development lets say ten years ago was much easier. Developing web app in PHP or ASP was easy to understand. All in all those frameworks were just smart template engines. These days web is more dynamic and much more client side. Progressive Apps and other modern trends make web apps usable even when you are offline

There are plenty of JavaScript and compiled to JavaScript languages. To make it worse there are zillion JS frameworks out there. Selecting good tools for doing modern web apps can be challenging.

I'm doing a lot of so called SPAs (Single Page Applications). Most of them are done in Dart or Javascript with superb IntelliJ. Some time ago I tried to use Typescript with VisualStudioCode in one of smaller projects. After this experiment I still like Dartlang more for web apps and here is why.

Reasons I like Dart more over Typescript

  1. Dart analyzer is usually able to show more common mistakes even if you are not heavy type user. In real life dev you usually do plenty of simple typos. In Dart - thanks to fantastic Analyzer - time to find them is way shorter.
  2. It's easier to start debug in Dart and it's more reliable. This could be IntelliJ itself.
  3. Code in Dart is shorter for small apps since it has build in SDK - there is no need for external libs in simple apps.
  4. It's easier to back to this code after few weeks (shorter less dependencies) and easier to maintain it. Also time needed to start from scratch is shorter.
  5. Pub is modern lib/package mechanism (versioning, automatic fetching) and is way superior to what is there in Typescript world. There is single library index site: pub.dartlang.org
  6. Dart has one mechanism for library importing (which doesn't confuse me!)
  7. I'm not afraid if library x conflicts with library y
  8. await async works on non ES6 browsers - no wired settings in main config file!

There are still things I like more in Typescript


There is one thing better in TS which I like very much - how interfaces can be applied to Maps allowing using json as typed object.

Simple way to deploy docker app on production machine

Small software house house/freelancer life isn't easy. Reading HN post about fancy new tech is amusing but as much as it is nice to read...