3 ms·
> You've never seen Java (or C#) code where a bunch of unrelated functions belong to some meaningless class like "Utility"? Is that worse than the global scope
by jayd16 3y ago
> You've never seen Java (or C#) code where a bunch of unrelated functions belong to some meaningless class like "Utility"?
Is that worse than the global scope as the dumping ground?
One other benefit of forcing classes is that there's a logical place for private functions and fields. Private state is an anti-pattern to some but it's more consistent design for Java, I think.
- wizofaus 3y ago> Is that worse than the global scope as the dumping ground? I wouldn't have a problem with requiring everything to at least be in a namespace, though it needn't be enforced at the language level (vs a linter rule).