Metaphors in computer science

Thanks to Slashdot I came across the transcription of a very interesting lecture given by Edsgar Dijkstra, one of the most important computer scientists before the age of the personal computer. The lecture is interesting and a worthwhile read for anyone into computers, especially computer science education. Though there are some parts that I don’t quite agree with, one thing that struck be as being every important is the Dijkstra’s realization that computer science comes with a vast array of metaphors to help beginners and experts alike think about what it is that they are doing. Dijkstra claims that these metaphors are misguided and are very damaging to the profession.

That may very well be the case, certainly some metaphors are questionable at best. But what’s of greater concern in my opinion is that most programmers I know don’t bother to really understand the metaphors and dig under the surface of the explanations that instructors present them with. It’s fine to use a metaphor to help you think (even if that metaphor is inaccurate) as long as you know what the metaphor means, where it comes from, and how things work without the metaphor to give a simplifying abstraction.

Metaphors are just that: abstractions. They let you think about things at a higher level without being bogged down by what the actual details are. However metaphors can be problematic because they describe something unfamiliar in terms of something familiar that may actually be very different. Problems start to spring up when you expect the unfamiliar object to behave like the familiar one. Abstractions in computer science (functions, objects, interfaces etc) can be safe because you can define precisely what the abstraction’s properties are. But unless a metaphor is very carefully crafted it can easily become a leaky abstraction: one where the boundaries are undefined and weird things can happen as you approach the edges.

Take for example the desktop metaphor. It’s useful because the way windows are placed on a screen can be thought of as similar to placing papers on a desk. Files and folders also fall in rather conveniently with this idea. But what about applications? What is an application icon supposed to mean? How do you explain dragging a file onto an application’s icon to open it? This isn’t to say the desktop metaphor is bad, it’s just that it can be confusing if you interpret it literally. Some other common metaphors are:

  • A variable is a box
  • Porsche is a class and your car is an object
  • A compiler is a translator

Each of these has it’s pros and cons and some are better than others. I’ll be looking at some of these metaphors in future posts and seeing if there are ways in which they can be improved.

Advertisements

How to consolidate your online presence

In the last post I looked at what an online presence and why it’s important. Your online presence is a two-way street, it’s what others see of you and how you interact on the web. Here are some tips to get your online presence under control.

Google Scrubbing

Google is quickly becoming the world’s homepage. If anyone who doesn’t know you wants to look for you, then chances are the first thing they will do is type your name into Google’s search box. So the question is, what are they going to see? Hopefully you’ve been smart enough not to leak your personal life onto the internet. But even if everything that a Google search reveals are things you wouldn’t mind people seeing, they might be very random and chances are they won’t give the full picture about you. So it’s up to you to make sure that Google does present the real you. How do you go about it? Well, that’s what the next section is about

Get a domain name

Domain names can be had for under $10 a year and there are lots of free hosting options. Having a domain name lets you carve out a part of the Internet and brand it with your own signature style. Trying to get a meaningful domain name that you can keep around for a long time and which you won’t mind telling lots of other people about.

Once you have a domain name, put it to use by building a good website around it. Put up normal things like a resume, but also put up PDFs of articles or papers you’ve written and link to your other work online. If you write blogs (one or many) consider turning them into subdomains of your website. This way there is a central location for your work on the web. Unless of course, you specifically want your blogging life to remain separate.

Consolidate your email

Another great reason to get a domain name is so that you can have email addresses attached to it. Having an email address attached to a domain name means that you don’t have to change it whenever you change jobs or schools and it looks more professional than a free email address. I would recommend having multiple email addresses for each domainL one for business, one for friends and family, one for mailing lists, one for free subscriptions etc. This way if you start getting spammed you can find out where it’s coming from and take measures.

Of course having a separate inbox for each email address would be very unproductive. I strongly recommend using the free Google Apps for your Domain and then using the Gmail app to alias multiple addresses to the same inbox. Then you set up filters to appropriately label, hide or delete emails sent to the various emails. Look at the first chapter of Upgrade Your Life for more useful email tricks.

Get your nicknames under control

Chances are you have multiple nicknames for different forums, IRC and IM. It might be a good idea to stick to a uniform set of nicknames so that people can find you. However, depending on whether or not you want to actually want to be known or if the nicknames are available, this might not be an option.

If you have any advice on how to get your online life under control, please drop me a note in the comments.

Why your online presence is important

This November marks 7 years of active Internet usage for me. Considering that the Internet arose in the 1980’s I’ll admit I was a good few years late on the spot. That being said, I’m happy to note that I was just in time to see the internet rise to the status of core infrastructure in our society that it has now. That, combined with the Web 2.0 movement makes the internet a very interesting place to be. In recent years the Internet has become an increasingly democratic medium, with anyone with a stable Internet having the capability to become not just the consumer, but also the creator of a variety of information.

It has only been over the past year or two that I’ve really started to take advantage of this inherently two-way aspect of the Internet. Having a online presence can be very useful nowadays and I would argue that it won’t be too long before having a website (or an ePortfolio) becomes as useful as a resume (and for some professions, even more useful). Being a computer scientist/engineer and part time web-designer, having an online presence is something I feel to be very important.

What is an online presence?

So what exactly is this online presence I talk about? Everything that you put out on the Internet is a part of your online presence. Email, IMs, IRC conversations, blog posts and comments, social network activity, all of it taken together goes to defining the unique ‘you’ online. For some people, like my parents, this presence is tiny, limited mostly to email and some IM conversations. But for most younger people (including myself) there’s going to be a whole slew of important and often unrelated information out there that represents your online identity. It’s important to know where your personal information is and what it represents. Much of the web is searchable and as the years go by even more different forms of information are being indexed and made available at a moment’s notice to anyone who wants them. Just as you wouldn’t leave your wallet or personal banking information lying out on the street, it’s a good idea to keep track of where and why you’re sending your information.

Here’s a little experiment: Type your full name into Google and see what the results are. If you have a relatively common name, then chances are that many of the results may not be about you. However the ones that are about you are worth looking into. Do they represent things you’re proud of, or at least things that you wouldn’t mind others seeing? If not, you should try your best to have them removed. In some circumstances you can’t (mailing list emails), but in some you can (forum posts). While I’ve always been an advocate of disclosure and I can’t stand hypocrisy, it’s also your right to rectify past mistakes. And while you are rectifying past mistakes, remember not to make future ones.

Your window on the world

It’s important to realize that your online presence is not just what the world sees of you, but what you see of the world. Having multiple email addresses with multiple providers (perhaps with not-too-discrete names) might confuse people you’re in contact with, but it will also make life harder for you. No matter what field you’re in, email probably takes up a considerable part of your time and you can make things easier by consolidating your email into a single place. At the other end of the spectrum, you could also have one gigantic inbox with everything mixed together. Learning to use filters and folders to separate out email will save you the mental and time costs of having to manage things on your own.

Whenever you see duplication in your life (multiple emails, multiple blogs, multiple websites), there might very well be an easy way to cut them down, whether it’s by using a client (or Gmail) to pull together multiple mailboxes or having multiple subdomains instead of multiple websites.

Your online presence is two-way street. In some ways it’s like your home: you live there and spend a lot of your time there, but you also have friends, family and other guests over. Taking care of your image on the web is just as important as keeping your house clean.

Looking ahead: new feed settings

Over the past few months this blog has experienced a significant rise in readership. It’s also been a great way for me to record, think about and gather information about my activities. Keeping that in my mind, I’m certain that I’ll be posting and devoting time to it over the next year. Though I currently pay for the ByteBaker.com domain name, I’m still on free hosting at WordPress.com. I’m planning to move to a paid host sometime early next year. This will give me more freedom in customizing and adding more content to the blog as well as gathering more statistics about what my readers like. 

This blog has been through a number of transformations over the past two years, going from a not-very-regular, not-very-focussed compilation of my occasional thoughts to a source of information that I think an increasing number of people find useful. That being said, through all that time, my RSS feed link has been the same. But the link still has the name of one of The ByteBaker’s predecessors and is something I wish to leave behind. I’m going to move the feed to a new Feedburner feed:

http://feeds.feedburner.com/bytebaker

This feed will stay the same even when I move to paid hosting. I’ll be shutting down the older Feedburner feed at the end of the week. WordPress.com also publishes its own feed for the blog, which will get updates while I’m still on WordPress.com but will stop after I move. So I’d encourage everyone to move to the new feed as soon as possible.

Sorry for the inconvenience, but I hope that a continuing stream of free technology-related posts will eventually make up for that. Once again, thanks to all my reader for giving me a reason to keep up my writing.

Making Linux boot faster

I’ve been a committed Linux user for the past 3 years now (though I’ve developed a liking for the Mac platform too) and currently I dual boot Vista and Arch Linux on my laptop. It’s a pretty rare ocassion for me to actually boot into Windows, mostly it’s just a game of SimCity 4. But whenever I do I’m really hate how much slower it is than my Linux install. What I hate even more is how even after I log in my system is still unusable for a good 20 seconds while everything finishes loading in the background.

By comparison, my linux install takes just 30 seconds to get to a usable desktop. Admittedly, what I boot into isn’t really a ‘desktop’ in the traditional sense of the world. I run Stumpwm, a lightweight tiling window manager, I don’t have fancy 3d graphics, I don’t even have a taskbar or desktop icons. That being said, I do boot into a fully usable system with an active wireless network connection.I was quite happy with the 30 second boot time until I came across an article about a group of researchers who managed to make a linux system boot in 5 seconds. Needless to say a 5 second boot time is really impressive and makes my boot time look extremely sluggish by comparison. 

With Thanksgiving Break around the corner, I’m considering putting some time into a building an experimental system in order to see just how fast a boot I can get. Chances are I’ll be using an older Dell machine, but I’m not sure about the specs yet. There are two main steps I’ll be taking to cut down on boot time:

1. Cutting down on unnecessary processes

A standard linux boot often starts up a number of processes and tasks that aren’t really needed on a normal single user system. Namely, I don’t need a Cron scheduler, nor do I need any type of mail server to be started. Since I never print, I can get rid of CUPS too. I use a lightweight graphical login manager called Slim, but if I wanted to shave another second or two, I could boot straight to a logged in desktop.

2. Making changes to the kernel

Since I’ll know exactly what hardware I’ll be running, I can build a custom kernel with appropriate modules for the devices built right in. However, I’ll still need to start the Hardware Abstraction Layer and udev so that I can use hotplugged devices (USB drives and the like). Since this is an experimental machine, I probably could remove the need for hotplugging, but I think in the real world, that crosses the usability line in the wrong direction. 

Adding things directly into the kernel has a two-fold effect: firstly I no longer have to wait for the modules to be loaded separately later in the boot process. Secondly, I’m trying to figure out if this will allow me to get rid of the initial ramdisk. Arch linux boots up by having the kernel load up a compressed disk image into the RAM which contains the basic modules needed to get on with the boot: mostly hard drive modules. This then lets the kernel mount the root filesystem and get on with the boot process. Removing the need for a ramdisk might be a significant time boost and is something I will definitely be looking into. 

I doubt whether I’ll be able to get a boot time under 10 seconds, especially since I won’t be making any source level changes. I’ve been looking for information to see if a different filesystem (other than the popular ext3) would have a noticeable impact, but I haven’t been able to find any concrete information yet. I might be looking around at some other kernel patches. Unlike the researchers mentioned above I won’t be making any changes to X or implementing readahead (which lets the kernel look ahead to see which filesystem blocks need to be loaded next). As always, I’ll be keeping a log of my activities and I should have some interesting results.