Learning App Development From Nature
May 30, 2023
In this article, I would like to show that many problems or ideas we encounter in the process of developing new applications and resources have existed alongside us for millions of years. Nature itself shows us that some mistakes lead to astonishing successes, while some improvements result in failures and defeats.
The development of an application is very similar to creating an ecosystem, much like the one our planet is. Having significant expertise in working with legacy code, I often see analogies with evolutionary processes. Here're some examples.
Resource Allocation and Lizards
Recently, in one of my projects, I encountered user complaints about the inability to submit an order form. After spending some time researching the issue, I came across a scenario that closely resembled nature.
Take lizards, for example - their bodies can either run or breathe. They sprint for 6 seconds, take a break, and then sprint again for another 6 seconds.
In the project, it turned out that a task was implemented that processed data every day, completely blocking the ability to save that data. We were running for 22 hours a day and only had 2 hours to catch our breath. Unfortunately, those two hours coincided with the peak time when the maximum number of users tried to place orders.
By teaching the application to run and breathe simultaneously, we doubled the number of orders within a week.
Long Reach of Poor Interface and Giraffes
The client requested the addition of interface testing to understand which parts of the website users visit most frequently and which they ignore. After a month of observations, it turned out that most users were avoiding the search page. This reminded me of another interesting fact from animal evolution - giraffes.
You may wonder what giraffes have to do with it. The client kept adding more and more filters to the search panel, resulting in a long list that had to be scrolled for almost a minute to reach the "Search" button.
It was similar to giraffes because they are so tall that they need to almost do the splits to reach the ground to drink. Their necks are not long enough to reach the ground comfortably. Additionally, giraffe calves are born from a height of about one and a half meters, hoping there are no predators nearby.
We saved the search functionality by placing the "Search" button at the top, removing some filters, reorganizing search categories, and adding an advanced search feature. As a result, the search page became one of the most popular pages on the website.
Redundancy of Legacy Code and Recurrent Laryngeal Nerve
However, that's just what we see on the surface. Take humans, for example. We have a nerve called the recurrent laryngeal nerve. It originates from the brain, descends almost to the heart, and then returns to the larynx. It forms a loop.
This design wasn't intentional; it's a remnant from our fish ancestors. We used to have gills, but over time, they disappeared, and the neck evolved. However, the nerve itself didn't change.
The same concept applies to application code. I often come across code snippets that seem crucial and indeed are important. However, upon closer inspection, they turn out to be excessively bloated. These pieces of code make maintenance, bug fixing, and feature enhancements difficult.
It requires analysis, removal, rewriting, and simplification of old lines of code. The outcome is transparent and comprehensible code that can be easily expanded and modified according to the client's desires. As for us, we'll continue living with this long nerve - If it works, don't touch it =)
Burden of Code Accumulation and Plant World
Here are a couple of interesting facts from the plant world. Around 400 million years ago, trees started to appear. Lignin played a crucial role in enabling plants to become woody.
However, during that time, bacteria and fungi lacked the necessary enzyme to break down lignin. As a result, forests were impenetrable accumulations of tree trunks, and now we have coal and diamonds.
However, in software development, this is not beneficial. When lines of code grow and, after becoming unnecessary, remain in the project, they don't provide future benefits like coal and diamonds. They hinder the work with the application.
Unnecessary code should be removed. You don't need to search for the right bacteria and fungi; you need to find time for refactoring - analyzing and restructuring the code.
Debugging Delays and Sea Otters
Once, a client approached me with a request to speed up their application. Several forms and pages were running very slowly. They took a long time to load and submit results.
Within the first ten minutes of investigation, I recalled the behavior of sea otters. All animals are constantly surveying their surroundings - checking for nearby predators, prey, deciding if it's time to sleep or eat, and the same goes for reproduction. Sea otters, for instance, pause for a couple of minutes after each query.
In the project's code, similar delays were hardcoded. The previous developer had forgotten to remove debugging delays in certain parts, causing the application to wait for the completion of these delays. Removing those delays turned out to be one of the most rapid missions on accelerating the project.
Simplicity Strategy and Ostriches
Indeed, not everything in nature is designed to be buggy. Take the ostrich, for example. To facilitate its digestive system, nature provided it with the ability to grind food in its stomach using stones.
However, the ostrich has a very small brain. Instead of adding functionality for searching and consuming stones, nature simply reduced the bird's visual acuity. Now, when the ostrich attempts to eat grains, there is a 30% chance it will consume a stone, thus fulfilling the task of food grinding while running.
This fact highlights an important lesson: sometimes, there is no need to add new features and make the project more complex. Instead, it's possible to modify existing functionalities, reduce complexity, and thereby increase efficiency.
This is particularly crucial for mobile applications where the app size and resource consumption need to be restricted. Adding isn't always beneficial, and restricting isn't always detrimental.
Unexpected Benefits and Squirrels
Here's another example of how a developer's mistake brought significant profit to a project. By making a typo in the website's routes, the developer unintentionally started redirecting customers from the initial order page directly to the final payment page. This update was surprisingly well-received by existing users, and within a week, the number of users increased by twenty percent.
It's similar to how squirrels, due to their poor memory, contribute to the growth of new trees on our planet. They simply forget about more than fifty percent of the places where they hide their food reserves. As a result, seeds germinate and give rise to new trees, which, in turn, provide oxygen for us. Not all development mistakes are bad; sometimes, they bring unexpected benefits.
User-friendly Design and Flowers
Indeed, a prime example of the importance of quality design and user-friendly interfaces. In South Africa, a large flower species solved the pollination problem by growing a sturdy perch for birds. Birds dislike landing close to the ground because they are more vulnerable to predators there.
However, their food source is often found on the ground. Through evolution, the flower developed a perch to attract birds for pollination while ensuring they didn't risk landing completely. As a result, the flowers are pollinated, and the birds remain safe.
This serves as an interesting analogy for how web resources should be designed - maximally intuitive, secure, and user-friendly interfaces that don't require users to spend half a day searching for an order button or contact form.
Diversifying a User Base and Avocados
Often, our applications grow and expand, becoming difficult for new users to understand, and the number of long-time users either decreases or disappears entirely.
It's just like with giant sloths. Avocados grew in size to satisfy the appetite of these ancient creatures. However, there was no one left to spread the seeds of this fruit across the planet when sloths went extinct. Humans saved the fruit by finding it beneficial for themselves, consuming it, and dispersing its seeds.
We shouldn't be like avocados and rely on a limited group of users.
Drawing Inspiration from Nature
As a result, our magnificent planet has an infinite number of stories and examples of successful and unsuccessful design. Nature has inspired the greatest minds of this world to make great discoveries.
Let's cherish our environment and draw inspiration from it for beautiful and beneficial projects for humanity.