The Wager
2008-08-25 | Filed Under Uncategorized
You are really lazy. It’s nothing personal of course — everyone tends to procrastinate to some extent, but right now it’s YOUR turn. In just a moment, I am going to convince you that you want to do something. You’ll agree that it’s a good idea, you’ll tell yourself that you are going to do it, but I’m betting that you are so lazy that in the end you won’t do it. [More...]
Post Links
Permalink | Trackback | 3 Comments
Metaphorical Programming
2008-07-28 | Filed Under Programming
Unlike computers, humans tend to think in metaphors. That is, when we want to reason about something new or unfamiliar we reason by analogy with something familiar. This is a great mental trick and it is part of what allows humans to be flexible and to deal with unanticipated circumstances (exactly the kind of thing that computers cannot do), but there is a danger as well: where the analogy chosen is not a close match, our thinking can be led astray. One place where these analogies are often poor is in thinking about the process of programming. [More...]
Post Links
Permalink | Trackback | Leave a Comment
Go Easy on the Maintenance Programmer
2008-07-18 | Filed Under Programming
“Maintenance Programmer“: This common, and underappreciated species of programmer is often heard muttering and cursing under their breath. Sometimes bald from tearing their hair out in frustration.
From time to time we all have to do it: simple changes and maintenance to code - often other people’s code. And the truth is that most code spends far more time in maintenance mode than it did in design, coding, or initial debugging. Yet maintenance programming is notoriously difficult (even if it does tend to get assigned to the most junior developers on a team). I will identify the main reason I think maintenance is difficult, and suggest one specific programming practices that can make your code easier to maintain. [More...]
Post Links
Permalink | Trackback | 12 Comments
A random selection algorithm
2008-06-27 | Filed Under Math, Programming
Suppose you want to select k things randomly from a list of n items, with no duplicates. [More...]
Two more uses for a Secure Hash
2008-06-12 | Filed Under Programming
In a previous article I talked about using salt with a secure hash, but all of the examples assumed that the secure hash would be used to validate passwords. Secure hashes can be used for many other purposes, and I’ll illustrate that by describing two other possible uses. [More...]
Post Links
Permalink | Trackback | Leave a Comment
Why User Stories?
2008-05-12 | Filed Under Programming
Any software project needs a Business Requirements Document (BRD)—a document which describes what the deliverable is supposed to do once it’s been built. The traditional (waterfall) way is to write it in paragraph form, but several agile development techniques recommend writing it in the form of a collection of “User Stories”. [More...]
Post Links
Permalink | Trackback | Leave a Comment
Always use Salt
2008-05-05 | Filed Under Programming
I’m not a very good cook. One reasons is that I’ve never mastered the art of tasting the food as I go along and seasoning it properly. When cooking, I never seem to add the right amount of salt. As a programmer, though, I always use salt. [More...]
The Butterfly Bug
2008-04-17 | Filed Under Math
Edward Lorenz died this past Thursday at age 90. This is as good an excuse as I will ever have to recount the story of his discovery (which I first learned from the book Chaos by James Gleick). It is a tale of math and the proper use of computers. [More...]
How to email blog posts from Outlook
2008-04-02 | Filed Under Uncategorized
Suppose (just for the sake of discussion) you wanted to share some blog postings with a group of people at work - and the company email system uses Outlook 2003. Sending HTML email with the blog posting seems like it would be a nice way to do it. But getting Outlook to send properly-crafted HTML emails is surprisingly difficult [More...]
Post Links
Permalink | Trackback | 4 Comments
Units of Work
2008-03-30 | Filed Under Programming
When I was a physics student one of the things that I learned to do was “unit analysis”. That’s where you simply consider what units an answer has: is it in meters, or meters squared? Surprisingly, there is an enormous amount that can be learned just by doing unit analysis. Recently, I applied unit analysis our scrum backlog (the process by which my company chooses what tasks to work on) and I learned something surprising. [More...]
Post Links
Permalink | Trackback | 5 Comments