Attention Programmers — You Must First Become Experts at World-building

Nikhil
The Startup
Published in
5 min readDec 5, 2019
Photo by Element5 Digital on Unsplash

What use is a map that does not help you navigate the world? Paper and ink by nature do not have any inherent knowledge that leads to the creation of the map. It is when a cartographer puts in his skills at work, the paper and ink fuse to take shape of a map that is useful because it aligns with reality.

Sounds simple enough? Now let’s proceed…..

Output of the Code Is Not the Measure of its Usefulness

Now, let’s assume that the paper and ink are your screen and code, and you are required to write code for, say, an e-commerce website. You can just write it purely in technical terms using a computer language and methods of a framework. You would usually get data from the database whenever the UI needs it and store data when the user clicks that “Submit” button. What you are doing here is only aligning your code to the business requirements.

Here, your collection of codes is not gaining any structural knowledge of the world outside.

Mismatch between business realities and the code

The Battles Loom on the Horizon — Those Change Requests Come

When those dreadful change requests come, instead of writing meaningful code, you would be fighting battles with reality inside your code. You will be busy translating the realities of the outside world into your code that knows no rules of reality.

All business software are simulations of real world processes. If the business reality is not aligned with the inner reality of the code, it creates an impedance — a resistance for change.

After your Battles with Reality — Mostly You will Win!

Congratulations! You have finally made those new requirements work, but at what costs? Those after-office hours and sleepless nights — valuable time that you could have used in learning new technologies.

This is the waterloo of computer languages and frameworks — Even the bad design works! Computer languages and frameworks do not provide any motivation for aligning the code with business and processes.

This is where the map analogy and code analogy differ. The Paper and Ink can only be arranged in a single way to align with reality to be called useful, whereas the structure of the code does not have to. The output of the code can align with reality, without the structure of the code aligning to reality.

Finally, Reality Will Hunt You Down

Everything has its limits.

Bad design works, but it does not scale well.

At some point the code will give up. Changes will be time consuming and unreliable. Changes in one part of the code will cause tremors in other. You will make a strong case for refactoring, but refactoring will only delay your final defeat.

What Went Wrong? — When Things Transcend Mediums

The challenges here are not technical but structural and, more importantly, lingual.

Let me explain it with two analogies.

It’s very common for a novel or a story to move from a print medium to a visual medium. Both these mediums are very well equipped to mirror each other. The languages and rules of both these are very different, but at the same time compatible. (Though something always gets lost in translation)

The same is with the languages. It’s possible to translate from one human language to another because human languages have some inherent rules and structures in place that allow the translation to function.

Computer Languages and Frameworks have no such inherent rules that take into account the translation of business requirements that helps you mirror the real world processes, hence the responsibility to do so falls on the developer.

Until and unless you devise a way to make your code a replica of the outside business, it will resist changes, because it does not understand the language of the outside world.

What is World-building?

“The world is a totality of facts and not of things.”

— Ludwig Wittgenstein, Tractatus Logico-Philosophicus

One of the greatest philosophical minds of the century saw world as consisting only of facts. But our job is much simpler. Let’s consider that the world comprises only 3 things, Entities, Actions and Messages. These three combine to create a process.

Entities are standalone objects in the real world, like a Person who can also represent a Customer, a Product, or a Delivery Agent.

Actions are something that Entities can perform to fulfill a certain task in the business.

Messages are data that one entity transfers to another entity, with or without the expectation of receiving a reply.

When all these three work together to achieve a business goal, it’s called a Process.

World-building is constructing a business process by creating Entities, Actions and Message, using only computer language features and OOPS, in such a way that it becomes a close simulation of the real-world process, without employing the user interface or the database.

Business realities aligned with the code

You can simulate something like an e-commerce delivery system from the moment a customer orders a product until the moment he gets his shipment delivered at his doorstep.

Test Your World

The test of a model is its ability to realign with changes. Start with small believable change in the business, like, the e-commerce company employs a few more courier companies during the vacation season due to an increase in demand. See how quickly you can adapt the model to the change by adding more entities if required, but at the same time without disrupting the core structure. Increase the severity of changes to push the resiliency of your simulated world to its limits.

On Exactitudes

In the short story “On Exactitude in Science”, by Jorge Luis Borges, the Cartographers attain such perfection, that to satiate their intellectual desire, they created a “Map of the Empire whose size was that of the Empire, and which coincided point for point with it”. The future generations who were not so fond of Cartography, had no idea what to do with the map and they abandon it.

We do not want to replicate the world, atom by atom, or molecule by molecule. We just want to create a mirror image of the real world within the code that gives us just enough human understandable language and structure so it helps us efficiently translate the business requirements to code that anybody can understand and relate to.

--

--

Nikhil
The Startup

Programmer, Technical Architect, Autodidact, Technology Enthusiast — Micro-services, DDD, Web, Mobile, Cloud-Native