Computer Science Course Outline
This is the outline for an in-person course I intend to run, teaching everything I have learned about computer science and programming to interested students. I struggled a lot in the early stages with understanding these concepts, so I'd like to make it easier for others. This course is as yet untested, so it is subject to change, but it follows a lot of what I taught myself, so hopefully it will help other students too.
If you're interested in participating, you can email me at daliasblog@proton.me or connect with me on LinkedIn.
One final note: this course content is obviously too extensive to get through in a reasonable length of time if it is only conducted for a few hours each week. While I would aim to take students through as much material as possible, proper absorption is key, meaning that the material should not be rushed. The earlier sections of this course are designed to empower students with the mental tools to attempt some of the later material on their own, even if time does not permit within a structured course. This outline will at least provide some direction on where that should go.
Segment One
This will start with ensuring that students are all able to write code in a basic text editor (no auto-complete to ensure memory retention) and run their code in the terminal or in powershell.
How to implement standard library functions in a common high-level language (most likely Python or TypeScript, depending on class comfort, or both). Some common string and array operations will be presented to the students, who will then be asked to discuss how to implement these.
A couple of examples will be demonstrated, followed by class work, individually, or in pairs or small groups. Students will be encouraged to implement several of these themselves, and present their findings afterwards.
The learning objective is the ability to start considering the implementation of common functionality, rather than merely accepting its APIs as a black box.
Segment Two
Installing Linux. Future classes will rely on access to UNIX functionality. Getting the whole class to install Linux on a VM exposes them to a number of important skills as well as providing a uniform development platform.
Students will download a common virtualisation software, probably VirtualBox. Linux Mint can then be installed. (A headless version of Arch Linux would be a great exercise for later, but using Mint will remind students that the VM really is just another computer, while sidestepping the hurdles of a difficult installation process.)
The following couple of classes will be taken up with an introduction to Bash. Students will also start using Vim.
The learning objective is to understand at a high level what an operating system is, what a virtual machine is, and how the command line can be used to perform various basic commands.
Segment Three
We learn C. Students will ensure that the appropriate compiler and headers are installed to run C. They will create a practice directory and start by writing, compiling, and running, a hello world program.
Then we learn the basics of type declarations, control statements, function calls, memory allocation, pointers, how strings and arrays work, and finally, the Stack and the Heap. Students will be encouraged to make mistakes and break things.
The learning objective of this section is to be able to comfortably write a program that passes pointers to functions and receives pointers back from functions. Students will write simple programs in TS and Python, and then reimplement them in C. This will include some of the standard library functions students wrote in Segment One.
Segment Four
Assembly. Even if comfort with C is still shaky, this is a good time to start talking about what happens when the computer compiles and runs C code. We will learn to use the -S option to the compiler, as well as hexdumps, to investigate the intermediate files gcc is producing. (Along the way, lessons about Linux will be reinforced, such as the fact that everything is a file.)
Students will learn to write basic hello world programs in Assembly. By the time they finish this segment, they will understand how the heap and the stack work in Assembly, and what happens to the call stack when functions are called.
Segment Five
Students will create some basic web pages with HTML, CSS and JS and view them in the browser through the file protocol. This will give students an early taste of graphics programming, and prepare them for understanding how networking functions. The lesson that web pages are just files will be explained.
Segment Six
Networking. We will write a simple server and client in C, followed by an HTTP parser. Students will learn about the IP, TCP and HTTP protocols.
Segment Seven
Operating Systems. Students will learn the basic principles of how an operating system works and what functionality it provides. Some further lessons about Bash will be reinforced here, allowing students to monitor processes, kill them, fork them, put them in the background, mount drives, format partitions, create files, listen on ports. Some of the previous lessons about C and Assembly will be reinforced here.
Segment Eight
The hardware. We start learning Von Neumann architecture and building the basics of an OS. We learn about logic gates, instruction sets, arithmetic units, registers, program pointers. If there is demand, students can acquire their own Raspberry Pi 0s and start tinkering on even lower level systems without an OS. The lessons from Assembly start to be integrated at this point.
Segment Nine
Building a basic text editor in the terminal. Students will learn how to clear the screen, how to receive input and "draw" it, how the window manager provides windows for them, which map into the big memory chunk reserved for the monitor, how to intercept and handle user input. Implementing functionality like backspacing, or only modifying specific portions of the screen will show students how this is done in the software they use.
Segment Ten
Students are now ready to learn graphics. This won't be feasible on a VM, as it will be too slow. Students will install Pygame and make a basic game of Pong, followed by a rudimentary digital art program. Learning the coordinate system, how to handle user input, how to save files and load them, and how to draw to the screen, will reinforce previous lessons, while preparing students for any graphical or frontend web programming.
Segment Eleven
Building a web browser. This will go just far enough to give students the insights on how text and images are formatted on the page, and how JS is interpreted in a bytecode interpreter in the browser. This might just be a theoretical class, with pointers to the online guides, as it will be far too big for a class to follow.
Segment Twelve
Building a database. Students will build a basic key value store with crud operations. This will prepare students to think about efficiency of storage and retrieval, hashing, cryptography, collisions.
Segment Thirteen
How to build an interpreter. Again, this will be a nod to SICP, K&R, Crafting Interpreters, and the Dragon Book. The process of parsing and compiling will be explained. This will tie together lessons about how an interpreter works, debuggers, linters, browsers, database SQL compilers, regex parsers, emulators, containers, VMs, the OS itself.
This is the lesson that shows students the rest of the path from what they've learned. Based on demand, further classes for topics such as browsers, embedded code, server-side frameworks, compilers, or graphics coding, can be offered, but the currently outined segments will satisfy the initial goal of getting overwhelmed students to the point of understanding the landscape of computer science and software engineering.