The Code That Can Evolve

“It is not the strongest or the most intelligent who will survive but those who can best manage change adapting its environment” — Leon C. Megginson in his enlightenment of Charles Darwin Evolution Theory


Evolution of knowledge

Compared to many other fields, technology is relatively new fields. There is not much law to regulate technology related fields as it is growing to almost every aspects of humans life. The law of the jungle still applies everywhere, “Survival of the fittest” for those who is not fit to the environment will perish. Same rule applies to the code, the code that is not needed or not maintained always go to extinct.

Code That Can Adapt

Code that can evolve should be able to adapt to conditions, like the law of the fittest. The longest living creature is the one that always able to adapt, doesn’t necessary on the top of the food chain but someone always need them.

Code that can adapt and easy to maintain also applies the same, How many of us look at the success stories of open source around the world such as Android, Linux, MySQL, Apache, Mozilla Firefox, Wordpress, and many more. And how they still in the spotlight until now kicking the previous competitors.

We can see from for example, android development platform that they always updated anything in less that 2 days. Such a OS like Android updates every 2 days and nobody realise. Thats how agile they are, but how to produce such velocity in a programming?

Now it comes down to this secret, there are also open source that are died out there, what makes the popular open source different?. Thus we lean back to our experience and asked ourself, how many times we tried to contribute to open source, and stoped at reading the code because the code was to messy. This makes the code can’t evolve, nobody want to try to fix it because it is hard to understand. Now comes the question

How to create a code that easy to maintain?

The principle was simple, we need to create code that revolve around SOLID principle. Even though the name was SOLID, but the meaning was entirely different. SOLID in design principle means:

  1. Single responsibility principle: a class should have only a single responsibility.
  2. Open/closed principle: software entities … should be open for extension, but closed for modification.
  3. Liskov substitution principle: objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program
  4. Interface segregation principle: Many client-specific interfaces are better than one general-purpose interface.
  5. Dependency inversion principle: one should depend upon abstractions, not concretions.

Following the SOLID Principles gives us many benefits, they make our system reusable, maintainable, scalable, testable and more.This 5 principle is like the anchor that become the law of adaptability. From this 5 principle born a lot of good design pattern and techniques. This principle is widely known in the programming world as the guide, and the judge whether something is code smells, good design pattern, or bad design pattern.

Will this 5 principle last forever? We might never know, but so far, this principle help a lot of programmer to make their code aesthetically pleasing and thus easy to improve.

Closure

Now, we wonder why Google, Facebook, Microsoft, Amazon, and many more big tech companies are still there? They evolved, they change to our needs, and we still use them even separate by miles, they support different language, and they adapt to our needs and therefore they survive until today.

“The world is scary being, it deleted all the things it doesn’t need. Make sure your code able to evolve on the screen or it will go extinct”

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade