Dart is an open-source, class-based, optionally-typed programming language for building web applications--on both the client and server--created by Google. Dart’s design goals are:
Dart targets a wide range of development scenarios, from a one-person project without much structure to a large-scale project needing formal types in the code to state programmer intent.
To support this wide range of projects, Dart provides the following features and tools:
It is good practice to add comments to your code to explain why something is done or to explain what something does. This helps any future readers of your code to more easily understand your code.
Related topic(s) not on StackOverflow:
Dart is a true object-oriented language, so even functions are objects and have a type, Function. This means that functions can be assigned to variables or passed as arguments to other functions. You can also call an instance of a Dart class as if it were a function.
The import
and library
directives can help you create a modular and shareable code base. Every Dart app is a library
, even if it doesn’t use a library directive. Libraries can be distributed using packages. See Pub Package and Asset Manager for information about pub, a package manager included in the SDK.
Dart code can throw and catch exceptions. Exceptions are errors indicating that something unexpected happened. If the exception isn’t caught, the isolate that raised the exception is suspended, and typically the isolate and its program are terminated.
In contrast to Java, all of Dart’s exceptions are unchecked exceptions. Methods do not declare which exceptions they might throw, and you are not required to catch any exceptions.
Dart provides Exception and Error types, as well as numerous predefined subtypes. You can, of course, define your own exceptions. However, Dart programs can throw any non-null object—not just Exception and Error objects—as an exception.
When you install the Dart SDK, one of the tools that you get is pub. The pub tool provides commands for a variety of purposes. One command installs packages, another starts up an HTTP server for testing, another prepares your app for deployment, and another publishes your package to pub.dartlang.org. You can access the pub commands either through an IDE, such as WebStorm, or at the command line.
For an overview of these commands, see Pub Commands.
Dart regular expressions have the same syntax and semantics as JavaScript regular expressions. See http://ecma-international.org/ecma-262/5.1/#sec-15.10 for the specification of JavaScript regular expressions.
This means that any JavaScript resource you find about Regular Expressions online applies to dart.