comex

Is this thing on?

07 Apr 2014

So this is my new blog. I've had blogs before: one full of teenage angst I still have archived somewhere, one with five useless code snippets or images over as many years, and one repository on GitHub called "bloggy" with another code snippet. But I want to be a teeny bit more serious; mainly to practice writing, but also because there are some things I find interesting and would like to talk about, I want to come up with actual blog-length pieces of text on technical subjects.

However, I also intend to post (arbitrarily) short pieces of text which I do not feel like fully developing, but which are longer than a tweet, or don't fit neatly into a Hacker News or Reddit discussion. For tonight, I'll start with one of those.


It's not exactly for the faint of heart, to be clear. Bird's idea is that we can establish certain mathematical rules which allow us to transform "the simplest thing which could possibly be correct" to an efficient program through a series of steps, each one maintaining correctness as an invariant.

https://news.ycombinator.com/item?id=7537997

An interesting thing about this wording is that it still makes sense if you flip it around:

We can establish certain principles which allow us to transform "the simplest thing which could possibly do the job" to a complete program through a series of steps, each one maintaining performance as an invariant.

Of course, that completely misses the point of the original sentence to take a mathematical approach to evolving programs. But although I hadn't thought about it quite as such, this sounds like a reasonable approach to developing programs with performance as a priority. Start with the core algorithms, make them work, and make them fast, because optimization often involves heavy refactoring which is hard to do in large programs. Then add the rest of the functionality, with the ability to measure how much performance impact each step had rather than only getting numbers at the end.

I'd say it resembles the way I've done it, but most of the time I seem to end up with the core done and too bored to do any of the rest, so my experience should be taken with quite a bit of salt... still.

Incidentally, I've bought an e-book of the textbook in question and intend to read it soon.