Monday, October 27, 2014

Software is a tree

Maybe software is like a tree.

The applications, websites, games that people use are the leaves. They're the important part of the tree, because they're useful. They solve real problems and improve lives, they make money, they entertain.

The leaves are built upon the wood of the tree, branches and trunk: all the libraries and languages and operating systems and network infrastructure. Technologies upon technologies, upon which we build applications. They're the important part of the tree because dozens to thousands of leaves depend on each piece of wood.



Which part of the software tree do you work on? Is it a leaf? Leaves need polished according to their purpose, monitored according to their criticality, grown according to users' real needs. Is it the wood? The wood needs to be strong, very well-tested because it will be used in ways its authors did not imagine.

Ever find yourself in between, changing an internal library that isn't tested and documented like a strong open-source library, but isn't specific to one application either? I've struggled with code like this; we want to re-use it but when we write it we're trying to serve a purpose - grow the leaf - so we don't stop to write property tests, handle edge cases, make the API clear and flexible. This code falls in the uncanny valley between wood and leaf. I don't like it.

Code that is reusable but not core to the business function is best shared. Use another library, publish your own, or else stagnate in the uncanny valley. Follow the mainstream, form a new main
stream, or get stuck in a backwater.

With a few days set aside to focus on it, we could move that shared code into the wood, and release it as open source. Make it public, then document, test, and design with care. When we graft our twig into the larger tree, it can take nourishment from the contributing community, and maybe help more leaves sprout.

If the code isn't useful enough to release as even a tiny open-source library, then it isn't worth re-using. Build it right into multiple leaves if multiple leaves need it. App code is open for modification, instead of the closed-for-modification-but-needs-modification of the shared internal library.

With care, ours can be a healthy tree: millions of shiny custom leaves attached to strong shared branches.

1 comment:

  1. Great post...I like your thought software is a tree
    This will really help programmers
    High5store

    ReplyDelete