[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
In the beginning, there was spaghetti code. And Dijkstra said,
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 10
Thread images: 4
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?
>>
File: 1458655401828.png (361 KB, 611x436) Image search: [Google]
1458655401828.png
361 KB, 611x436
>>53739218
>namespaces is OOP
>>
File: Screenshot_2016-03-29-01-16-47.png (549 KB, 1080x1920) Image search: [Google]
Screenshot_2016-03-29-01-16-47.png
549 KB, 1080x1920
>>53739315
I have a PDF of an older version
>>
>>53739366
Global state isn't inherently bad. Neither is goto.

Stop being a cargo-cultist.
>>
File: Screenshot_2016-03-29-01-20-09.png (517 KB, 1080x1920) Image search: [Google]
Screenshot_2016-03-29-01-20-09.png
517 KB, 1080x1920
>>53739477
>>
>>53739477
>tfw had to type all that in manually
kids these days just pull that shit off from sjwhub
Thread replies: 10
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.