WEBVTT
00:00:01.690 --> 00:00:04.700
Let's animate Winston
using the shortcuts that you just learned.
00:00:05.110 --> 00:00:07.656
So, here we've got Winston with his eyes
00:00:07.656 --> 00:00:09.952
and we've got this eyeSize variable.
00:00:09.952 --> 00:00:12.750
So if we wanted to make
Winston's eyes get bigger
00:00:12.750 --> 00:00:15.644
we could just say "eyeSize += 1,"
00:00:15.644 --> 00:00:18.538
adding one pixel to the size of the eyes
00:00:18.538 --> 00:00:21.432
each time, and whoah!
Look at it, it's buggin' out!
00:00:21.432 --> 00:00:24.015
Let's restart -- whoah! Bug out! Bug Out!
00:00:24.685 --> 00:00:26.039
Now, that's pretty cool.
00:00:26.039 --> 00:00:28.073
And, it turns out in programming
00:00:28.073 --> 00:00:30.107
we actually add one to variables a lot.
00:00:30.107 --> 00:00:32.143
Maybe while animating but also,
00:00:32.143 --> 00:00:34.162
you'll see there's a lot of other reasons
00:00:34.162 --> 00:00:36.451
why we add one to variables later.
00:00:36.451 --> 00:00:39.280
Programmers got bored
of writing "+= 1" all the time
00:00:39.280 --> 00:00:41.454
because programmers
get bored of silly things.
00:00:41.454 --> 00:00:43.757
So they came up with
a shorter way of writing it.
00:00:43.757 --> 00:00:48.786
So instead of "eyeSize += 1,"
we could just write "eyeSize++"
00:00:49.366 --> 00:00:52.295
You see, it will do
exactly the same thing.
00:00:52.295 --> 00:00:54.238
It's just a shorter way of doing it.
00:00:54.975 --> 00:00:57.650
And not only do we use
this in programming,
00:00:57.650 --> 00:01:00.391
Now most programmers
use it in everyday speech.
00:01:00.391 --> 00:01:03.419
Because pretty much
we're all familiar with ++.
00:01:03.419 --> 00:01:05.132
And it's an easy way of saying
00:01:05.132 --> 00:01:07.315
that you're making
something a little bigger.
00:01:07.315 --> 00:01:09.930
So if we went to Winston's birthday party,
00:01:09.930 --> 00:01:12.619
we might say, "Oh, happy birthday
Winston, Winston++!"
00:01:12.619 --> 00:01:14.662
Because Winston just got a year older.
00:01:15.465 --> 00:01:17.556
Or if we just learned a new fact you might be like,
00:01:17.556 --> 00:01:20.516
"Oh, go us, intelligence++!"
00:01:21.514 --> 00:01:23.080
That's pretty fun.
00:01:23.080 --> 00:01:25.886
So when should you use ++ versus +=?
00:01:25.886 --> 00:01:29.605
Well, I think for animation
it's cool to use +=, because then
00:01:29.605 --> 00:01:32.136
you can use the number scrubber
and you can be like,
00:01:32.136 --> 00:01:35.064
"Whoah! Let's make it -- whoah whoah!
That was awesome!
00:01:35.064 --> 00:01:38.026
Let's make it really crazy,
really different!
00:01:38.026 --> 00:01:41.486
Oh! (laughter) See how fun that is?
00:01:41.700 --> 00:01:44.305
But, you know, depending
on what you're doing
00:01:44.305 --> 00:01:46.650
it might be convenient just to say "++."
00:01:46.650 --> 00:01:49.931
And you'll see later
that there's lots of times
00:01:49.931 --> 00:01:51.694
when you might want to add one
00:01:51.694 --> 00:01:53.457
to variables, not just for animation,
00:01:53.457 --> 00:01:56.020
where the ++ operator
could become even more useful.
00:01:56.020 --> 00:01:58.435
So just keep that in mind
when you see that ++
00:01:58.435 --> 00:02:00.595
and try using it in your everyday speech.