Why did I choose Dart in my Thesis ?

Ala Alhaj
4 min readNov 3, 2020

--

Photo by Erik Mclean from Pexels

Hi again !

If you did not read my awesome article for Remote Configuration for your app in Firebase: https://medium.com/ala-alhaj/flutter-how-to-configure-application-in-the-cloud-by-firestore-getx-dio-firebase-c2ebf8e5c6f3

Here we are in another topic that I would love to share my opinion why I see Dart is serious enough to take and also share my thoughts why I chose it in as the main language of my Thesis “ Scorpio”. Don’t expect a technical code or example of full feature, because this article is meant to share why I see Dart is great choice for my thesis. Let me list down the real products out on the market that Google heavily depends on maybe not depending but fully operate by Dart aka AngularDart and other tools that might be a good choice !

Google:

1- Google Play Store console.

2- Google Ads.

Other products;

1- Wrike.

2- Quire.

Well, many products out there could be named that uses it, but I actually fail in love with this language when I saw the way it is structured between JS and C++/C where I see it more organize and more terse . However, I found out that this language could be a choice for my Thesis and also future work maybe !

Isolation

Isolated memories and

Imagine that we have secure memory space in our thread and no other activities may get interrupted from other. Sounds fancy, isn’t it ? That is how it works in Dart not like in C++ or any other language that requires us to communicate between the threads and quite hard for us to scale it without worrying of the approach: secure enough or any other reason could be pop-up in our work. In Dart, Future object aka message passing is the way of communicating between the isolated memories which it works in event loop that it waits for the object/memory space to finish its duty so then the green light gives to have the object from this memory ! Easy ? Alright, that does not mean that in Dart we will have a lot of isolated memories, because it only means our hardware source will be run-out fast. So, there is library called dart:io that helped to me specify the number of isolated memories base on my machine capability and what is enough for me to run my application. For example,

final count = Platform.numberOfProcessors ~/ 2;print('number of prepreaed isolated memories : $count');

Dart Native

The idea of having your base code on multiple platforms without having teams and worrying to plan for each platform, well thanks to Dart Native. It is running on Native ARM/x64_86 machines such as: mobiles, desktop, browser, or even you can make your server-side ! The approve is Flutter where it is stable on both of iOS and Android and now Flutter team works to have web + desktop stable.

Pub

Well, having the thought to be worried of managing the packages you required and compilation time it takes. With Pub, it is doing the job to cache-out the installed packages on the machine, so the moment you try to run your application, packages are there and ready!

Beautiful

Formatting and writing documentation are something else in Dart! Simply have your code with

/// comment

Once you call out that library or dart file, simply hover over this code from it and it will show the comment as it is used for documentation. I believe focusing at one place for documentation instead jumping to documentation somewhere in the web or a book. Dart got this setup perfectly fine in most simple way i would say ! So, yea having this beside editors can beautifully format without worrying that this tab/space will cause our work not working like in Python or even having ugly code.

Cart Service that runs by Stream & Product object(s)

By looking at this, it is readable to me and simple to follow . Thanks to static type that Dart has and this is also big asset I see in this language.

Base on this, i took the decision to take my whole work from JS frameworks / Java to Dart.

Server-side: Aqueduct framework.

Package: Core package in Dart, works as connector from Server to client-side.

Web site: AngularDart.

Mobile: Flutter.

I would admit the project is quite hard with poor sources of AngularDart or limited documentation in Aqueduct. I managed this by reading:

1- The Dart Programming Language — Gilad Bracha.

2- Dart Documentation.

Read the documentation for those frameworks did the work with some creativity got the job done ! For now, stay hold and wait for the next article to know how I designed my core package for the front-end in Dart. Last not least feel free to ask or reach me in private or my channel in GitHub.

--

--

Ala Alhaj
Ala Alhaj

No responses yet