text
stringlengths
1
81
start
float64
0
10.1k
duration
float64
0
24.9
>> But, ultimately, what you're going to see within CS50 IDE
902.4
3.15
is three distinct areas-- an area on the left where
905.55
2.79
your files are going to be in the cloud, an area on the top right
908.34
4.264
where your code is going to be editable.
912.604
1.666
You'll be able to open individual tabs for any program
914.27
2.38
that you write this semester inside of that top right hand corner.
916.65
3.02
And then most arcanely, and yet powerfully,
919.67
3.4
is going to be this thing at the bottom known as a terminal window.
923.07
3.54
>> This is an old school Command Line Interface,
926.61
2.84
or CLI, that allows you to execute commands
929.45
2.79
on the computer-- in this case, the computer in the cloud--
932.24
3.02
to do things like compile your code from source code to machine code,
935.26
3.83
to run your programs, or to start your web server, or to access your database,
939.09
4.51
and any number of other techniques that we'll start to use before long.
943.6
3.854
But to get there, we're going to actually have
947.454
1.916
to go online and start playing.
949.37
1.87
And to do that, let's first start tinkering with main,
951.24
3.159
and write the main part of a program.
954.399
1.541
And let's use that function printf, which we used earlier,
955.94
3.23
simply to say something.
959.17
1.88
>> So here I am already inside of CS50 IDE.
961.05
3.86
I've logged in advance.
964.91
1.02
And I full screened the window.
965.93
1.43
And so, ultimately, you too in coming problems
967.36
2.31
will follow similar steps that will provide online documentation.
969.67
3.29
So you don't need to worry about absorbing every little technical step
972.96
3.4
that I do here today.
976.36
1.37
>> But you'll get a screen like this.
977.73
1.492
I happen to be in night mode.
979.222
1.208
And you can brighten everything up by disabling night mode.
980.43
2.514
And at the end of the day, you're going to see
982.944
1.916
these three main areas-- the file browser at left, the code tabs up top,
984.86
5.23
and the terminal window at the bottom.
990.09
2.34
>> Let me go ahead and write my first program.
992.43
2.46
I'm going to preemptively go to File, Save, and save my file as hello.c.
994.89
7.41
Indeed, by convention, any program we write that's written in the C language
1,002.3
4.55
should be named something dot c, by convention.
1,006.85
2.889
So I'm going to name it hello.c, because I just want to say hello to the world.
1,009.739
3.291
Now I'm going to zoom out and click Save.
1,013.03
1.79
And all I have here now is a tab in which I can start writing code.
1,014.82
3.36
>> This is not going to compile.
1,018.18
1.31
This means nothing.
1,019.49
0.81
And so even if I converted this to zeros and ones,
1,020.3
2.45
the CPU is going to have no idea what's going around.
1,022.75
2.64
But if I write lines that do match up with C's conventions-- C being,
1,025.39
8.78
again, this language-- with syntax like this, printf hello world-- and I've
1,034.17
5.98
gotten comfortable with doing this over time.
1,040.15
2.06
So I don't think I made any typographical errors.
1,042.21
2.3
>> But, invariably, the very first time you do this, you will.
1,044.51
3.4
And what I am about to do might very well not work for you the first time.
1,047.91
3.18
And that's perfectly OK, because right now you
1,051.09
2.52
might just see a whole lot of newness, but over time once you get familiar
1,053.61
4.052
with this environment, and this language, and others,
1,057.662
2.208
you'll start to see things that are either correct or incorrect.
1,059.87
2.5
>> And this is what the teaching fellows and course
1,062.37
1.999
assistants get so good at over time, is spotting mistakes or bugs in your code.
1,064.369
4.411
But I claim that there are no bugs in this code.
1,068.78
3.33
So I now want to run this program.
1,072.11
1.88
>> Now on my own Mac or PC, I'm in the habit of double clicking icons
1,073.99
3.45
when I want to run some program.
1,077.44
1.91
But that's not the model here.
1,079.35
1.73
In this environment, which is CS50 IDE.
1,081.08
3.49
We are using an operating system called Linux.
1,084.57
2.622
Linux is reminiscent of another operating system, generally known
1,087.192
2.708
as Unix.
1,089.9
0.95
And Linux is particularly known for having a Command Line Environment, CLI.
1,090.85
5.49
Now, we're using a specific flavor of Linux called Ubuntu.
1,096.34
3.73
And Ubuntu is simply a certain version of Linux.
1,100.07
2.7
>> But these Linux's these days do actually come with graphical user interfaces.
1,102.77
5.13
And the one we happen to be using here is web-based.
1,107.9
2.46
So this might look even a little different from something
1,110.36
2.375
you yourself might have seen or run in the past.
1,112.735
2.575
>> So I'm going to go ahead now and do the following.
1,115.31
2.6
I've saved this file as hello.c.
1,117.91
3.04
I'm going to go ahead and type clanghello.c So Clang
1,120.95
6.4
for the C language is a compiler.
1,127.35
2.5
It's pre-installed in CS50 IDE.
1,129.85
2.102
And you can absolutely download and install this on your own Mac or PC.
1,131.952
2.958
>> But, again, you wouldn't have all of the pre-configuration done for you.
1,134.91
3
So for now, I'm just going to run clanghello.c.
1,137.91
3.03
And now notice this syntax here will eventually
1,140.94
2.3
realize just means that I'm in a folder or directory called Workspace.
1,143.24
3.69
This dollar sign is just convention for meaning, type your commands here.
1,146.93
4.1
>> It's what's called a prompt, just by convention is dollar sign.
1,151.03
3.53
And if I go ahead now and click Enter, nothing seems to have happened.
1,154.56
4.57
But that's actually a good thing.
1,159.13
1.8
The less that happens on your screen, the more likely
1,160.93
2.72
your code is to be correct, at least syntactically.
1,163.65
3.06
>> So if I want to run this program, what do I do?
1,166.71
2.41
Well, it turns out that the default name by convention
1,169.12
4.65
for programs when you don't specify a name for your program is just a.out.
1,173.77
5.084
And this syntax too, you'll get familiar with before long.
1,178.854
2.416
>> Dot slash just means, hey, CS50 IDE, run a program called a.out
1,181.27
6.23
that's inside my current directory.
1,187.5
1.9
That dot means the current directory.
1,189.4
2.12
And we'll see what other such sequences of characters means before long.
1,191.52
3.52
>> So here we go, Enter, hello world.
1,195.04
3.39
And you'll notice, that what happened?
1,198.43
1.65
Not only did it print hello world.
1,200.08
1.5
It also moved the cursor to the next line.
1,201.58
4.41