Tuesday, November 25, 2008

The Complex Nemesis, or, Less is More

Complexity is the enemy.

When it comes to software, there's an undeniable correlation: all else being equal, a more complex piece of software will be more buggy, less secure, and less useful. (You can probably generalize this to the real world, but that's really outside the scope of what I was intending to blog about today. >_>) And yet, for some reason, people insist on creating incredibly complex applications.

It's completely possible to write 100% bug-free code. The trick is to make the program simple enough that you can keep the whole thing in your head at once. For example, here's a program I finished the other day. It's short, simple, and I can guarantee that it's completely secure and bug-free. You may legitimately argue, but what if I want a program to do more interesting things than that?

Once upon a time, a bunch of really smart people went down this same line of reasoning, and UNIX was the result. The fundamental concept of UNIX is basically an approach to managing complexity - you write programs in such a way that you can use them in other programs. (Appropriately, UNIX is itself a simplification of another operating system - people used to joke that it was "castrated Multics". XD) This ended up being such a robust approach that today, nearly four decades later, it's basically unchanged in modern UNIXes.

But something, somewhere, went horribly wrong. Today we have all these fancy graphical interfaces, and somehow they ended up being incredibly complex. The complexity gives us software that does some pretty nifty things, but it comes at a price - software in general is less reliable than it used to be. There's collateral damage too; in a GUI, you can't stitch programs together the way you can on the command line. When you hear somebody complaining that the command line was better, it's not just nostalgia, it's the bitterness that comes with seeing a fundamentally superior system discarded for one that looks prettier.

We are long overdue for a radical simplification in program design, though plenty of things have been tried. Some programs (generally UNIX) take the approach of splitting off the core functionality of a program into a separate library, or calling command-line programs from the GUI, but this is often a pain. Object-oriented design was an attempt to make code more intuitive rather than less complex, and it succeeded, but only to a certain extent. Unit testing tries to gain the benefits of the old UNIX model with respect to bugs, and it succeeds, but takes a lot of effort, and doesn't address a lot of other problems of complexity. Use of higher-level languages takes care of a lot of complexity, but carries some performance tradeoffs, and for some reason rarely occurs in practice. No, a real solution will have to be something completely new.

This isn't just a code issue, either, it also affects user interfaces. Apple understands this really well. I can't set the time on a microwave without a lot of trial and error, but I can operate an iPhone - a much more complex device - pretty much intuitively. Programmers are almost always bad interface designers, and designers are almost always bad programmers, but Apple seems to have found a good balance. Here, ironically, the shoe's on the other foot when it comes to operating systems, since Linux is host to some pretty atrocious ones - Blender and Gimp spring to mind, though the latter has improved recently.

5 comments:

Salalah said...

post more about easy to argue material. Like how Obama is a terrorist Muslim hell bent on destroying this nation from the inside out with the help of Osama and his array of blue state homosexuals who wield sledge hammers and knock down churches and statues of the 10 commandments on public property while gaily deflowering young christian virgins and corrupting out society with theer decedantly seductive and witty shows like Will & Grace and American Idol, the same way yoga "destroys the faith of a Muslim".

just to be difficult... i disagree with your post! and the last one at that!

Kiriska said...

I would argue that Apple is intuitive. Seriously. I hate Macintosh's interface. I can't find anything ever. When I download stuff -- where does it go!? Where is this mysterious Downloads folder that I can't navigate to?! Is Windows any easier to navigate? I really have no idea because I've been using it since all there was was a DOS screen, but hey! That doesn't mean I'm being biased against Apple, does it? I seriously don't know how to use the thing! And I hate that Photoshop has a transparent background on it because it confuses me when only half of the program is showing. :| What's up with that?

iPod? Okay, I guess it's easy enough. iPhone? Dunno, haven't played with one. But I've got beef against that damned iMac of theirs. :|

P. Static said...

...you haven't played with an iphone yet? o_o seriously, get thee to an apple store and be amazed. :o

Apple isn't perfect, but I'd say that in general, they're doing better than anyone else right now at making stuff intuitive to use.

Kiriska said...

I have no innate desire to go out and play with the newest gadget, least of all phones since I don't use phones all that often and really don't care... I guess that's another thing that made me unsuited for my ex-major. I'll play with an iPhone when someone shows one to me and shoves it in my hand. :P That's when I finally played with an iPod. (Oh, and you know what? Fuck iTunes! I like to think that I'm not the only person who using Winamp!)

P. Static said...

The iphone is teh shiny though. :( I agree though, fuck itunes. :p