Hi there 👋, @whoami

  • My name is Derek, I am a software developer at Goldman Sachs. I live in Singapore 🇸🇬 right now, and plan to relocate to Hong Kong 🇭🇰 soon

  • My current project specialises in a Raft-based, API-driven distributed scheduling platform for batch workflows (think of Apache Airflow) that takes care of around 40 million firmwide job executions daily

  • Previously, I worked on the backend infrastructure of Pangle, the global Ad Network of TikTok which aims to make App monetization easy and accessible to all developers globally

  • 👉 More about me

New Go Features 1.18 - 1.26

I started writing Go at GS with version 1.17, so 1.18 is roughly where “modern Go” begins for me. Since then, Go has added quite a few features that make day-to-day engineering work more pleasant. I will focus on the parts that affect normal backend/service code: concurrency, error handling, testing, collections, routing and tools. sync.WaitGroup.Go (1.25) Before Go 1.25, the common WaitGroup pattern looks like this: var wg sync.WaitGroup for _, job := range jobs { job := job wg.Add(1) go func() { defer wg.Done() process(job) }() } wg.Wait() This is not terrible, but it is easy to put Add in the wrong place or forget Done. The same boilerplate also appears in many places once a codebase has many goroutines. ...

May 26, 2026 · 9 min

Python Pitfalls: Know Them Once, Avoid Them Forever

Python is very intuitive to write but some behaviours are subtle enough that they can quietly turn into bugs if I don’t keep them in mind. Put down a summary here for the Python pitfalls that I find most practical to remember. Most of them are not really “weird” once we understand the language rule behind it, but they are exactly the kind of details that can bite in debugging. ...

March 7, 2026 · 6 min

New Python Features 3.10 - 3.14

Starting from Python 3.10 (released Oct 2021) to Python 3.14 (released last month), there are quite a few new features added to the language that made it more intuitive to use. I want to put a summary here to remind myself and always try to make full use of the modern Pythonic idioms. Starting with the one I’m most excited about: Max heap! (3.14) For a long time, Python only natively supports min heap. Users are sort of forced to play the trick to negate the value whenever we find max heap is needed for the problem. This is very error-prone in that it’s super easy to forget about the ‘-’ sign on the way in or out. ...

November 2, 2025 · 4 min

Design Patterns in Python

As a super flexible language, Python is blazing fast to build working prototypes and get the steam going. At the same time, it can also end up becoming a messy codebase and a pain to read later if being careless in the coding style. Therefore, I would always prefer to look out for idiomatic patterns to keep the Python code maintainable and easy to work with (both for me and others). ...

September 23, 2025 · 6 min

Productivity Boost in Git

From time to time, I try to review if I have made use of the tooling at hand in an effective way. Based on my experience with Git over the years, I want to put down some of my most frequently used utilities here. Making changes I started using specialised git switch command for branch operations: # switch to a new local branch git switch -c <branch-name> # switch to an existing local branch git switch <branch-name> # switch to the last branch I was at git switch - # switch to remote branch: # it auto-creates the local branch of the same name if not exist and tracks the given remote branch; all in one! git switch <remote-branch-name> The only time I still use git checkout is for file restoration: ...

July 20, 2025 · 3 min

Bits and pieces of HTTP in Go

The benefit of being a young programming language is that its design will incorporate the latest software engineering needs from the ground up. Concepts like multi-thread processing, building RESTful API become the first class citizens in Go. In fact, this is part of the motivation in designing Golang, as one of the authors commented about older programming languages in the keynote talk Go at Google: Language Design in the Service of Software Engineering ...

March 9, 2024 · 8 min

A peek into Go Generics

Since version 1.18, Go has finally introduced the support for generics, together with any as a type alias of interface{} It gives more flexibility for user to create a general collection for similar data structures. Previously we have no choice but to write up the same struct for each data type we want to support. The syntax can look a bit strange if you are already used to the old-school Go code. Or maybe it’s just because I haven’t used it often enough. ...

February 16, 2024 · 4 min

Data Structure in Go - Part 2

It is true that Go is designed with a minimalistic touch. It does not have a rich set of collections or in-built data structures like Java, where you can just import java.util.PriorityQueue or java.util.Stack and start using them. However, besides the basic map and slice, Go does come with a builtin container package that we should at least be aware and make use of it to implement things like Stack, Queue, PriorityQueue and Deque. ...

December 17, 2023 · 4 min

Data Structure in Go - Part 1

Alias type Data structures start with the fundamental data types in Go: Numbers, String, Boolean, Array, Struct, Slice, Pointer Besides the basic ones in Go, there are alias types that just provide more meaningful names for existing data types. It’s good to be aware of them so as not to get confused when you happen to see them. Alias type Underlying type Why? rune int32 represent a Unicode character byte uint8 represent one byte (8 bits) of data int int32 / int64 adjusted for the system (32 bit / 64 bit) We can also define custom alias type: ...

December 5, 2023 · 3 min

Common Go channel uses

Go is known for its native support for concurrency. You can easily spin up a concurrent execution (i.e. goroutine) using keyword go. It is similar to OS thread but managed by Go runtime scheduler instead of OS kernel. The underlying implementation actually employs an M:N model to multiplex M goroutines onto N threads. With the great power of concurrency comes with the responsibility to handle synchronisation in the right manner. ...

December 1, 2023 · 3 min