>> So we just went over the Fibonacci sequence.
Now, that was pretty complicated.
Are there any tools we could use to make that a bit easier?
>> I definitely have an idea of how we can make
that better. Let's try this.
Let's go and do that.
I notice I keep pressing "Control F5".
That's what I'm doing. I've been doing all these videos,
I've been going and saying start without debugging.
But I don't necessarily want to do that.
I'm going to try something different, if that's okay with you?
>> Yeah.
>> Why don't we do this?
We have never done this before.
I'm going to click over here in the left.
>> So what did you just do? What is this red dot?
>> You see this? This is called a break-point.
There's lots of ways to do this.
I can click in the margin.
>> It almost looks like a stop symbol.
>> It does look like a stop symbol.
I could go and say insert break point.
I can go and press "F9",
if I like my hotkeys and lots
of people just like to put their stop symbols over here,
and then I'm going to hit the "Play" button.
Hit "Play" this is F5 instead of Control F5
on your keyboard and
everything's changed and I'm freaking out, what's happening?
>> What are all these Windows.
>> So all these things popped out to make my life
easier and you might be initially shocked,
but you can move those splitters around and see what's going on.
It'll show you a bunch of stuff kind of like a car dashboard.
Maybe more than you need,
but let's just worry about the left side where our code is,
and this, look at that.
>> So this is all feedback on the execution process,
so I'm actually paused in
the middle of executing all of this code.
>> You're absolutely right. We were in the middle
of watching our show,
we paused it in the middle,
maybe I fast-forward a commercial.
Where are we in the process here?
Are we on the first time
through or the 20th time through, how can we tell?
>> I believe it's the first time through,
so we can actually inspect our variables.
So the number of Fibonacci like how many items are in that array,
it still says two.
>> Yeah.
>> We can see that in our Autos Window down at the bottom.
>> Yeah, it is the first time.
>> So it's keeping track of all of
the variables that we have in our current scope.
>> Right, and we have not yet added that first number,
which would be in this case what,
1 plus 1 is 2.
So we can go and hit our "Step over" button.
I'm going to hit "F10".
If you don't see yours,
you can make sure if you right-click up in the toolbar that you
have the "Debug toolbar" button.
>> Those little arrows.
>> Show next statement, step over.
What we're looking for is to step over.
See it's a dot, that's that dot right there.
We're going to step over that dot and look,
see it actually turns red to tell you what changed,
it added a new thing and here's a fun thing.
>> Yeah. So there's three elements in that array.
>> So I'm going to put my finger on
F10 or you could go and just click right here and watch.
>> Wow. So you can actually see
it's circling through your while loop.
>> This is a great way to remind yourself,
if you're a new programmer,
how this stuff works.
Even though I'm clicking fast, it's
a slow-motion version of what's happening.
So let's stop right there we're it's 14, see,
and I can open that up and look there's my zeroth
and my first and all the way down to my 13th.
Now, here's a trick, you showed me this trick.
I can go and put another breakpoint here and turn that one
off and I can continue and it will go there.
So I can basically move the stop sign.
>> Right. So instead of clicking through 18
more times or however many you need to get through that array-
>> Yeah.
>> -you can just hit the next break.
>> This is great. Run to cursor.
>> I love this one.
>> So I'm not going to put a breakpoint,
I'm just going to say "Run to here",
and now I've stopped right there.
>> Well, and your Fibonacci numbers count is
already at 20 because we're done with
the while loop and now we're just printing it out
and not for each that goes through the console red line.
>> Exactly, and remember there's 20 items or you
have to get used to that zero-base thing.
There's 20 items there, the 20th or
in this case the 19th with a zero.
Starting number is 6765.
So we did it right, and then if we
wanted to go and do this all over again,
we could loop, loop,
loop, loop, loop, loop, loop, loop,
which is no fun if you do it more than a few times or I
can just push the "Play" button again and continue,
and when I do my continue, there's my result.
So that's interactive debugging.
So we learned a little bit of a bonus thing
there as we were running
through our working with lists of other stuff.
All right. So we're going to stop right there and we're going
to go on in a little bit and talk about classes and objects.