topic proposal: variables: globals, shared, private

Forum for discussion about the documentation project.
Posts: 389
Joined: Nov 28, 2012 1:27
Location: California

topic proposal: variables: globals, shared, private

Postby speedfixer » Jun 22, 2018 19:43

New programmer:
Everything declared in the main, everything shared. Simple.

Textbook programmer:
Everything encapsulated, nothing shared, everything referenced. SO MUCH to remember.

Enthusiastic programmer:
Everything pointered @. Can get to anything, anywhere, easily. So easy to segfault.

None of these are real-world for a decent sized program beyond a use-case test.

Every OS has a method to inject a variable into the global space. Globals are required.
Accessing root files from anywhere is just stupid.

What would be the rules one *could* use to find a balance?
Globals make life easier, but one shouldn't have to worry about every detail, all the time.


Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 1 guest