Instructor: Let's talk about
our next developer fundamentals,
and this one is understanding data structures.
A really good programmer is a programmer
that is able to decide
what data structure to use, when.
Up until now, we've learned about dictionaries and lists,
and we'll learn about a couple more throughout the course.
But a really good programmer,
a programmer who's experienced,
is able to understand what the trade-offs are,
when to use what.
And although, I can give you a list of,
"This is when you should do this,
and this is when you should use maybe dictionaries."
The thing is, this takes practice and experience.
So throughout our course,
and then the exercises that we're gonna do,
the projects we're gonna build at the end,
I hope that this idea of understanding
when to use what data structure makes sense to you.
But let's go back to our example.
When should you use a list,
and when should you use a dictionary?
Well, the first thing we have to realize
that a dictionary is not sorted, right?
A list has order.
It has zero, one, indexes,
so on and so forth.
A dictionary has no order.
So maybe if you wanna have a list
of people in line at your shop,
well, you should probably use a list.
But, maybe, you have a user that is playing a game,
and that user has first name, maybe weapons,
maybe an age.
That doesn't have to be ordered
so you might use a dictionary.
Also, you'll notice that dictionaries
hold more information than lists, right?
Because lists only have that single value.
That is, a list has the index,
and then whatever the value is.
In here, we have a dictionary inside of a list,
which is holding a lot of information.
Deep down, a list is simply an index
and some sort of value here, right?
Versus a dictionary that holds a lot more information.
It holds a key.
So this could be the weapons of that user.
"Hello" can be the greeting of that user.
Maybe is_Magic,
is another information about that user.
So we're able to have both keys and values
in a dictionary,
so it holds a lot more information.
And as we learn different data structures,
you'll have these different pros and cons.
You'll start to understand as to when to use what.
All right, there's another developer fundamentals.
I'll see you in the next one.
Bye-bye.