Classes are nice when used in conjunction with a framework. Most developers realize that the Car that extends Vehicle from CS 101 is a limited pattern that isn’t very useful. And OO languages often force developers to declare classes when they really need namespaces or first class functions.
But if you are working with something like Spring Beans or React Components, classes serve as a decent unit within a framework. They help guide developers to factor their code in blocks of roughly similar size and scope. They help organize a codebase into something explorable for new members. Like chapters in a book, they don’t have to all be the same size, and may vary between books/codebases. That being said, most languages overload classes to be record/objects and namespace modules.
I like functions, and generally agree with the post. But when all you have is functions calling functions it’s not much better than spaghetti in large projects. You can still make a mess with classes, but they give a conventional way to delineate layers.
Comments
Classes are nice when used in conjunction with a framework. Most developers realize that the Car that extends Vehicle from CS 101 is a limited pattern that isn’t very useful. And OO languages often force developers to declare classes when they really need namespaces or first class functions.
But if you are working with something like Spring Beans or React Components, classes serve as a decent unit within a framework. They help guide developers to factor their code in blocks of roughly similar size and scope. They help organize a codebase into something explorable for new members. Like chapters in a book, they don’t have to all be the same size, and may vary between books/codebases. That being said, most languages overload classes to be record/objects and namespace modules.
I like functions, and generally agree with the post. But when all you have is functions calling functions it’s not much better than spaghetti in large projects. You can still make a mess with classes, but they give a conventional way to delineate layers.