What is Modularization Feature Image

What is Modularization?

Modularization in Programming

Modularization is a principle in programming in which you write your code in small independent chunks. Each chunk is encapsulated or self contained. Essentially, this means that you are writing small building blocks that each have their own small task or goal to accomplish. These smaller building blocks are built to work independently. Ultimately, the building blocks are put together to build an entire program that accomplishes a larger goal.

We use modularization in our lives every day. Let’s say you want to mail a package to your friend in New York. Sure enough, you know what you need to do to make that happen. You must pack a box, write the address, purchase postage, and drop it off at the post office. By accomplishing those steps, you are confident that your friend will receive the package in a couple of days. But, how does it work? What happens to the package after it’s dropped off at the post office? It doesn’t matter! That’s what modularization teaches us. You don’t need to worry about how the next part does its job, you just need to know how the process works and do your part.

The example above can be broken into two processes: you preparing the package and the post office delivering it. As stated in the definition, these two processes are independent of each other, yet work together for a greater goal.

Inputs and Outputs

Programming often deals with functions. A function is a synonym for the tasks mentioned previously (preparing the package and delivering it). The package itself can be considered an input. For you to use the postal service function, you must provide an input: the package. Many times in programming, we deal with functions that require inputs and sometimes provide outputs.

Reverting back to the principle of modularization, you do not need to worry about how a function works. The only thing you need to focus your energy on is providing the required input and being ready to handle the output, if one is given.

Modularization for Motivation and Focus

I personally love the principle of modularization. You can use it to provide peace of mind in many aspects of life. Remembering the principle of modularization allows me to detach from unnecessary stresses.

For example, if I am asked to work on a project that I am not very enthusiastic about, I tackle the task in a modular fashion. I focus solely on my task and complete it to the best of my ability. Once it is submitted, I no longer worry about why or how it is used. I get my satisfaction by doing what I enjoy doing and exercising my ability to implement best practices.

As far as focus, I take a similar approach. I use this often when trying to learn a technical subject. Technical books are not the easiest to read. Unlike novels, these books should not be breezed through. Usually, each chapter is modular and contains a lesson. My recommendation would be to take your time and learn that single lesson. Having a firm grasp of the building block that the chapter is attempting to teach you will build a stronger foundation once you unite all the modular blocks together.

Summary

In summary, modularization is not a single absolute thing. It is an abstract concept which is used to provide direction and better organization where it is applied. In programming, there is so much that needs to happen that your thinking process will implode if you try to solve all problems at once. Modularization will give you clear focus on what to do next. In life, modularization helps in getting things done. Similar to programming, we cannot accomplish everything at once. We must focus our efforts on the smaller tasks, and then, over time, put them together for a larger purpose.

Leave a Reply