Ayao "Alqualos" Kuroyuki (ayao) wrote,
Ayao "Alqualos" Kuroyuki

Complexity and simplicity paradox

Complexity and simplicity are exactly opposite things. But strangely enough, one often leads to another. Simplicity may lead to complexity and complexity may lead to simplicity in both good and bad meanings.

In software development, simplicity is definitely a good thing. The simpler the code, the less bugs it contains, the easier it is to maintain and extend. Oops, did I just say "to extend"? Does not extending a simple code represent a risk of making it more and more complex? Yes, and that is exactly one of the bad ways to do it. Here is one way how simplicity may lead to complexity - complex things are usually unable to produce more complex things, just because they are unmaintainable and tend to get thrown away. But that is rather natural way for simplicity to turn into complexity. I would like to talk about more paradoxical ways.

Suppose we have a really simple program. Suppose we have a lot of them. Now, if they are designed "a Unix way", we can easily connect them together and get some complex construct. It is impossible to do with complex programs since they are almost never compatible enough. You may build a house out of bricks, but you are never going to build a bigger house out of smaller ones! Or, more to the topic, you can easily use sed from your shell script to do some simple replacements, but you are never going to use Microsoft Word the same way. So, one way to build complex things from simple ones is to connect them together. And the simpler they are, the more complex things you can make (just think about how many kinds of houses you can build out of small bricks and out of big blocks). This is one paradoxical way to go from the simplicity to the complexity.

Another one is about how complex instruments can solve the problem the easier way. This is about whole computers thing, actually. I mean, that computers in nature are the complex devices meant to simplify our life. Instead of spending centuries calculating "Pi" value up to the millionth digit, you just write a simple program to do it for you. But in order to do it you need to have very complex device called "computer" and another complex thing called "programming language implementation". Thus complexity leads to the simplicity.

But it is all still natural enough. Now for the most wonderful thing. Suppose you have some complex program. The question is: is there any way to make it more complex while making it more simple? Sounds like some black magic, but in fact it is possible and easy! Just break it into simple parts and make each part a little bit more complex. Each part will be even simpler than original program and the whole thing will be more complex. And these things are both good. Simple parts make it easier to maintain and overall complexity is actually only gives you better abilities.

Remember that telemetry sending-receiving application that I was talking about? At one point, I thought that it would be nice to have a feature such as to be able to start several services simultaneously. But then I thought, "Hell, it is so complicated already! Let us live without it!". Now I think that if I had chosen to implement the whole thing as four independent applications (one to receive, one to convert, one to send, and the last one to control everything) then it would be much more easier to implement this feature, because the receiving part would not look like such big complicated mess as the whole thing. Thus the best way to increase complexity without scaring everyone is first to take a step to the simplicity. Note that the reverse would be much harder: if you already have one big mess, then it is not a best thing at all to first make it into a bigger mess, and then trying to make it simpler.

Of course, the fact that it is easier to make things more complex by breaking them into simpler parts should not encourage one to do so right away. Even better would be to solve a more complex problem without complicating anything at all. If there is a way to do it, go for it!
Tags: devel, it
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded