|
|
|
|
|
by chongli
893 days ago
|
|
Not if you are encapsulating and naming effectively... Encapsulation is hard and a lot of what people call encapsulation isn’t. For example, taking a global variable and moving it to a class is not encapsulation. You have to actually do the hard work of removing the dependency on global shared state. Just changing everything to mutate the new global through an accessor to a “god” object that gets passed everywhere is accomplishing nothing at all. Worse than nothing, you’re complexifying without fixing the root problem: global mutable state. |
|
A cleverly-named way of disguising global mutable state does not make it better.