A micro-class, micro-method, or micro-function is a unit of code that accomplishes such a small amount of work that it can be said to have no useful functionality on its own. Instead, the work it's meant to perform is repeatedly delegated to other micro-units and obscures what task is really being performed.
It is important to note that abusing micro-classes is NOT the same as merely breaking down a problem into smaller parts (a good programming practice). Instead, the use of micro-classes takes that idea to such an extreme that even the simplest of tasks are divided and spread out so thinly that it becomes difficult to follow the logic of the program. Think of it like a book being broken down into chapters and sub-chapters versus a choose your own adventure book where you constantly have to flip pages. Reading code that makes heavy use of micro-classes is like having to flip to a different page for every sentence.
Because I primarily work as a Java developer, I will be using the term micro-class. However, my arguments apply equally to micro-functions for those not using OOP.
Micro-classes are a bad idea. We all know that God objects are an anti-pattern. I think the industry has been very successful in getting that point across. I even meet a lot of beginner developers who are familiar with the harm caused by really long methods that try to do everything. However, I think that now things are going too far in the other direction. There are now many software developers who go to such extremes to break things up into smaller units that the code base as a greater whole becomes incomprehensible.
Why Micro-Classes are Harmful
When creating an architecture for your application, you think about what packages and layers you need. If you divide your program into these microscopic units, you will eventually find yourself in a situation where a micro-class doesn't have a logical place to live. You either stick them into some "util" package or, if you are really creative, you spin it off into an entirely separate project and you have your application code masquerading as a "library", despite not containing anything useful outside of the one application that will ever import it. Hard coded assumptions about the calling application are often embedded in this faux library. Additionally, the project is now composed of so many of these little utilities classes, that it becomes difficult to find the places where the real work happens.
2. Micro-classes harm API familiarity.
Code is easier to read when it uses APIs that programmers are already familiar with. In applications that abuse micro-classes, the common APIs are hidden at the lower layers and often unneccessarily wrapped. This creates a code base where the business logic is composed entirely from an unfamiliar API which only exists in that one application. This makes code harder to read because one must learn and understand this new and unfamiliar API in order to understand what the code is doing.
3. Micro-classes make change more difficult.
The typical argument in favor of micro-classes is that they enable change. I think there are flaws with this argument. The first flaw is that most systems are not well designed and only allow for particular kinds of changes. As soon as a requirement change occurs that was not anticipated, then the change is not any easier to make. Secondly, even in situations where micro-classes do enable the kind of change one would expect, the micro-class style of programming requires very advanced knowledge of the system in order to successfully make the change. In theory, one might be able to only change a couple lines of code. In reality, most programmers outside of the original developer won't understand the system well enough to do it. Instead, they struggle through it and end up with ugly hacks to accommodate the requirements change. I put forward the argument that while a more cohesive system requires a greater number of source lines to be modified, they are often contained in a fewer number of places and the change is actually easier to make.
4. Code which relies on micro-classes has a high level of indirection.
When you read code composed of micro-classes, it is difficult to understand and explain to others. In an application composed of micro-classes the steps needed to accomplish simple tasks are spread out across the system. I've worked on programs where it was not uncommon for me to end up with 20+ tabs open in my editor as I navigated through the web of files to see how a relatively simple piece of functionality worked.
Signs of a Micro-Class
1. Micro-classes are often used only once. If you find a class which is never used by more than one caller, it may be a micro-class.
2. Micro-classes tend to reinvent the wheel. They will act as nothing more than wrapper classes which do little but provide a slightly different interface for doing the same functionality as another class.
3. Micro-classes tend to abuse design patterns. While design patterns aren't necessarily bad, one should have a rational for using them. Code that abuses micro-classes often does so in order to implement a design pattern for a relatively simple piece of functionality where the design pattern was overkill and not needed.
4. Micro-classes tend to be poorly named or invent new vocabulary. Because the code gets spread so thin, developers must think of new names for all the additional classes and functions. The names are often poor at describing the purpose of the class.