Software Pitfalls
Can't I Just Count Requests? The Hidden Pitfalls of Rate Limiting and Throttling
“I need to limit users to 100 requests per minute. I’ll just stick a counter in a dictionary and reset it when the minute changes.” If you’ve ever protected an API endpoint, that thought has probably crossed your mind. On a whiteboard, rate limiting looks like five lines of …
A Cache Is Just a Dictionary, Right? Implementing LRU Caching from Scratch
“Why would you need a dedicated caching library? A cache is just a dictionary.” It is very easy to think that way about what, on the surface, looks like a subclass of a dictionary. When you notice a slow database query or a CPU-intensive calculation, reaching for an in-memory dictionary …
What's a URL? Please Provide Your Email Address! The Complexity of Parsing Structured Identifiers
“Please enter a valid email address.” “Please provide a valid website URL.” If you build web applications, APIs, or user interfaces, you have almost certainly written or reviewed code that displays those two demands. Because every user recognises an email address and …
Syncing Shared Data: The Hidden Traps of Concurrent Mutations and Deletions
When you build an application that displays a collection of items, synchronisation feels deceptively straightforward at first. Your client fetches the current list from an API, your user makes a few edits or removes a row, and you send the updated collection back to the server. If you only test …
Parsing CSV and Delimited Files: The Deceptive Traps of Tabular Text
Every software engineer has, at some point, written a CSV parser in a single line of code. When you receive a comma-separated file, calling line.strip().split(",") feels delightfully clean and efficient. You run a quick test on three rows of mock data, confirm the output matches your …
Parsing and Formatting Numbers: Why Commas and Dots Break Software
At first glance, numbers appear to be the simplest data type in computer science. Unlike natural languages with irregular grammar and complex idioms, numbers feel purely mathematical, universal, and unambiguous. You collect a string of digits from an input field, pass it to your language’s …
Handling Currency Calculations: Why Floats Break Financial Software
When building an application, you inevitably reach a screen where money enters the picture. You need to calculate a 20% VAT rate, split an invoice between team members, or apply a discount code at checkout. You see a price like £19.99 with two neat decimal digits and assume a standard …
Never Roll Your Own Date Maths: The Deceptive Complexity of Time
At some point in every developer’s career, a tempting thought arrives. You need to add seven days to an appointment, schedule a task for tomorrow morning, or calculate the duration between two events. You glance at your standard library, see a hefty date module, and think: “A day is …







