In this article let me bring out the relevance of the famous problem solving principle – divide and conquer – in various disciplines all around us. While Software Engineering continues to sit in the centre, we shall see similar patterns in application of this principle with instances from different corners.
Let’s talk business
Why do we have quarterly targets in businesses? Why do we track quarterly performances?
1. We divide long term objectives into a series of quarterly objectives
2. Put-forth a quarterly plan / target
3. Work towards achieving this short term, comparatively smaller short term target
4. Measure and analyse the performance to come-up with preventive and corrective actions that go as an input to subsequent quarters
Some businesses do have monthly targets as well. All on the same lines – Conquer long term goals by dividing them into smaller, achievable, plannable, executable short term targets.
In one of the interview with Indian Cricket captain Mr. M.S. Dhoni on how he could execute chasing a big score so successfully and consistently, he mentioned how he divides the whole chasing into different stages and bat to achieve smaller targets in each stage.
- Divide final target to be achieved in 50 overs into smaller targets achievable in each stage of chasing like by end of 20, 25, 30, 35, 40, 45 overs.
- For each smaller target, identify when to accelerate, which bowler to target for scoring more runs
- At the end of each stage, based on how well we executed, decide how the next stages need to be executed
As I wait for the dawn to set in a railway station, I am compelled to bring out how divide and conquer can be observed when we see a train. Accolades go to the person who was behind the design of the train
- Divide the whole train into set of coaches
- Build 1 coach at a time
- Connect coaches behind the engine and you get the train
I leave it to your imagination to identify various problems solved by dividing the train into set of coaches.
This is something very close to my heart – the art of problem solving in programming. It takes its root in writing algorithms or pseudo code and drawing a flow chart as it is difficult to solve the problem in one go.
- Divide the whole problem into series of tasks. When I started to program, I wrote them as series of comments. It was difficult for me initially to translate my thoughts into programming syntax. By breaking the whole problem into smaller tasks, I had to just focus on solving that simple, smaller task and get the syntax right.
- Implement (write code) each comment detailing the task as a separate method (preferably).
- Review and test individual methods
Practicing the above approach helped me to get the focus right and align the thought processes in the direction of solving the problem without worrying too much about the programming syntax.
Let’s engineer software
As promised let Software Engineering be the centre of the focus as well as be at the centre of this article. Any engineering discipline, be it software engineering or civil engineering, all advocates one process or the other that primarily divides the overall building process into a set of stages and a methodology that states what to be performed in each stage and how they work in tandem to build “concrete” things.
In case of the traditional waterfall model, the whole software development is divided into engineering phases – Requirements, Design, Development, Testing and Deployment – with goals set for each phase. When we view the complete software as one single chunk to build, we find it difficult to achieve goals within individual phases as well as the overall goal of getting the required software at the end. So, we divide the whole Software into set of smaller increments and iteratively build the whole system. There are various flavours of iterative development. But all are based on the fundamental principle of divide and conquer:
- Divide the complete system into set of sub-systems based on priority, complexity, relevance and other external dependencies.
- Analyse, elicit (requirements), design, develop, test and deploy individual sub-systems in an iterative manner.
Why do we study until 12th Grade in school? Why do we have 4 academic years in Engineering with each year having 2 semesters? Within each grade why do we have so many terms? Just imagine how our school life or college life would have been if we have to learn everything at once. While there will be an uncertainty of achieving what we want to learn, it will rob away the delight that we get when we proudly boast our progress from one grade to another. You can observe this pattern in every subject that we learn – be it art, music or science. We have to progress in stages.
When I reflect back my very short experience (spanning very few days) in the Art and Decoration department during the initial days in college, I got a first-hand experience of how a huge poster is made to perfection. One of the key activities given to amateurs like me is to divide the huge chart into set of smaller squares by drawing cross-cutting lines on it. The expert artist then completes the huge drawing by taking it in steps, square by square.
Let’s watch time
How will our life be if we have not divided the day into 24hrs, an hour into 60 minutes, a minute into 60 seconds? Leave the rest to you. To debate one might say I shall watch the angle of Sun light like in olden days and live with it. But a Software Engineer rarely sees the Sun once he / she enters the office
After observing the patterns of divide and conquer all around us, we can take a leaf out of this principle to solve any kind of problem. Guiding principle is to divide the whole problem into chewable chunks. Plan and execute each chunk making steady progress in our road to achieve the goal and see the bigger picture.
Philosophically, our life moves in only one direction – getting older day by day. To get a holistic growth in our life, we need to set forth long term, near term, short term and immediate term goals. Once you set forth these goals, you need to have the clarity on a daily basis to execute and achieve immediate term goals. Time is very critical during execution as the lost time or the time spent on some other activities can’t be bought back.