- Information
- AI Chat
Was this document helpful?
48.5 dart-basics-summary
Course: Programming 1 (CS101)
40 Documents
Students shared 40 documents in this course
University: Kabul University
Was this document helpful?
Dart Basics
Dart Fundamentals You Should Know!
Important!
This document is just a short summary of the basics taught in this module! If you
want to learn more/ all about Dart immediately (instead of throughout the course
lectures), you can scroll to the end of this document. There, you find a link to further
resources!
What is Dart?
Dart is an object-oriented programming language developed by Google. Whilst
technically not restricted, it’s primarily used for creating frontend user interfaces for the
web (with AngularDart or Flutter for Web) and mobile apps (Flutter).
It’s under active development, compiled to native machine code (when used for
building mobile apps), inspired by modern features of other programming languages
(mainly Java, JavaScript, C#) and strongly typed.
As already mentioned, Dart is a compiled language. That means, that your code isn’t
executed like you write it, but instead, a compiler parses + transform it (to machine
code).
Variables, Functions, Types
Like pretty much all programming languages, Dart has a couple of core features it
supports - for example:
•Variables to temporarily store data
•Functions to executed code “on demand”
•Types to analyse your code before you run/ test it
Variables are a core building block that allows you store results of other operations - or
any other data you want to use at a later point of time.
var myName = 'Max';!
print(myName); // Outputs ‘Max’
In the above snippet, we see how a variable is created (with the help of the var
keyword), how a value is assigned (with the help of the = sign) and how you can then
use the variable - for example to simply out (print) it to the system log.
Regarding the naming, it’s common that you use camelCase notation to name your
variables - and you want to name such that it’s clear what’s “inside of the variable”.