Transcript from the "Dart Overview" Lesson
>> We're gonna use a language that probably isn't used before, okay? It's actually difficult to find a Dart developer out there that personal experience in Flutter, actually, okay? Dart is a language created by Google, okay? So Google created Dart as an open source language around ten years ago.
[00:01:27] But then Flutter appear a few years later. And Google said, okay, we have a language, let's use it. Okay, so now it's like the new life of Dart. Of course, you can do more things with Dart. But like server code or normal scripting, but most of the time today, we will use Dart with a Flutter.
[00:02:11] It has less ceremony. Less bureaucracy than for example, Java, okay? But it's still similar to Java, okay? It includes some other ideas such as promises, okay? It has a different name here. It's called Future. It's not 100% the same as the promise but it's kind of the same at this point.
[00:02:57] And today to carry intention the current target of Dart is to create in front-end apps including Flutter and AngularDart. So if you're an Angular developer you can decide to use Dart instead of TypeScript for example, okay? But anyway, that's not for today. Today, we are going to be covering Flutter.
[00:04:42] Make sense? So every Dart application has a main function, so similar to C or Java. So we are going to start with the main function. It has full object oriented programming with type inference, meaning that everything will be an object in Dart. So this is kind of similar to Java.
[00:05:04] It's even more extreme than Java. Because in Java, like an int, with a lowercase is not actually an option. Well here everything is an object, okay? Everything comes from a class in Dart. No safety is available as an optional feature. And actually when we are making flatter applications today, it's enabled by default, like a year ago, it was actually disabled by default, no safety.
[00:06:54] We have some other languages, such as Java, where we ship bytecode. That is an intermediate language and then we have a built on machine. And we have compiled languages, such as Dart that actually compiles into machine code, okay? And that means that you need to compile for every different platform like ARM, Intel and other architectures that you have.
[00:08:04] So if you're making with Dart, with Flutter web apps, that's our target. If we are targeting desktop operating systems such as Linux, Mac OS, or Windows, we will be shipping bytecode. And if we are targeting iOS or Android we're going to ship machine code directly. We then we then need to make this decision, okay?
[00:08:30] This happens automatically behind the scenes but have that in mind the same codebase will actually get completely different outputs with completely different nature, okay? From the same codebase you have any questions? That's fine.
>> I was just wondering why Windows platforms when compiled to the machine code.
>> Actually with performance because on desktop they can perform.
[00:08:59] So on desktop they can perform better with a brutal machine that it might not be so simple. Actually on iOS, for example, it's forbidden to have a built on machine. So if you're making an iOS application, you cannot include the IBM like with the just in time compiler is not possible.
[00:09:16] So a technical issue, it's a commercial issue from the Apple platform. So I think that's the reason. So on mobile for performance and because of the restrictions of the app stores, they are actually compiling to machine code and not to the IBM. Question on the chat?
>> Can you make command line binaries?
>> So if you wanna do binaries, yeah, it's like in machine code. So, you can target machine code for different operating systems. So, in that case you need to pick the operating system. And I mean if you wanna create a Linux output and install like a CLI or something like that, yeah it's possible.
>> Someone was asking what did you mean by null-safety?
>> Okay, we will get into null-safety in a minute with some examples. But it's the ability on a language like Dart to actually express if we accept nulls or not any variable. So if you're writing Java or C sharp or even PHP, if you create a variable, okay, and you don't set the value to it, it stores no, okay?
[00:10:25] So by default it's null. Well, actually when you have null-safety language with null-safety, it cannot be null unless you say so. So, you as a developer can actually make the decision if each variable if you accept nulls or not. So it had to do with the semantics of your code, and it will reduce the amount of bugs that you have in your code.
[00:10:48] So today modern languages such as Dart ,Swift, Caitlyn ,Go and many others are actually supporting null-safety, okay? And this is also coming to other languages as well. C sharp has also null-safety, there is an optional way to do that as well, but it was like something that the others later on C Sharp, okay?
[00:11:13] But we will see an example of that in a minute.