Archives

All of the things labelled as Posts, so that crawlers have a place to find them.

The hard part of error handling is not the error itself

Are our discussions about errors focusing on the right part of the problem? We tend to argue about what exceptions mean, or how return values

Why don’t we have runtime virtual dispatching?

Virtual functions are a great feature, but they have a rather severe limitation. They can only be implemented by extending the definition of all classes

Everything can and will go wrong: all functions fail

In a dreamy programming utopia, functions behave correctly and nothing unexpected ever happens. In technical reality however even the most mundane of actions can suffer

The exceptional myth of non-local flow

“Exceptions are bad because they introduce non-local flow into a program.” It’s an argument I’ve seen often and it even came up in the comments

Messy error handling in Rust with try!

I just read the documentation for std::result in Rust. A friend had pointed it out and said it left a sour taste in his mouth,

Adding the first type expression to Leaf: type_infer

I’ve added the ability to type a variable based on an expression. The type_infer type operator resolves to the type of the provided expression —

Defects allowed by imprecise access modifiers

I recently fixed a defect that I felt the compiler could have caught. Some initialization code was not being run as I was calling a

Robot journalist predicts programmers will be obsoleted

Am I, as a programmer, in danger of being obsoleted by a program of my own creation? A recent BBC article gives programmers an 8%

The curse of varargs

Unexpectedly I needed to add support for variable argument functions to Leaf long before I intended to. I just wanted to print out a value,

Reusing existing test suites for new features

Redundancy is one of the biggest sources of problems on any project, especially in tests. Having an unmaintainable test suite is in nobody’s interest. Eliminating

Calculating square root using Newton’s iterative method

I suddenly had a desire to calculate square roots. It’s been one of those things that just sits at the back of my mind lingering.

A real cost of low performing applications

The platform as a service model adds new importance to the performance of our software. Despite ever decreasing hardware costs, metered services make every bit

You can’t trade privacy for security

The idea that one can give up privacy in exchange for security is misguided and dangerous. It’s a cliché peddled by politicians who either just

Essential facts about floating point calculations

Floating point numbers are everywhere. It’s hard to find software that doesn’t use any. For something so essential to writing software you’d think we take

Be a good mentor, not a dickhead

I’ve worked with a lot of people of varying skill levels, from superstar programmers to not-sure-how-they-got-the-job types. Integrating and working with new people is always

Antialiasing with a signed distance field

When drawing basic primitives we want nice smooth edges. This means both pixel correctness and antialiasing. In my previous article about drawing a rectangle I

Get rid of those boolean function parameters

I need to make a quick variation of a function. The calculation, or behaviour, differs slightly on the needs of the caller. I throw in

Combining several GL draw calls into one: a rounded rectangle

My previous article explains how I draw a rounded rectangle using a shader instead of tesselation. The biggest remaining issue is using eight calls to

Quickly drawing a rounded rectangle with a GL shader

Rectangles appear everywhere in user interfaces, from the backgrounds of elements to rounded border decorations. It’s helpful to be able to draw these fast. I

Where the wild code grows

Sometimes I just like to sit back and code something. Free from deadlines. Free from requirements. Free from issue systems and planning teams. It’s so

Blocking and asynchronous operations without timeout are broken

Any time we are waiting for something to happen, from reading the disk to locking a mutex, we need to have a timeout. Without a

Debugging by binary searching through code revisions

What do you do when all normal debugging means fail? You can reproduce a bug, but the debugger just doesn’t seem to pinpoint it. Print