When to Optimize
The First Rule of Program Optimization:
Don’t do it.The Second Rule of Program Optimization (for experts only!):
Don’t do it yet.— Michael Jackson
The First Rule of Program Optimization:
Don’t do it.The Second Rule of Program Optimization (for experts only!):
Don’t do it yet.— Michael Jackson
Over at the Bad Astronomy weblog,
Blake Stacey
wrote the following,
which is reproduced here with permission:
Come on, we’re scientists, right? How about we break out the mathematics. Just for kicks, I’m gonna model Coulter as a Bernoulli process!
(I didn’t write this. To the best of my knowledge, it’s by a guy who posts as astronomer on invisionfree.com’s Creation Vs. Evolution board. I just reformatted and tweaked it a bit):
(For those who don’t know, the
Drake equation
is an estimate of the number of extraterrestrial civilizations out there with which we can communicate.
N* * fs * fp * ne * fi * fc * fl = N
Where:
N* = number of stars
fs = fraction of sun-like stars
fp = fraction of stars with planets
ne = number of planets in habitable zone
fi = fraction of habitable zones where life does arise
fc = fraction of planets inhabited by intelligent beings
fl = percentage of the lifetime of a planet that is marked by presence of a communicative civilization
NG
Where:
NG = Number of places chosen by God.
A lot has been written about how to design a good user interface, but very little about how to design a good programming interface (API: Application Program Interface, or a library). This is somewhat surprising, since an API is nothing more than an UI for programmers, and programmers are normally good at writing tools for each other.
(Or: Life Imitates Logic Puzzle)
Lately, to measure out water for coffee, I’ve been filling whichever mug I intend to drink from, and pouring it into the coffee maker. That way, I know there’s the right amount.
This morning, I was making coffee for the drive in to work, and noticed that I had poured coffee from a regular mug, rather than the larger travel mug I was going to use. I wasn’t going to upend the coffee maker over the sink to empty the water and start over. I could have just estimated how much more water I needed to add, but came up with a cleverer solution, below the flip.
I got stuck debugging someone else’s Perl code today, and it was chock-full of the sorts of things that annoy the piss out of those of us who know better.
I don’t know many people who have a favorite supernova, but I do:
SN1987A.
Its light first reached Earth 19 years and a day ago (sorry, I meant to write this entry yesterday, but was too busy), on Feb. 23, 1987.
I’ve started learning this
thing. which allows you to do cool things like
Google Maps
and the
U Wisconsin directory search.
One thing I’ve always liked about books is the way typesetters sometimes render the first letter differently from the others, usually several times larger, and with the paragraph flowing around it. Sometimes, the first line or the first few words of the first paragraph are also rendered in small caps. I’ve finally figured out how to do this with CSS:
Will Bunch at Attytood has an
article
about the attitude that some in the mainstream media have toward weblogs. Basically, that Real Reporters™ are trained in Real Journalism™ and do things like check facts with multiple independent sources, whereas bloggers are just average bozos who use the Internet to spread rumors and discuss Desperate Housewives.
Where have I seen this attitude before? Oh, that’s right: when Open Source Software started seriously gaining acceptance.