Posts

js2-mode: a new JavaScript mode for Emacs

I've written a new JavaScript editing mode for GNU Emacs, and released it on code.google.com . This is part of a larger project, in progress, to permit writing Emacs extensions in JavaScript instead of Emacs-Lisp. Lest ye judge: hey, some people swing that way. The larger project is well underway, but probably won't be out until late summer or early fall. My new editing mode is called js2-mode , because eventually I plan to support JavaScript 2, also known as ECMAScript Edition 4 . Currently, however, it only supports up through JavaScript 1.7 , so the name is something of a misnomer for now. It's almost ten thousand lines of elisp (just for the editing mode), which is more than I'd expected. So I figured I'd tell you a little about what it does, why I made certain choices, and what's coming up next. Even if you're not a JavaScript user, you might find the technical discussion mildly interesting. Features In no particular order, here's what js2-mod...

Four console games you might like...

I only play a handful of games a year, so I haven't written a game review since my post on Oblivion a year ago. But since then I've played a few unusually good games, including one awesome PS/3 title last weekend, so I figured it's time for another review. First, here's my gamer profile, so you can decide now whether reading any further is worth your time. I'm a console guy. I don't play games on a PC because I want the whole big-screen, comfy-couch immersion experience. Some of my favorite games in the past include Final Fantasy X, the Zelda franchise, the Mario franchise, Morrowind and Oblivion, Fable , Doom and Doom II (but not Quake or Unreal), and Donkey Kong 64. So there ya go. That's the kind of game I like. Adventure and RPG games, mostly, and FPS types only if they have sufficient atmosphere. Here's the memorable stuff I've played lately. Portal Everyone's been buzzing about this Xbox-360 game: they all say you've gotta play ...

Get that job at Google

I've been meaning to write up some tips on interviewing at Google for a good long time now. I keep putting it off, though, because it's going to make you mad. Probably. For some statistical definition of "you", it's very likely to upset you. Why? Because... well, here, I wrote a little ditty about it: Hey man, I don't know that stuff Stevey's talking aboooooout If my boss thinks it's important I'm gonna get fiiiiiiiiiired Oooh yeah baaaby baaaay-beeeeee.... I didn't realize this was such a typical reaction back when I first started writing about interviewing, way back at other companies. Boy-o-howdy did I find out in a hurry. See, it goes like this: Me: blah blah blah, I like asking question X in interviews, blah blah blah... You: Question X? Oh man, I haven't heard about X since college! I've never needed it for my job! He asks that in interviews ? But that means someone out there thinks it's important to know, and, and...

Portrait of a N00b

  The older I grow, the less important the comma becomes. Let the reader catch his own breath. — Elizabeth Clarkson Zwart This is how I used to comment my code, twenty years ago ( Note: dramatization ): /** * By the time we get to this point in the function, * our structure is set up properly and we've created * a buffer large enough to handle the input plus some * overflow space. I'm not sure if the overflow space * is strictly necessary, but it can't hurt. Next we * have to update the counter to account for the fact * that the caller has read a value without consuming * it. I considered putting the counter-increment on * the shoulders of the caller, but since it meant every * caller had to do it, I figured it made more sense to * just move it here. We can revisit the decision down * the road if we find some callers that need the option * of incrementing it themselves. */ counter++; // increment the consumed-value counte...