4 ms·
Classes are used for a variety of things. Let's look at it from a language designer's perspective. If design a language and you want to offer inheritance, speci
by toolslive 6y ago
Classes are used for a variety of things. Let's look at it from a language designer's perspective. If design a language and you want to offer inheritance, specialization,.... you will often end up with offering classes.
Once you have that you could decide to offer namespaces. But, a class with some static methods comes quite close to what you need to offer for a namespace.
Hold on: you can use classes to combine some functionality that belongs together and come close to what you need for modules.
It's not a surprise the designers of java, c#, ... went that route.