Tag Archives: Fun

Representative Line: The Truth About Comparisons

We often point to dates as one of the example data types which is so complicated that most developers can’t understand them. This is unfair, as pretty much every data type has weird quirks and edge cases which make for unexpected behaviors. Floating point rounding, integer overflows and underflows, various types of string representation… But file-not-founds excepted, people have

Read more

Error’d: Placeholders-a-Plenty

"On my admittedly old and cheap phone, Google Maps seems to have confused the definition of the word ‘trip’," writes Ivan.   "When you’re Gas Networks Ireland, and don’t have anything nice to say, I guess you just say lorem ipsum," wrote Gabe.   Daniel D. writes, "Google may not know how I got 100 GB, but they seem pretty

Read more

CodeSOD: A Problematic Place

In programming, sometimes the ordering of your data matters. And sometimes the ordering doesn’t matter and it can be completely random. And sometimes… well, El Dorko found a case where it apparently matters that it doesn’t matter: DirectoryInfo di = new DirectoryInfo(directory); FileInfo[] files = di.GetFiles(); DirectoryInfo[] subdirs = di.GetDirectories(); // shuffle subdirs to avoid problematic places Random rnd

Read more

The Proprietary Format

Have you ever secured something with a lock? The intent is that at some point in the future, you’ll use the requisite key to regain access to it. Of course, the underlying assumption is that you actually have the key. How do you open a lock once you’ve lost the key? That’s when you need to get creative. Lock

Read more

CodeSOD: Breaking Changes

We talk a lot about the sort of wheels one shouldn’t reinvent. Loads of bad code stumbles down that path. Today, Mary sends us some code from their home-grown unit testing framework. Mary doesn’t have much to say about whatever case of Not Invented Here Syndrome brought things to this point. It’s especially notable that this is Python, which

Read more

CodeSOD: All the Things!

Yasmin needed to fetch some data from a database for a report. Specifically, she needed to get all the order data. All of it. No matter how much there was. The required query might be long running, but it wouldn’t be complicated. By policy, every query needed to be implemented as a stored procedure. Yasmin, being a smart prograammer,

Read more
« Older Entries