"I want to break this apart and put it back together again" -- while trying to solve the Rubik's cube

Rubik's cubeThis is a weblog post about what makes a hacker, and why there are "good" hackers and "bad" hackers (which is about quality, not whitehat vs blackhat), an insight I discovered while in a brief conversation with my 10-year-old daughter.

My daughter has discovered the Rubik's cube, and has slowly gained the ability to solve one face. So she has all the basic moves figured out. But today, while working on the next conceptual step, she got to a point of frustration and said: "I want to break this apart and put it back together again." I laughed and asked why.

"So I can put it back together correctly."

I said: "That's the way a hacker thinks." I was quite happy with this observation, because for the first time I had the most concise way of understanding how hackers think. But, knowing my daughter, and that she is still learning how to do things correctly -- an important element of a good hacker -- I said:

"But you are expressly forbidden from doing that. Do not take it apart." Like me, she is apt to take things apart to figure them out, and, same as I was at her age, is not yet very good at putting them back together again. A Rubik's cube is particularly difficult to get back together, I know from experience, so I didn't want to go down that path at the moment. Maybe later. But not yet.

She scowled at me. I said, realizing what I was saying as I was speaking:

"You've got to know how to do it correctly before you hack it. That's the difference between a good hacker and a bad hacker."

And then I knew: As a principle, if you don't know how to do something correctly, and you hack a solution, it may work. But even if so, the approach will be fragile: This kind of solution may work a few times, but eventually you're going to encounter something with enough complexity that you end up creating a worse problem than the solution. And you won't know how to get out of the solution, because further hacking will make things worse.

If you never learn how to do things the correct way -- always taking shortcuts -- you will end up in some very difficult situations. This I have learned by hard experience, so I want to make sure my daughter learns it... more elegantly... with fewer painful repetitions than I learned it.

So here it is, as concise as it gets:

An important element of being an elegant hacker is to know the correct way of doing whatever you're hacking.

This is the essential difference between a hack and an elegant hack. Because the elegant hacker knows that some shortcuts are irreversibly in the wrong direction, they tend to make choices which preserve a path back to the correct way, rather than those which prevent any such return.

I've wondered about this for literally decades, ever since I first learned the concept of elegant hacking and wondered what exactly made it elegant. It's also basically the difference between a hack and a kludge, by the way.

 

Add a comment

HTML code is displayed as text and web addresses are automatically converted.

Page top