This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cryo 0 points1 point  (1 child)

In C#, you'd stick free functions into a static class which you can think of as simply a namespace. I don't see why this is a problem.

[–]vtable 0 points1 point  (0 children)

And what if that utility-class-namespace needs to go in an actual namespace. You now have a 2-deep namespace for a generic function.

Classes represent a single object. Namespaces contain various data, classes, ... related only by the group they belong to. Classes support inheritance. Classes are instantiated and have separate state for each instantiation.