This week, I started my new main task: migrating the backend of the registration system from C++ to Go (Golang). I’m not familiar with either language, so most of my week went into understanding the existing code and learning the basics of Go.
Understanding the Existing System
Monday was a light day, as I spent most of it travelling back after the weekend event in Johor Bahru. In the time I had left, I went through the C++ code again. Instead of trying to understand all 3,000 lines, I focused on what each part of the system does.
From what I understood, the registration system quietly works in the background. When a parent registers and pays on the competition website, the order is saved into CouchDB, our database. The system keeps watching the database, and when it sees a completed order, it turns the order into an entry. It then creates a registration slip in PDF with a QR code on it, and emails the slip to the parent. Besides that, it also creates PDF previews whenever the templates are changed, and exports entries into CSV files.
Learning Go
On Tuesday, I started learning Go. The first thing I noticed is that Go puts the type after the variable name, so it is var count int instead of int count like in C++. Go functions can also return more than one value, and := lets Go work out a variable’s type from its value.
To keep the migration moving while I learn, I decided to spend a few days on the basics through A Tour of Go, then port the system one small part at a time, so each part becomes its own lesson. On Friday, I moved on to methods and pointers.
Looking for a Backend Project
Besides the migration, I started looking for a backend project to propose to Dr. Shawn. I wanted one that lets me learn real backend development while solving a real problem. I came up with many ideas but dropped most of them, because they brought little value to the business or would make the staff’s work heavier. To look for real problems, I went through a full judging round in the admin app and the judge app on a test database. I haven’t settled on an idea yet.
Next Week’s Plan
Next week, I plan to finish the basics in A Tour of Go. After that, I will go through the Go version that Dr. Shawn has already started and compare it with the C++ code, to see which parts are done and which are still missing. Once I have a clearer picture, I will start porting the system one small part at a time, beginning with the simpler parts, so I can learn Go along the way.
0 Comments