How to organize the software in classes and modules (aka packages, namespaces)?

For a long time, I have been intrigued by the “rules” that guide someone in properly organizing the software code into classes and modules (aka packages, namespaces). I imagine that after applying those “rules”, one should obtain the same output […]