Six must-practice projects for programmers: from data structures to operating systems, computer professors highlight the key points for you
Compiled and edited by Yuyang
Quantum Bit Report | Public Account QbitAI
When it comes to programming, theory alone is not enough, hands-on practice is a must.
However, it is often difficult to decide which project to start with.
If you're still wondering what project you should start your programming practice with, take a look at this list of "challenging projects that every programmer should try."
This is a conscientious recommendation from Austin Z. Henley, an assistant professor at the University of Tennessee, based on his own experience. It not only summarizes the key points of knowledge so that you can focus on your studies, but also thoughtfully organizes additional reading materials.
You can build these projects multiple times, gaining new knowledge each time.
Whenever I don’t know what to start with, or want to learn a new programming language or framework, I start coding with one of the following projects:
Challenging projects every programmer should try
text editor
Without using the built-in text box component in the GUI framework, how can we build a text box that supports cursor movement, selection, insertion, and deletion operations?
There are two main challenges in this project:
-
How to store text documents in memory
-
Learn how the text cursor behaves in popular editors
Don't underestimate these basic functions, there are many details worth noting. For example, when the cursor is in the text, press the up arrow, where will the cursor move to?
△ Image source: Austin Z. Henley
If you think this is too easy, there are advanced tests:
-
Undo/Redo
-
Automatic line wrap
Finally, let’s summarize the key points:
-
Data structures used to store text: array, rope, gap buffer, piece table
-
Text cursor behavior and implementation
-
Undo/Redo Design Patterns: Memory, Commands
-
Abstraction that separates textual vision and memory
Don’t forget to read more:
2D Game - Space Invaders
Even the simplest games require consideration of data structures and design patterns.
In this project, your task is to implement a well-defined game from start to finish, preferably using a 2D graphics library such as SDL, SFML, or PyGame.
△ Image source: Austin Z. Henley
The first step is to create the effect of the object moving.
The second step is to learn all about the game loop. The game actually cycles between drawing, getting user input, and processing game logic.
The third step is to process user input.
The fourth step is to learn how to create and manage all game objects and their states, such as how to generate a dynamic number of enemies.
Step 5: Learn how to apply the game logic. When does the bullet position update? When will more enemies appear on the screen? How do you determine when an enemy has been killed? When does the game end?
Even at the advanced stage, you can consider introducing AI to create more "intelligent" enemies.
Compiler - Tiny BASIC
Write a very small BASIC-like language compiler from scratch, and then compile it to any other language. For example, write a Tiny BASIC compiler in Python that can output C# code.
△ Image source: Austin Z. Henley
Knowledge points:
-
lexical analysis
-
Syntax analysis
-
Recursive descent parsing
-
Abstract Syntax Tree
-
Semantic Analysis
-
Optimizing passes
-
Code Generation
Mini operating system
The difficulty increased from the beginning of this project.
Operating systems are hardware dependent, so the barrier to entry is relatively high, but this project can help you better understand what's going on under the hood of a computer.
The author Henry recommended a free e-book "Building a RISC-V Operating System with Rust" as an introductory textbook (see the address at the end of the article) .
△ Image source: Austin Z. Henley
Knowledge points:
-
Cross-compiling
-
Bootloading
-
BIOS Interrupts
-
x86 mode
-
Memory Management and Paging
-
Scheduling
-
File system
If you think the above four projects are so easy, then try the last two difficult projects.
spreadsheet
Spreadsheet applications such as Excel combine the challenges of text editors and compilers.
In this project, you will learn how to represent cell contents in memory and implement a programming language interpreter for equations.
Video Game Simulator
This is a two-in-one challenge project of operating system + compiler.
The challenge is to write a virtual machine that can run like a real CPU and other hardware components.
Henry's advice is to start with a simple virtual console, such as CHIP-8.
Netizens offer suggestions
As soon as the blog was released, it was welcomed by a large number of programmers on Hacker News and Reddit.
Some netizens said:
These projects expose me to completely different fields and problems, which motivate me more than my day job.
In addition, netizens offered suggestions and recommended several high-quality projects:
-
Building a database from scratch
-
Ray Tracer
-
Vector Graphics Editor
-
Image Decoder
-
Web chat room
-
Digits of Pi Calculator
-
Common terminal utilities (like grep)
-
FTP Client and Server
So, do these projects inspire you?
Talk is cheap. Show me the code. Let’s practice now.
Portal
Blog address:
http://web.eecs.utk.edu/~azh/blog/challengingprojects.html
Hacker News discussion (including more project recommendations):
https://news.ycombinator.com/item?id=21790779
Building a RISC-V Operating System with Rust:
http://osblog.stephenmarz.com/index.html
-over-
Big names gather together! QuantumBit MEET2020 Intelligent Future Conference
The replay of QuantumBit MEET 2020 Intelligent Future Conference is here ! Kai-Fu Lee, Guangnan Ni, Kun Jing, Bowen Zhou, Minghui Wu, Xudong Cao, Jieping Ye, Wenbin Tang, Yanfeng Wang, Gang Huang, Yuan Ma and other AI experts will help you understand artificial intelligence. Scan the QR code to watch the replay~ ~
Quantum Bit QbitAI · Toutiao signed author
Tracking new trends in AI technology and products
If you like it, click "Watching"!