« Back

Doing Things the Hard Way

These last few days, when presented with programming challenges, I’ve decided to try to solve it the way that seems: less obvious, more elegant, to possess hidden features, to be more extensible.

If I write an AST for our grammar homework, I’m going to do it in as few lines, as generically, as possible. If I am searching an image for bounding boxes, I’m going to try something different from the linear search I know how to write.

This seems stupid at first:

but holding on seems to result in more and more feelings of this:

because I learn weird stuff (there are data structures called heaps) and they are pretty fab in terms of search efficiency.)

So until I am in a job or a rush, I am going to start doing more things the hard way.

A Corollary
The stupid way to do things the hard way, though, is to hide from all hints — something I find myself doing when I want to feel like I am “smart enough” to figure it all out from first principles. This is a bad plan. I am smart enough to build on what other people know.