Archive for April, 2007

The Web is My Computer To Go

Tuesday, April 24th, 2007

The other day my friend bought her first Mac. She was clearly excited but also clearly a little worried. This, she knew, was going to be a really big change. Or was it?

It occured to me while thinking about what this experience must be like for her, a smart but not technically experienced individual, that in fact a lot of what would be easy on the Mac would be the Web. Why? Because the Web is everywhere and, increasingly, every thing. The Web is the interface most people think about these days when they think about using computers.

Just take a look around. Almost everything you can do on a standard desktop application you can do on web pages these days. Instant Messaging was one of the first applications I can think of (off the top of my head) that was taken to the Web with AOL Instant Messenger’s AIM Express. Yahoo! quickly followed. I remember the days when hanging around in Yahoo Clubs Chat Rooms (now Yahoo Groups, and no longer involved with the Chat Rooms feature) used to be all the rage. I played a ton of Go and Battleship back then.

These days, more and more information is being put online and is becoming easier (and more consistent) to access. Twitter is all the rage, I do all my banking online (over verified HTTPS connections, of course), and Google has integrated GoogleTalk right into the GMail window. In fact, most of my friends never close their GMail window anymore. The browser is the new IM client.

Of course, there’s a fascinating paradox that’s worth examining in all of this. Simultaneously, the Web provides a consistent interface to my stuff (like email or banking information) and yet all of my information is consistently displayed differently. The Web is my computer—to go.

So if the Web is my computer on a take-out menu, the web browser is more and more like its own little computer inside the bigger one. Indeed, AJAX has proven itself in an ever increasing number of applications, and intelligent JavaScript is finally getting the attention it deserves. If you’ll forgive the exceptionally Mac-centric analogy, JavaScript is to the Web as AppleScript is to the Mac. Case in point, here’s a JavaScript bookmarklet that will give you a “full screen” button in any compliant Web browser:

javascript:self.moveTo(0,0);self.resizeTo(screen.availwidth,screen.availHeight);

This illustrates the point that the Web browser is becoming an ever more complex platform in its own right. People have already taken this concept further and more than a dozen Web Operating Systems are already in development. When these mature, computing, for many people, will have finally come full circle and returned to the days of dumb terminals.

By the way, my friend’s doing quite well with her Mac today. She’s even using Safari instead of Firefox these days.

Making code maintainable: mind your edit-per-change ratio

Friday, April 13th, 2007

One of the most fundamental problems when dealing with the world on any level, whether your issue is technological, physical, or conceptual, is handling change. People are fond of saying that the only constant in the world is that things will change. That’s certainly true, but that nugget of wisdom doesn’t actually tell us what to do about all these inevitable changes.

In some industries, such as construction (for example), people are very careful about what they do because they know how hard it will be to change something after the fact. In the digital workplace, however, people don’t seem to think as much about this sort of thing because it’s relatively easy to change things. After all, everyone’s dealing in bits and bytes at a fundamental level. However, if you take a higher-level look, you’ll see that many times things are not as easy to change correctly as you might think, and the costs associated with these mistakes and after-the-fact edits can be enormous.

Take a web site, for instance. (I bet you saw that coming.) After a web site is launched (and even before, sometimes), changes have to go back and forth between designers and coders, production and design, and back again. Many times so-called final versions are just the next revision and not actually set in stone, no matter what anyone says. For a web developer, all these changes can be really troublesome, however they also provide an opportunity for rapid, iterative improvement of your (X)HTML and CSS code.

In a recent project I worked on, I found myself faced with the challenge of positioning two columns of data that each had a different number of elements inside of them but that ultimately had to be the exact same total height. My production manager, who fell in love with floated layouts a long time ago, wanted to position the page using one column floated left and the other floated right, with their dimensions fixed so as to give them both room to fit inside their parent. This seemed perfectly logical to me, so I implemented it that way.

As the project moved forward, however, I realized that in our design changes to this kind of floated layout would require a minimum of editing two files. First, we’d need to edit the HTML source of our page to change the order of the content boxes inside the floated columns, and second we’d need to change the dimensions of the elements in our style sheets. Instead, reimplementing the design with absolute positioning would require edits to only one source file, the style sheet itself, where both the position and the element dimensions could be specified in a single CSS declaration.

With all the frequent changes the design department was making, this argument ultimately won everyone over, and the site uses absolute positioning for the design. The key concept to take away from this experience is that part of making things easy in the future is to design with change in mind, to be as flexible as possible from the get-go, but also to think about the actual implementations in such a way as to lower your edit-per-change ratio as much as possible. The fewer things you have to change, the easier it will be to change things moving forward.

Smart people think of computers as tools

Monday, April 9th, 2007

I’ve recently encountered several situations in which the idea of computers being tools has come forefront to my mind. Now, of course, computers are always tools and they’re always seen as a tool by their users, but very few people actually know how to use them very well. It’s like using a screwdriver. Everyone knows that a screwdriver is a tool, but there actually is a certain amount of skill required to use it properly. If you don’t have that skill, you’ll just end up stripping the screw and making it useless—or worse, actually damaging something.

Despite what most people think, computers are the same exact way. “But, computers are so much more complex than screwdrivers,” most people are probably saying. Well, yes, that’s true. Computers are a very different kind of tool that operates on a very different kind of thing. But it’s still a tool and ultimately, it’s principles are exactly the same as turn left to loosen, turn right to tighten.

A great example of this sort of thinking happened today, when my friend asked me if there’s any software he could buy or otherwise obtain that would log people’s IP addresses. Setting aside my curiosity as to why he would want to do this, I told him about the built-in firewall logging that every modern operating system has these days, and I showed him how to enable it on his Windows XP system. (For those interested, to enable firewall logging in Windows XP SP2, go to Control Panels → Windows Firewall → Advanced → Security Logging Settings → Log dropped packets, Log successful connections.)

Next, he asked me if there’s any way to block his computer from ever making a connection with specific addresses. Now I was really curious, but nevertheless told him how to utilize the hosts file to maintain a list of IP addresses to block (by assigning the entries to localhost or 127.0.0.1). Perfect, my friend told me, he now had the solution he needed. (You can check out your hosts file, too. Wikipedia keeps a list of default locations of this file for most operating systems.)

What the heck was he doing, anyway? Turns out he was playing a peer-to-peer online multiplayer game and he wanted to ensure that certain unfriendly players would never be able to interact with him in-game. By collecting their IP addresses by logging them with his built-in firewall and then blocking them with his hosts file, he could ensure he never played with these people.

What’s impressive to me about this situation is that my friend was thinking about his computer as a tool. He asked the perfect questions to get the result he wanted and he understood that the computer could manipulated. This is the kind of creative thinking that differentiates people. This is how you get ahead. This is also how you get better.