Category Archives: General

Catch-all category

General

“The Eternal Value of Privacy”

I don’t usually link-blog, but this is a good piece:

Wired News: The Eternal Value of Privacy

General

Telling a story in code

I had a discussion with a client and a colleague yesterday about commenting code. I haven’t thought about this much lately because most of the code I’ve written in the last few years is, in practice, basically never touched by anyone else. I still prefer that type of work compartmentalization, but won’t be the way it goes in this project, so I’m led to ponder my commenting style.

In a couple words, my commenting style is ‘not much’. However, this is a defensible position :-).

Part of the defense is that when I hear the word ‘comment’, I think about, specifically, little bits interspersed through the code that explain what the lines around are doing. This is different than documentation, which are the bits prefacing each function that explain what the function is for, how to use it, and caveats. Documentation, I’m down with dat.

Speaking, though, of caveats, that is one place where I make sure to add comments. If I know that, say, a section of code makes sub-optimal assumptions about its environment, I mark that fact, and use a ‘TODO: ‘ string to make sure it stands out (today’s IDEs have an automatic feature to extract and display TODOs). Or if I do something that’s nasty, I give it a ‘HACK: ‘. (I do not, however, use ‘TOXIC: ‘, because I associate that with unpleasant memories from a previous work environment. However, you don’t care to know that.)

Beyond caveats, I add comments if I do something that’s so utterly cool and astounding that it’s worth a patent, even if I’m too lazy to patent it. However, this never occurs. If I can write the code, I’m sure you can read its intent. OK, not quite ‘never’… Sometime I do have pretty novel coding ideas.

The biggest problem with comments is that they can get out of sync, since they are not automatically semantically checked against the code they apply to. So I prefer to use features that _are_ semantically checked, in some sense, by the compiler or other tools in the chain. So variable names, for example: if a variable is named ‘isRequired’ and you write ‘if (isProhibited)’, which may be a reasonable thing in your mind at the time, the compiler will tell you there is no such variable and you’ll find your mistake. Other examples are modifiers like ‘const’ and ‘abstract’, assertions, etc. So if I can find a way to express my beliefs in those modes, I do that and skip the commenting.

Thinking about this has me in a sort of mood that I want to think of my code as telling a story. Of course, I’m telling a story to the computer, but the computer is both too dumb and too precise for that same story to make sense to a human. So if I keep my human audience’s cognition in mind in parallel with the compiler’s computation, I can use the syntactic richness of the language elements to tell the story simulataneously to both audiences. The computer doesn’t care about the difference between ‘InsufficientUserIntelligenceException’ and ‘N13B’, but a fellow coder will.

General

Smack!

Y’ever want to smack yourself until you cry?

Today I spent an hour and a half trying to figure out why a web browser control I placed in a dialog was refusing to show the page I navigated it to. I won’t go into the details of the symptoms and the things I tried to fix it, but it was weird, and I tried everything.

Turns out I had somehow placed two identical copies of the control on top of each other, and I was (successfully, probably) navigating the bottom one but not the top one. Geee, eeee, eeesh.

Of course, I can’t entirely blame myself, as it was the retarded IDE that caused me to plop down two copies of the control…

General

Depths

There are such depths in the collective human imagination that the most imaginative individuals, I’m convinced, can barely imagine them. Which is yet another of the things that keeps this world boundlessly interesting…

General

Specs, waterfalls, terminal completeness

I’m working on a project in which some of the deliverables are specifications. I haven’t written many documents that would properly be termed ‘specs’ before, so I’m learning a good deal from the experience.

One thing I was just pondering is that if one works for the goal of making a ‘complete’ spec, one is assuming a waterfall model of development (Wikipedia: Waterfall model, Why people still believe in the waterfall model), which is bad. In real life, a spec is a sort of snapshot of a continuing process, which is therefore not ‘complete’ (unless your philosophical orientation says that a thing is always complete in itself by its own definition).

This does remind me, though, of one of the complaints one often sees about consultants. One way to relieve the tension between completeness and a continuous process is to construct a shiny veneer of completeness, then take the money and run before the process comes back around to show the holes in the veneer.

Of course, it’s necessary to choose some point at which to exchange artifacts for money and call it “done enough for now”, so maybe it’s all in the attitude.

General

Long-lived software

I was just pondering today that one of the more useful and stable day-to-day utilities I’ve ever used, less, I’ve been using for 15 years. That’s a long, long time in software-years. There are few other bits of software that I’ve used so much over so long. So, a salute to you, less, you old pile of bits ya, and to your author Mark Nudelman.

LESS

General

Complications

So, you ever decide to upgrade the storage on your living-room server, buy a hard drive, realize that the hard drive is SATA, which means it won’t work on your server, then figure, “hey, I have SATA on my desktop, might as well try that out”, then realize that your SATA is also RAID-0 capable so you might as well buy another drive and take advantage of that, only to find out after a couple experiments that it’s really not RAID but FakeRAID, and after you find a disk-clone utility that works with FakeRAID, you get the partitions cloned, but now GRUB won’t load due to some error that you don’t understand, so you reinstall the Windows MBR just to see that Windows will at least boot, but you can’t find the XP CD any more so you have to find some random MBR utility on the web and hope it works, but it does indeed work and Windows now boots, but of course Linux doesn’t because neither GRUB nor your installed kernel can deal with FakeRAID, and you finally get GRUB reinstalled but it still gives the error, which is number 18 which turns out to mean that GRUB can’t address your Linux partition through the BIOS, so you figure you might as well try updating the BIOS even though that seems unlikely to fix the problem, and since you don’t have a real floppy in the system and the BIOS makers haven’t graduated into the 19th century or whenever this is and they don’t make a CD-bootable flasher, you have to get the USB floppy from your laptop, make a flash floppy, make a bootable CD from the floppy, boot it only to find that you downloaded the wrong BIOS, repeat that process twice more until you do get the right BIOS, which then stuns you by actually fixing the problem, so now GRUB boots and can get you back into Windows but you still need to get dmraid installed in your initrd in your Linux kernel so you can boot that, which requires that you find a rescue CD that supports dmraid so you can even get to your Linux partition to do the initrd thing, after which you find an article that explains how to install dmraid in initrd, which thankfully works and now you finally are back to the point that everything works again, and it’s kinda cool?

I just did.

General

Data Translation

By various sorts of happenstance, I’ve had quite a bit of exposure to data/file-type translation in projects I’ve been involved in. Given that, I don’t know why it still surprises me how difficult it can be. I think what gets me is that the broad strokes always seems pretty simple (“both formats are basically just a bag of polygons, right?”), and you can even get promising results based on that naive view. Fueled by that initial success, you start charging into the deeper details, and uh-oh, suddenly there’s some ‘little’ detail that threatens to swallow the whole project.

Another factor is that you don’t want the users of your translation facility to have to think about whether some given feature carries over perfectly into the translated realm, so you go nuts trying to support every little corner case, probably many that no user will ever encounter.

General

Produced IT humor

Huh, it’s pretty cool what the Brits can do with their low-budget TV ways. Spreading the money around lets them explore farther out-there.

I’ve watched the first episode of “The IT Crowd” online, and I have to say that it was pretty darn good, with actual production values and real scripts and actors and stuff. Not world-class, but British-class for sure. Easily one of the best IT-focused bits of comedy television I’ve seen, but then, well, you know… it’s the only bit I’ve seen. The Dilbert cartoons don’t count cuz they weren’t really IT-focused.

Anyway, I can’t tell from the site whether this is an ongoing concern or whether there are just the two eppies, but in any case, hit these if you can:
The IT Crowd.

General

Field v. Google

Wow, how amazingly different. Today I read a legal document, for fun, and found it readable and informative, and it did not raise my blood pressure.

This is a pretty interesting case. It highlights some of the complexities surrounding copyright law, and comes to what I consider to be reasonable conclusions. One almost thinks that Field tried this not to win, but to lose and thereby establish some precedent for further decisions, or to at least draw some public attention to the matters.

So if it turns out that this is all an elaborate ruse by some intellectual freedom fighter, or Google itself, you read it here first. Just don’t cache it, OK?

google_nevada_order.pdf