Welcome to the fourth part of the curse.
Until now, you are using singular values, only now it's time to learn about more advanced data types
in this path, you're going to learn almost everything about the composite types.
A composite type is a type that is constructed by using other types, and a composite value can store
more than one value.
So without further ado, let's take a look at our road map.
In this section, you're going to learn about errors and error is an indexable collection of elements,
it can only store the same type of values and its length is fixed.
Because of that, errors are very inflexible.
However, they allow us to work with more efficient composite types like slicers.
So after a race, you're going to learn about slices, a slice is just like an array.
However, there is an important difference between an array and a slice.
Unlike an array, a slice can grow and shrink.
So you can add new elements or you can remove existing elements from a slice, but you can do so in
an array.
OK, after slicers, we're going to revisit the strings again, but this time we will go deeper in the
strings are actually bite slices and slices depend on iRace.
So those three are interconnected.
That's why you're going to learn them in this order.
So after you learn everything about shrinks, you're going to learn about maps and map allows us to
fast look up in a collection of values by using a key, it allows us to create more efficient go programs.
And lastly, you're going to learn about stocks, usually a variable can only store one type of value.
On the other hand, Astrachan store different types of values.
It is different than all of these composite types here because it allows us to represent concepts rather
than a series of values.
In addition to that, it doesn't support indexable access to its inner values.
All the other composite literature support access to their elements using index expressions.
Now, let's talk a little bit about what you're going to learn in this section.
First of all, we will start with Vasundhara, things like what an array looks like in computer memory,
how the array type works, and some fundamental properties of arrays that we're going to talk about
how to get and set and arrays, elements.
And after that, we're going to talk about array literals, which, by the way, is an easy way to create
array values.
While we are talking about array literals, we also going to talk about composite literals and there
are differences from other basic data types and so on.
Then we're going to talk about how to compare an assignment era to another era.
We are also going to talk about multidimensional arrays that allow us to create a race within a race.
And after that, we going to talk about how to create a race using the key elements that allow us to
specify index positioning while we are creating an array.
And lastly, we're going to talk about named versus unnamed types.
We're going to get deeper into the go type system further and you're going to learn what an unnamed
type is and so on.
Now, let's talk about the projects that you're going to build.
The first project that we're going to build is called Moodley.
It will show random messages depending on your mood.
For example, let's say I feel good, then I'm going to run the program like this that will print a
positive message like this.
Let's say I don't feel good, then it will display a message like this, it will get these messages
from iRace.
After that, we're going to build a gorgeous command line, digital clock, we're going to animate this
clock so that it will continuously show the current time every second it's going to look like this.
Don, we're also going to animate the separators so that every two seconds they will blink.
OK, let's talk a little bit about why you should use a phrase, by the way, if you already know about
race, you can skip the rest of this video.
All right, so why would you want to use a phrase, instead of simple values in programming, we need
to work with multiple values at the same time without errors.
This can be hard, inefficient and inflexible to work with.
Let me show you what I mean.
For example, let's say you have 1000 different variables and you need to sum them all.
All right.
How can you do that?
Well, you need to add them one by one by hand, right.
However, doing so would be very inefficient and hard.
Right.
Let me show you how you can do the same thing using an array and a loop.
And by the way, as I said, is a composite value, it's called a composite value because it cannot
contain zero or more values.
So we can use a composite value.
You can store multiple values in it.
Here I put these values in a single array variable.
Now it starts 1000 of values in an array.
So instead of creating thousands of variables, I just created a single array value.
Now I can use this array variable and I can sum all the numbers using a simple loop like this.
That's it, is it right, by the way, this is only one of the benefits of using a race, you learn
the rest of them in the section.
No worries.
All right.
That's all for now.
You're going to learn a lot of things.
Again, another exciting journey is about to start.
So see you in the next lecture by.