Driving twit

To the person with the (omitted-but-easily-remembered vanity license plate number) I saw driving to work yesterday morning, weaving in traffic because you were reading a paperback book: Yes, I called the police, they have your plate, your car description, and your description, and good luck with that.

Words just fail me.

 

Fresh steaming news

“We gotta go do this!”

“Huh?”

“They’re frobbin’ our greepers!  They’re dissin’ our twonkles!  They haven’t shut down their illegal vapinators and any year now they could be comin’ inna our cities with new-cleerah probbadingers!”

“Uh, yeah.  Uh huh.  Why don’t you just sit down, take a deep beath and –”

“We gotta act now.  I’m pressin’ the button.  I’M SAVIN’ OUR WRENGDOGGLES!

“NO!  You can’t –”

CLICK

“There, it’s done.”

“Next, on Fox News…”

[because, my Good Lord, the stuff that crawls across cable teevee at 4am-and-you-can’t-sleep cannot hold a candle to the words emitted by the inflatable hair-doos.  “Double-acting herbal-flush spray-on toupees that cure cancer” seem almost reasonable.  Almost.]

World loading

Interesting article about the seamless continuous world-model loading system in Dungeon Siege.  Link.

(You do get “loading” screens when you’re teleporting around, IIRC, but that seems pretty reasonable to me, and they disguise it with a kind of travel metaphor).

[Upon reflection: the travel metaphor is “Waiting in an elevator.”  They throw in a lot of pretty lights and animations, but it’s hard to mask this as anything other than a magic-driven elevator, with music, even.]

 

Kindling

Apparently the Amazon Kindle book reader can’t directly read content from the SD card slot.  Instead, you have to email the content to the unit.  Costs ten cents.

Frankly, a dime isn’t that much.  On the other hand, if I were to shell out $400 for a book reader, it had better do everything but sing for its supper.

I have maybe 200 books on my cell phone (a Motorola Q), and it works fine.  It’s readable in the dark, the screen isn’t all *that* small, and the only real complaint I have is that Mobile IE doesn’t have any kind of bookmarking utility.

Reduce the price (simple parity with the Sony reader might be enough), open up the formats the unit supports, and the Kindle might be a winner.

Jackhammers Templar

The protagonist character in the game Assassin’s Creed spends a lot of time surrounded by baddies.  The setting is the medieval mid-east, around the time of the Crusades, and all the fighting is with swords, knives, arrows, kicks and bad language.  The AI is pretty neat; one of the major goals is to blend in with the surrounding people and finish your missions without attracting undue attention.  Often, if you’re spotted you can simply run away and find a place to hide until the heat is off.

Of course, things sometimes get a little pear-shaped.  When they do, all the guards that have been standing around nursing their bad attitudes wake up and suddenly you’re the center of attention.

“Keel the infidel!”

What?  Oh, that’s me.  Shhhhnick!

When happens then is quite similar something you probably see in real life once or twice a week: Rather than gang up on you wholesale and simply stomp you to bits, the gathered mob of guards mills about while one or maybe two guys come forward and attack you.  The rest just crack unhelpful jokes about your ancestry, dodging wild parries until it’s their turn to have a piece of you.  Even though you’re surrounded by maybe a dozen baddies, it’s not the overwhelming chaos of getting slammed by a hundred critters in, say, Diablo II or anything Warcraft-ish.  It’s usually doable.

Yup, it’s an AI-driven construction crew metaphor for the middle ages.  One guy has a shovel, the rest manage and drink coffee.  Some things never change.

Assassin’s Creed is a kick-ass game, by the way.  Definitely check it out.  It probably won’t make Game of the Year (because Bioshock, Mass Effect and maybe Portal will be there ahead of it), but it’s right up there, and it’s a darned good reason to buy a 360.

 

Hell is other people’s code

One of the Mikes sez, Hell is Other People’s Code.

It’s interesting watching the process of how truly horrible crap gets written…

The worst piece of code I ever saw took me by surprise and was a little poignant, because it was written by a person who I had had some respect for.

Let’s make a distinction between messy code and bad code. Messy code is the stuff you find whose formatting is random, whose style is inconsistent, and that probably uses variable names like ‘jj’ and ‘argh’ and ‘tryThis2’. You know what you’re looking at is poop. But bad code can masquerade as perfectly good code until you start digging, whereupon you fall through the clean surface and into a pit of rotten garbage and sewage where creatures with big sharp teeth and bad attitudes are not remarkably thrilled about having you drop in and tweak them around and try to fix bugs. Of course, a lot of bad code is messy, and a lot of messy code is bad, but it’s not a requirement in either direction. The critters are . . . hungry.

Anway. This person (who we’ll call SC) wrote some stuff that I liked, and I thought he had a good head on his shoulders. But when we got the latest drop of the OS from the company he worked at, all of our applications were suddenly taking at least ten seconds to start up, where before the startup time had been nearly instantaneous. Those of us lucky enough to have systems with four megabytes of RAM (yes, that was a lot in those days) had to wait well over half a minute: for each shell operation, for each invocation of ‘ls’, for each compile, each link. Fourty seconds each.

The culprit turned out to be the piece of code that zeroed an application’s unused memory when it started up. While before this had been a call to memset (which was in assembly language), it had been turned into nice, portable C, into something like:

*addr = 0;

MoveMemory(addr, addr + 2, severalMegabytes);

In other words, an overlapping memory copy that (as a hack) propagated the initial stuffed value. This was on a 68000: No cache, barely any prefetching, slow as a grandmother in pre-game traffic.
I replaced it with the code that had been there before, got our dogfood customers off my back, and (lo!) we could use our computers again. Then I gave SC a call.

“That new memory clearing code you put in the app initialization code…”

“Yeah?”

“Takes half a minute on our machines. The old stuff, a few hundred milliseconds.”

“You don’t understand what it’s doing. You see, the first argument overlaps the second, so the zero gets propagated up –”

“No, I know what the code is doing. It’s way too slow.”

“No, you don’t understand. You see that zero gets copied by the overlapping addresses, and…”

He blabbed on and on and we had an argument about how clever the new code was versus how painfully slow it had become. SC won his side of the argument, and we did, too, because they never changed that code, but we never took another drop of the OS from them, and later they went out of business in that classic, painfully slow way that marginal companies die in Silly Valley (the last step always seems to be a rented corner of a tilt-up that is shared with a motorcycle welding shop and a weird-ass industrial bakery, for some reason).
So, SC, if you’re out there and reading this, don’t feel bad. I’ve had my own circumstances where I’ve superglued my blinders on and stuck with a piece of code just because I was proud of how clever it was, and it was the wrong thing to do for the customer. I’ve definitely Been There. But this was my first inkling that it could happen to anyone, and that peers are important, and that the first real qualification for being a software engineer, after being enthusiastic and smart, is a near bottomless capacity for humility in the face of tireless machines (and users) who will prove you wrong, time after time.