1
00:00:01,690 --> 00:00:04,700
Let's animate Winston
using the shortcuts that you just learned.
2
00:00:05,110 --> 00:00:07,656
So, here we've got Winston with his eyes
3
00:00:07,656 --> 00:00:09,952
and we've got this eyeSize variable.
4
00:00:09,952 --> 00:00:12,750
So if we wanted to make
Winston's eyes get bigger
5
00:00:12,750 --> 00:00:15,644
we could just say "eyeSize += 1,"
6
00:00:15,644 --> 00:00:18,538
adding one pixel to the size of the eyes
7
00:00:18,538 --> 00:00:21,432
each time, and whoah!
Look at it, it's buggin' out!
8
00:00:21,432 --> 00:00:24,015
Let's restart -- whoah! Bug out! Bug Out!
9
00:00:24,685 --> 00:00:26,039
Now, that's pretty cool.
10
00:00:26,039 --> 00:00:28,073
And, it turns out in programming
11
00:00:28,073 --> 00:00:30,107
we actually add one to variables a lot.
12
00:00:30,107 --> 00:00:32,143
Maybe while animating but also,
13
00:00:32,143 --> 00:00:34,162
you'll see there's a lot of other reasons
14
00:00:34,162 --> 00:00:36,451
why we add one to variables later.
15
00:00:36,451 --> 00:00:39,280
Programmers got bored
of writing "+= 1" all the time
16
00:00:39,280 --> 00:00:41,454
because programmers
get bored of silly things.
17
00:00:41,454 --> 00:00:43,757
So they came up with
a shorter way of writing it.
18
00:00:43,757 --> 00:00:48,786
So instead of "eyeSize += 1,"
we could just write "eyeSize++"
19
00:00:49,366 --> 00:00:52,295
You see, it will do
exactly the same thing.
20
00:00:52,295 --> 00:00:54,238
It's just a shorter way of doing it.
21
00:00:54,975 --> 00:00:57,650
And not only do we use
this in programming,
22
00:00:57,650 --> 00:01:00,391
Now most programmers
use it in everyday speech.
23
00:01:00,391 --> 00:01:03,419
Because pretty much
we're all familiar with ++.
24
00:01:03,419 --> 00:01:05,132
And it's an easy way of saying
25
00:01:05,132 --> 00:01:07,315
that you're making
something a little bigger.
26
00:01:07,315 --> 00:01:09,930
So if we went to Winston's birthday party,
27
00:01:09,930 --> 00:01:12,619
we might say, "Oh, happy birthday
Winston, Winston++!"
28
00:01:12,619 --> 00:01:14,662
Because Winston just got a year older.
29
00:01:15,465 --> 00:01:17,556
Or if we just learned a new fact you might be like,
30
00:01:17,556 --> 00:01:20,516
"Oh, go us, intelligence++!"
31
00:01:21,514 --> 00:01:23,080
That's pretty fun.
32
00:01:23,080 --> 00:01:25,886
So when should you use ++ versus +=?
33
00:01:25,886 --> 00:01:29,605
Well, I think for animation
it's cool to use +=, because then
34
00:01:29,605 --> 00:01:32,136
you can use the number scrubber
and you can be like,
35
00:01:32,136 --> 00:01:35,064
"Whoah! Let's make it -- whoah whoah!
That was awesome!
36
00:01:35,064 --> 00:01:38,026
Let's make it really crazy,
really different!
37
00:01:38,026 --> 00:01:41,486
Oh! (laughter) See how fun that is?
38
00:01:41,700 --> 00:01:44,305
But, you know, depending
on what you're doing
39
00:01:44,305 --> 00:01:46,650
it might be convenient just to say "++."
40
00:01:46,650 --> 00:01:49,931
And you'll see later
that there's lots of times
41
00:01:49,931 --> 00:01:51,694
when you might want to add one
42
00:01:51,694 --> 00:01:53,457
to variables, not just for animation,
43
00:01:53,457 --> 00:01:56,020
where the ++ operator
could become even more useful.
44
00:01:56,020 --> 00:01:58,435
So just keep that in mind
when you see that ++
45
00:01:58,435 --> 00:02:00,595
and try using it in your everyday speech.