I've been wondering about the "best way" to build software. Maybe this applies to building other things, but somehow I doubt it. The area I've been wondering about lately is size. Is it better to build one big thing that does everything, or is it better to build a handful of small things that work together to do a big job?
Traditionally, UNIX systems came with a collection of small utilities with names like sed, awk and grep. These, when strung together using a command shell, like tcsh or bash could perform many kinds of interesting modifications to text files. In comparison, Windows systems came with Explorer and Notepad.
Now, to be fair, Windows does not make anywhere near the same kind of use of little text files to accomplish things that UNIX does. But still, given a little bit of time and paitence someone with Explorer and Notepad could do anything that a UNIX guru could automate. And it would require a lot less learning. Explorer alone does the work of bash, ls, mv, rm, mkdir, rmdir, find and du. And more that I haven't thought of.
So why would we choose to build our program one way over the other? Well, small programs are typically easier to test and debug. If a program is only supposed to do one thing, it is easy to see if it is doing it. On the other hand, there is often a lot of similarity from one program to the next. By writing one big program it is easier to re-use the similar bits.
Microsoft likes the idea of writing small programs, but they call them "components" and they're absurdly complicated. When the idea of components was first discussed, it seemed like there would be hundreds or thousands of them, and any application somebody might want to write was just a matter of hooking up the appropriate ones in the appropriate places. Instead, for most of the software I've ever written, a few components at most are used, and the use of each one requires a rediculously large amount of effort to learn the ins and outs of that particular thing. Nine times out of ten at the end of the project I finish by telling myself not to ever use another component. Inevitably I spend more time working around the faults of the one I used than I would have spent just writing the equivalent functionality myself.
But that just means that the ones I've used were buggy. It does not mean that the idea itself is bad. Does it?
Sunday, February 13, 2005
Saturday, February 05, 2005
Is a command line the best way to use a computer?
For many years I have been an advocate of the power of a command line interface over the ease of use of a graphical interface. I think that this is especially true for file management tasks. I'd rather type "rm *" than to have to draw a box around a window full of icons and then drag them to a trashcan. I'd far rather type "rm *~" than to have to search through a window with 100 icons in it looking for the ones whose names end with "~" to drag them individually to the trash. Richard Wareham even thinks that a command line is the best way to introduce new computer users.
But on the other hand, nobody that I know of uses a command line interface for what is probably the most common task there is: Editing text. Over the years I have used many different text editors. A partial list would include WordStar, WordPerfect, Brief, Notepad, Word, Emacs, MS DevStudio, OpenOffice, Delphi's IDE, and recently Vim.
What is it that all of these editors have in common? Well, they all show you what you're working on. They all let you manipulate it, with more or less direct actions. They're visual, with lots of visual feedback. A command line editor like Ed will generally show you a few lines around the line you're working on, and that only if you ask it to. It will accept commands, and show you only the immediate result of the action, not the full context.
Nobody uses a command line to edit text, why do we keep using one to edit our filesystem? I'm not entirely sure.
But on the other hand, nobody that I know of uses a command line interface for what is probably the most common task there is: Editing text. Over the years I have used many different text editors. A partial list would include WordStar, WordPerfect, Brief, Notepad, Word, Emacs, MS DevStudio, OpenOffice, Delphi's IDE, and recently Vim.
What is it that all of these editors have in common? Well, they all show you what you're working on. They all let you manipulate it, with more or less direct actions. They're visual, with lots of visual feedback. A command line editor like Ed will generally show you a few lines around the line you're working on, and that only if you ask it to. It will accept commands, and show you only the immediate result of the action, not the full context.
Nobody uses a command line to edit text, why do we keep using one to edit our filesystem? I'm not entirely sure.
Tuesday, February 01, 2005
Another Dry Spell
It's been a few weeks since I last posted. What went wrong this time?
Well, I managed to get a case of cellulitis (bacterial infection in the skin) on my shin. The doctors I've talked to about this don't know where it came from, but with a whole lot of intravenous antibiotics, I'm back up and around. I was only in the hospital for 4 days but I've been told to keep off my feet as much as possible because the whole area is prone to swelling up (rather painfully) if I sit normally or stand on it.
Here's an image of the affected area. This image was taken with my Treo, which is really a pretty poor camera, but I think it serves its purpose well enough.
(Edited to make the picture actually fit in the formatting.)
Well, I managed to get a case of cellulitis (bacterial infection in the skin) on my shin. The doctors I've talked to about this don't know where it came from, but with a whole lot of intravenous antibiotics, I'm back up and around. I was only in the hospital for 4 days but I've been told to keep off my feet as much as possible because the whole area is prone to swelling up (rather painfully) if I sit normally or stand on it.
Here's an image of the affected area. This image was taken with my Treo, which is really a pretty poor camera, but I think it serves its purpose well enough.
(Edited to make the picture actually fit in the formatting.)
Subscribe to:
Posts (Atom)