Skip to content

Instantly share code, notes, and snippets.

@KVeitch
Last active January 12, 2020 20:49
Show Gist options
  • Save KVeitch/5ea081f11686b7fbcc6e25eb3f46b3f5 to your computer and use it in GitHub Desktop.
Save KVeitch/5ea081f11686b7fbcc6e25eb3f46b3f5 to your computer and use it in GitHub Desktop.

The Dart programming language was released by google just over two years ago. Dart looks a bit like C and is an object-oriented programming language. Dart is not only used for mobile app development but is a programming language. Approved as a standard by European Computer Manufacturer's Association (ECMA-408). When Dart is used in web application it is transpiled to JavaScript to it will run in web browsers.

Dart is a bit like JavaScript in that:

  • Dart has type inference. The data type of a variable need not be explicitly declared, as Dart will “infer ”what it is. In Java, a variable needs to have its type explicitly given during declaration. For example, String something;. But in Dart, the keyword is used instead like so, var something;. The code treats the variable according to whatever it contains, be it a number, string, bool or object.
  • All data types are objects, including numbers. Uninitialized variables have a value of null.
  • A return type of a method is not required in the method signature.
  • The type num declares any numeric element, both real and integer.
  • The super() method call is only at the end of a subclass’s constructor.
  • The keyword new used before the constructor for object creation is optional.
  • Method signatures can include a default value to the parameters passed. So, if one is not included in the method call, the method uses the default values instead.
  • It has a new inbuilt data type called Runes, that deal with UTF-32 code points in a string. For a simple example, see emojis and similar icons.

Dart also has inbuilt libraries installed in the Dart SDK, the most commonly used being:

  • dart:core for core functionality; it is imported in all dart files.
  • dart:async for asynchronous programming.
  • dart:math for mathematical functions and constants.
  • dart:convert for converting between different data representations, like JSON to UTF-8.

I wanted to know the current tends of Dart and more over Flutter to see if any more effort should be place into learning the language. It would seem that Dart had a very negative trend in 2017 but has been on an upward trend since then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment