By the way: we can use git now to save the code that we made in A1.
Ask chatgpt
how to commit a couple files and how to create a new branch?
And wth hell does that mean?
And also while we are not really writing code manually you should still be able to at least read the code that is produced by ChatGPT.
That’s why I would like to talk about the print
command in this course.
PRINT or WRITE was used in early FORTRAN or BASIC programs already and was at first meant to actually print/write something.
Early computers had no screens—only punch cards, teletypes (TTYs), or line printers.
Unix (1969) introduced standard output (stdout
) in the late 60’s so it was possible to select where to print something.
so a
PRINT *, "Hello, World!"
in FORTRAN was most likely printed onto a paper strip (* = in default formatting).
Let’s have a look at C code which makes it a little bit clearer
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
#include <stdio.h> << here we are importing some code - a so called header file which gives us standard functionality
stdio.h
stands for “Standard Input/Output Header”.
int main() { << this starts a so called function (and since it is called main it is the standard entry point for a C program).
the “int” at the beginning is a so called data type (integer = which are numbers like 0,1,2,3,4,5,… - there are multiple otehr data types - but we will talk about them later - same as with return and the "closing bracket } ")
printf("Hello, World!\n"); << means formatted (hence the f) printing of what ever is inside the two double quotes.
So it prints “Hello, World! and then \n which is translated into a line break” onto the terminal on your screen - where you run the compiled program.
There is no need to look into data types just yet. Just need to understand the print command and, then after some sleep we will continue with the next step. It perfectly makes sense to sleep after each lesson before continuing with the next lesson. That has to do with how the brain stores information.
I would not recommend to take more than one task per day but be consistent! We are getting there faster than you think