Wyatt is an Intern: Part 2

I am one month into my internship, and I’ve realized that I’m enjoying it.

Alright, I’ve known all along that I’m enjoying this. But it feels like a qualified decision now. This isn’t the awe of new things like, “wow I enjoy working”, or “ooh pretty city”, it’s a genuine appreciation of having a good thing going on.

I work on Webkit. That’s pretty cool. If you already know all about how webkit works, you can go find out what stuff I’ve patched by looking around in the bugzilla. If you don’t know how that stuff works, then I don’t expect you to care – it’s not very important anyway. I’ve only done test conversions so far, and a few other small things. I’m taking some bigger steps now, as I try to make a few actual code changes in the editing section – a cool 33 thousand lines of code among 60 files. Ramping up to speed on that is what this post is about.

My approach to this is holistic, which might be stupid of me. My fundamental assumption is that the better a programmer understands the system they are working within, the better a job they are able to do. I suppose that for an ideally modular system in a perfect world that might not hold, but I think it does here. I invite debate on the topic, but ask that you bring a) evidence which suggests I am wrong or b) viable alternatives to what I’ve said. If we simply disagree, we won’t be productive 😛

So, the “holistic approach”. I’ll define that as something akin to top-down, or biggest items first. Within the editing code, there’s a class ‘Editor’. It’s a pretty sizeable class – between its headers and implementation, it’s 3-4 thousand lines long. There’s a lot of other smaller classes, too. What my approach means is that I’ll read Editor’s high level definitions, then all of its methods, and as I find things which I don’t understand, branch into them and do similar. This search is a sort of optimised depth-first — only when something seems vital, common, and confusing will I break my task and go investigate it.

In this way, you can get a large chunk of understanding in a go. I spent 10 hours or so at the end of last week reading Editor.h/Editor.cpp and branching into some other important seeming code like Page, Frame, Node, EditorClient, and others. It seems to have gone pretty well. What seemed at first like a very confusing and scary bunch of code is now beginning to fit to a mental model: the Editor has a Page and a Frame and manipulates Nodes, and has all of the “policy information” about editing actions. The editing itself is done by the EditorClient, which is implemented separately by each of the different platforms that have ported Webkit. This large-scale picture makes the task feel much less daunting. I’ll draw an analogy.

Imagine you have a large puzzle with small pieces. The biggest clue for solving it is lookng at the picture on the box. With that frame of reference, you can identify the large objects you have to work with. That’s the first step in the recursion: you broke 1 big problem down into a group of smaller problems. Now the work is to treat each of these smaller problems in the same way: find a key feature or element, and identify subelements in relation to one another. Eventually, you’ll be working at the granularity of single puzzle pieces. Stepping back to code — you’ll eventually reach the granularity of single lines.

I’d like to hear people’s strategies for understanding large, complex, and at times roughly defined systems. I’m very interested in education, and at a certain level of abstraction, I think that all attempts to learn things are attempts to construct mental models which help us navigate complex systems. So I implore you – share your insights 🙂

The robots *want* to be like us.

X11R5 is a markov chain bot, and Dumont is (to my knowledge) a stock infobot.

04:31 < X11R5> Someday maybe i’ll come back speaking more intelligently.
04:31 < fuzzie> Unlikely.
04:31 * Dumont flips through the manual, looking puzzled.
05:01 < X11R5> Well it seems like the kind of pie? I was under the previous opengl 3 but later disappeared from his note, but it looks like i said, zombie apocalypse.
05:31 < X11R5> Ahh, software development.

Automatons

the longer I live, the more I want to automate
the more I realize the shell is all I need

I mean, I just spent 15-20 minutes optimizing some stuff I do every day about a hundred times in windows only to realize that most of it would have been easier to do if I were just running a unix-based system. Without a GUI. :/

but I love to play videogames with good driverssssssss

McDonalds, you diabolical

Working all night at school sucks, because you’re far away from home and you inevitably run out of snacks. And you get lonely! Sitting in a dark lab hacking all night feels great sometimes, but it can totally be a drain to be in a cave.

Working all night at home means there’s plenty of snacks around and you’re comfortable – there’s housemates, too! But there’s one showstopping bug in this solution: bed. It is so, so easy to wander over to that comfy, warm bed and nap. And naps when you’re tired and it’s 4-5 AM turn into sleeps. Often, they turn into missed stuff you were supposed to do.

If only there were some compromise… For me, as of very recently, there is. It’s a place I never liked when I was a kid; a place designed to trigger impulses and grow fat on people. Billions and billions have ‘been served’ by it. Yes, my local McDonalds restaurant is what I’m talking about. They’ve just moved to 24 hour service. Let’s break this down.

Cheap tasty-but-not-healthy food (unlimited free coke refills.)
A slow trickle of people all night long
background music and noises and things
Washrooms
Power outlet
free wifi
2 blocks from home

This is literally the sweet spot. I want to zoom in on the ‘2 blocks from home’ bit for a second. It’s probably the most magical part of this. You see, school is awful in large part because it’s a 30ish minute walk from my house. At 4AM when I decide I’m done, and I just need sleep, there’s this awful choice between waiting for buses, walking the whole way home, or sleeping at school (not fun any more.)

At home, if I hit a good momentary stopping point and lean back onto my bed, I wake up in the mid-afternoon. The 2 block distance is about 5 minutes’ walk. It’s not terrifying, but I wouldn’t pop back home without some serious thought.

And around 6AM, they switch over to the breakfast menu and I get to have hash browns.

I’m lovin’ it. Also, I’m really tired. 🙂

(it would be really cool if mcdonalds paid me for writing this or something. In hash browns.)

Reminder: Tau Day

Given the present date, I feel it’s the perfect time to remind everyone that, yes, while Pi is a wonderful thing and an interesting curiosity to be thought upon, perhaps there’s an even better way. Since reading the Tau manifesto a year or two ago, I’ve come to be quite convinced that it’s just .. well, right. It’s a deep down feeling – so I’m going to link anyone that happens across this and ask that if you are willing to do me a favour today, make that favour be to read this fantastic bit of mathemeaningful sensism: The Tau Manifesto.

Right all the way ’round.

Sudden thought: I know very little about the historical stuff about Pi. I should pick up the Princeton Companion to Mathematics sometime and scan across it; I bet it’s interesting. Maybe there’s something in there that explains why Tau isn’t such a good idea after all.