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?
No comments:
Post a Comment