Designing for modularity and clustering algorithm

Friday, Jun 12, 2026 | 1 minute read | Updated at Friday, Jun 12, 2026

Emmanuel Decena

Writing modular software is like agglomerative clustering. Can you apply aspects used in clustering algorithm to write better modules?

In software engineering, we write code to address a certain requirement, such as opening a database, defining a data model, or processing data. We try to create code just once, then reuse.

But how do we know which part to put that code? How do we know we can reuse it and not write a new one? We look at the objects or concepts that the application has then group the code accordingly.

If a certain code or idea that initially was part of a single object but eventually gets needed by another object, we pull it out and create a new object or a new interface, which the previous two objects can now refer.

© 2025 - 2026 Blog

All rights reserved

About

I created this blog to monitor my curiosity, writing about concepts that interest me.

I write about personal projects, ideas, and the things I learn along the way. Hand-crafted and LLM-free.

Occasionally, a travel story or food review sneaks in.

If my writing resonates with you, feel free to connect with me at ecdecena [@] gmail.com.

I’m currently based in Cebu City, PH 🏖️.

Disclaimer

The contents on this site reflect my thoughts and opinions only. It does not represent the views of any organization, employer, or institution I am affiliated with.

Social Links