Two hard things

Two Hard Things

There are only two hard things in computer science. Cache invalidation, naming things, and off-by-one errors.

I was reminded of this quote recently, as I had a wrapper object which exposed a property with the same name as a property in the contained object, but which is slightly different. It’s actually the value contained in a different property.

Foo.Bar.Magic -> 'abcd12'
Foo.Bar.Xyzzy -> 'abcd123'
Foo.Xyzzy -> 'abcd12'

I’m sure that whoever wrote this had a very good reason for doing so, but I spent far too much time debugging a subtle error.