I had another "I'm going to destroy this computer" moment while working on E3 this week (the exercise name makes me so happy - look everyone, I'm working on E3!)
After hours of working on the code without progress, I gave up and slept. One Eureka moment and eight hours earlier, I fixed the code.
The error was an early subscription. Just a tiny, tiny miniscule [0] in the wrong spot. Down falls the house of cards.
In the end, I feel like it was so obvious: my code was returning tuples, and I was supposed to compare all the tuples and then use part of the end result. Instead, I was comparing half of all the tuples and using the part as the end result. The answer was so delicately thwarted off course, like a paper boat, that it didn't even seem like a possible error at first.
I stand by my love for recursion. Brian has reminded me in a comment on a post two weeks back that passing lots of changing parameters like that can cause a lot of hidden arguments to appear, but I think part of the beauty of recursion is that it works like a human mind. Your own mind will skip steps and store only useful information - it's not going to keep every part clean and neat. Perhaps that is the advantage of a computer, but perhaps it also makes it work more like you do. Which makes it easier for you to understand.
I'm still making progress though. Breaks are lovely, and a real privilege to have - code can't always be set aside and worked on later. But to be able to stare at something, try one thing, fail, draw out exactly what you want to have done, and jingle with the parts until it works is something so ritualistic, so mystical and magical, that I truly believe it is one of the greatest, most beautiful things about human innovation and problem-solving. No matter how advanced the computer, there will always be some information that must be discovered by hand. Until the computer isn't a computer anymore - then it's just a human which computes and diagrams its plans.
The brain often seems a lot like a bunch of floating nodes: you access one piece to access another, to access another, to access another.
In fact, what makes the brain so fancy is that you can have multiple nodes in a web, like Jimmy Neutron's brain in his old TV show. This point connects to this point connects to this point.
The brain is just recursively running through its own sub-trees of information, but really really well. If I want to eat, I start at my "hungry" root and go through a whole bunch of options - when, where, for what amount of time, with whom. If I want to have fun, I start at my "bored" root and check where, for what amount of time, with whom, doing what, when, how.
And then I get a nice list back of possible suggestions based on which trees I go into: Thai food after 6 with my girlfriend; video games for an hour until class.
It's creepy, in the sense of unexpected, how much this course actually has to do with life. Or maybe just my life. Because I'm a big nerd.
No comments:
Post a Comment