CS50 Study Note
Study Note from Computer Science course 50.
Notes
This notebook is referenced from the CS50 course conducted by MIT lectures online from youtube. The course can be found in this youtube link.
Previews
My programming jorney starts from 3 years ago, when I first learn Python from youtube. It is a easy programming compare to others. Before that, I have attended lectures from university for basic comptuer science in C++ language. It was not a very productive one. And after I learnt Python, it is superficial, I now know that, to get the best performance of the algorithms, I need to know the logic behind all the pre-built function. That is why I started learning this course.
CS50, this lecture is really one of the top in my favorate list from my learning jorney. The lectures is energetic, explaning the lowest detail of the programming. I wish I have seen this lecture sooner.
Lectures 1 - C
The lecture is mainly conducted with using C
langauge in first 5 lectures of the course. C language is the low level language meaning we can get the best performance in speed compare to other languages if the algorithms is optimized.
Good coding practice
To get the most efficient code, meaning it is functionable, able to get the desired output, it have a good design, most efficient and it have a good style, so everyone can understand the code.
$$ Code \begin{cases} \quad \text{Functionable} \\ \quad \text{Design} \\ \quad \text{Style} \end{cases} $$Command Line Interface (CLI) and Graphic User Interface (GUI)
Developer often use command line (terminal in mac) to execute the program. CLI is less user friendly than GUI, it needs a bit more knowledge but it is hackable and origin. The terminal is a platform which we can use complier to compile the code to machine code and open that machine code to get the output of the program.
So, the typical process is,
- Write the code with text editor (visual studio code, atom, etc)
- Compile the code in terminal with compiler and output machine code.
- Run the machine code and output the result in terminal.
Compiler is the program that is pre-written to convert the code that we write to machine code, that the computer understand. Different language have different compiler. And in mac, we need to install X-Code to run C program cause X-code is the compiler that contain multiple languages including C.