In the beginning, there was spaghetti code.
And Dijkstra said, ‘Let there be Structured Programming! Thou shalt consider goto harmful and organize your code into functions with proper control flow mechanisms.’
And programmers said, ‘OK, sure we’ll do that.’
Then Dijkstra saw that code was still spaghetti and said, ‘Stop sharing state willy-nilly! Thou shalt avoid global variables and instead pass all state through the call graph.’
And programmers said, ‘Er, um, wait, really? We haven’t really figured out this functional programming thing, nor do we want to pay the overhead of immutable data on today’s machines, so what you’re proposing is horribly impractical and inconvenient for non-trivial programs.’
But the programmers did agree that shared state is problematic and that maybe they could cut back on all these global variables.
And so Object-Oriented Programming was born, and the global variables lived happily ever after disguised as singleton object fields.
Someone needs to get the eBook for this so /g/ can complete it
Or you could learn proper design and cut your singletons down to zero.
>>53739366
Isn't your entry point always going to be a singleton? Or does it not count if you're hiding it in the framework-of-the-month?
>>53739430
What? No. Do you know what a singleton is?
>>53739218
>namespaces is OOP
>>53739315
I have a PDF of an older version
>>53739366
Global state isn't inherently bad. Neither is goto.
Stop being a cargo-cultist.
>>53739477
>>53739477
>tfw had to type all that in manually
kids these days just pull that shit off from sjwhub