Wednesday, September 26, 2012

On exceptions

I've been reading some blog posts on exceptions recently. The one I hadn't seen before, and the one that makes a lot of sense to me is:

Cleaner, more elegant, and harder to recognize

The argument put forward is that yes, using exceptions does make for cleaner code, but

  1. It's easier to write bad code that uses exceptions
  2. It's harder to recognize good code from bad code when using exceptions
The D language has an interesting scope guard statement. Not having played with this, I don't know what the ramifications are in practice. I haven't used this in C++. I wonder how ugly the code gets?

Monday, September 10, 2012

Disks lie

Disks lie. And the controllers that run them are partners in crime. | Hacker News:
The behavior of hard drives is like decaying atoms. You can't make accurate predictions about what any one of them will do. Only in aggregate can you say something like "the half life of this pile of hardware is 12 years" or "if we write this data N times we can reasonably expect to read it it again."