DEV Community

Discussion on: Code Smell 60 - Global Classes

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Namespaced values are just globals with a detour. If your Class is in a public namespace, it's a public class.

The only way to truly avoid these problems is a Lua-like system where there are no real globals and everything can be assigned to a name chosen by the user.

Collapse
 
mcsee profile image
Maxi Contieri

There are a lot of languages supporting scoped Namespaces

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Sadly, there's also many languages that Don't. Ruby comes to mind as an example.