Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,360 --> 00:00:08,900
Let's talk about our next developer fundamentals and this one is understanding data structures a really
2
00:00:08,900 --> 00:00:16,550
good programmer is a programmer that is able to decide what data structure to use when up until now
3
00:00:16,550 --> 00:00:22,070
we've learned about dictionaries and lists and we'll learn about a couple more throughout the course
4
00:00:22,820 --> 00:00:28,970
but a really good programmer a programmer who's experienced is able to understand what the tradeoffs
5
00:00:28,970 --> 00:00:30,630
are when to use what.
6
00:00:30,740 --> 00:00:35,870
And although I can give you a list of this is when you should do this and this is when you should use
7
00:00:35,870 --> 00:00:37,450
maybe dictionaries.
8
00:00:37,490 --> 00:00:40,720
The thing is this takes practice and experience.
9
00:00:40,760 --> 00:00:45,400
So throughout our course and then the exercises that we're going to do the projects we're going to build
10
00:00:45,410 --> 00:00:46,210
at the end.
11
00:00:46,280 --> 00:00:51,950
I hope that this idea of understanding when to use what data structure makes sense to you.
12
00:00:52,250 --> 00:00:54,260
But let's go back to our example.
13
00:00:54,500 --> 00:01:01,370
When should you use a list and when should you use a dictionary Well the first thing we have to realize
14
00:01:01,760 --> 00:01:06,180
that a dictionary is not sorted right.
15
00:01:06,260 --> 00:01:09,740
A list has order it has zero one indexes.
16
00:01:09,740 --> 00:01:10,990
So on and so forth.
17
00:01:11,090 --> 00:01:13,570
A dictionary has no order.
18
00:01:13,610 --> 00:01:21,230
So maybe if you want to have a list of people and line your shop well you should probably use a list.
19
00:01:21,290 --> 00:01:29,480
But maybe you have a user that is playing a game and that user has first name maybe weapons maybe an
20
00:01:29,540 --> 00:01:31,630
H that doesn't have to be ordered.
21
00:01:31,730 --> 00:01:34,020
So you might use a dictionary.
22
00:01:34,280 --> 00:01:39,380
Also you'll notice that dictionaries hold more information than lists right.
23
00:01:39,620 --> 00:01:43,670
Because lists only have that single value.
24
00:01:43,940 --> 00:01:45,270
That is a list.
25
00:01:45,290 --> 00:01:52,490
Has the index and then whatever the value is in here we have a dictionary inside of a list which is
26
00:01:52,490 --> 00:01:54,520
holding a lot of information.
27
00:01:54,650 --> 00:02:00,600
Deep down a list is simply an index in some sort of a value here.
28
00:02:00,650 --> 00:02:01,300
Right.
29
00:02:01,340 --> 00:02:04,560
Versus a dictionary that holds a lot more information.
30
00:02:04,640 --> 00:02:05,830
It holds a key.
31
00:02:05,840 --> 00:02:10,700
So this could be the weapons of that user.
32
00:02:10,700 --> 00:02:21,060
Hello can be the greeting of that user maybe is Magic is another information about that user.
33
00:02:21,110 --> 00:02:24,290
So we're able to have both keys and values in a dictionary.
34
00:02:24,310 --> 00:02:26,790
So it holds a lot more information.
35
00:02:26,940 --> 00:02:32,160
And as we learn different data structures you'll have these different pros and cons.
36
00:02:32,160 --> 00:02:35,910
You'll start to understand as to when to use what.
37
00:02:35,910 --> 00:02:36,630
All right.
38
00:02:36,630 --> 00:02:38,670
There's another developer fundamentals.
39
00:02:38,670 --> 00:02:40,110
I'll see in the next one by.
3672
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.