Simplicity for Complexity

Often times when it comes to technology, most developers are entangled with development complexities, using complex solutions to sometimes solve simple problems. Take for example: mathematics, there are a number of different ways we can get to a solution of a problem.

 How many 1s are required to make 4?

 Solution 1

 Increment the total by 1, each time you subtract 1 from 4 until you get to 0.

                        Step1: (4-1) =3 | 0 +1

                        Step1: (3-1) = 2| 1+1

                        Step1: (2-1) = 1 | 2+1

                        Step1: (1-1) =0 | 3 +1 = 4(ANSWER)

 Solution 2

  Add up the 1 until they get to 4

                        1 +1 +1+ 1 = 4

 Solution 3

Divide 4 by 1

  4/1

 

Given the problem above, which of the solutions is using simplicity for complexity? If your answer is solution 3, you are absolutely right. This same concept can be applied to Android application development.

There are various ways to create and design an application based on requirements and the best approach is to use simplicity for complexity. Modern application architectures help us achieve this by separating the concerns and having different components in the application responsible for different functionalities. They are simplifying the process by making the classes easier to write, with no entanglement of code and responsibilities, and still keeping in mind the complexity of the design goal. 

Simplicity for complexity can be used to achieve near to impossible applications, still making them maintainable, scalable and testable – keeping them complex and simple in the terms of readability. 

This concept can also be applied to existing characteristics of clean code and here’s how:

 

Maintainability: 

Looking back at the mathematical example above you will find that it is much easier to fix solution 3 because of its simplicity. With only 3 variables involved it is easy to change.

Testability: 

Solution 3 has less variables and a single step to test compared to all others. 

Readability: 

This goes without say that solution 3 is the easiest to understand and read at first glance. 

The conclusion is, if we design our applications focused on using simplicity for complexity, we will create very complex and functional applications following best practices and most importantly… with ease.

Previous
Previous

Best Practice in Running Mobile Production Environments

Next
Next

Why Being a Data Scientist is Like Being a Plumber — Part 1