Reflections on Writing Over Half a Million Lines of Go at Khan Academy

The article shares Khan Academy engineers' journey migrating a large Python codebase to Go, highlighting their growing love for the language, the need for generics, performance and concurrency benefits, and overall impressions after producing more than 500,000 lines of production Go code.

Python Programming Learning Circle
Python Programming Learning Circle
Python Programming Learning Circle
Reflections on Writing Over Half a Million Lines of Go at Khan Academy

In December 2019 the author began the Goliath project, migrating Khan Academy's backend from Python 2 to services written in Go, introducing necessary changes for the transition.

At the start, no team member knew Go; through experiments they proved Go was a better choice. Today all backend and full‑stack engineers write Go, with over 500,000 lines in production, prompting a reflection on the language.

1. Engineers Love Go

Engineers describe Go as easy to read and write, and they appreciate its error‑handling model that returns error values. One veteran .NET developer praised being able to call functions that never return errors when they succeed. Others admire the standard library (e.g., io.Writer) and the excellent tooling—fast compilation, built‑in formatting, and reliable module management such as gqlgen.

2. We Want Generics, Otherwise Go Feels Verbose

While most code works without generics, many engineers miss them, especially when writing internal libraries or handling slices. The lack of generics is the most common complaint, and the Go team's effort to add generics has been well received. Engineers are excited about the upcoming release, expecting it to reduce boilerplate and enable higher‑order functions, with the new slice package cited as a promising addition.

3. Performance and Concurrency

Comparisons with Python show Go’s superior performance: a class of 1,000 students loads in 4 seconds with Go versus 28 seconds in Python, and data‑store warnings that occurred hourly in Python are almost nonexistent in Go. The team also leverages Go’s concurrency features; although channels are notable, they often use the sync package more heavily.

4. Thoughts After Writing 500 K Lines of Go

In summary, Go is more verbose than Python but the team loves it for its speed, reliable tooling, and production stability. Engineers come from diverse backgrounds, leading to varied perspectives, yet they all agree that Go has fulfilled the goals of the Goliath project, and they thank the Go community for its continued development.

Original article: https://blog.khanacademy.org/half-a-million-lines-of-go/

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

GoGenerics
Python Programming Learning Circle
Written by

Python Programming Learning Circle

A global community of Chinese Python developers offering technical articles, columns, original video tutorials, and problem sets. Topics include web full‑stack development, web scraping, data analysis, natural language processing, image processing, machine learning, automated testing, DevOps automation, and big data.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.