Re: Procedure, function and return

new topic     » goto parent     » topic index » view thread      » older message » newer message

A quick note on global variables/side effects and "bad" programming:

Imagine your program was like a kitchen, and global variables are like the kitchen floor. Now some things actually deserve to be left on the kitchen floor, like a dustpan & brush, that massive box of washing powder, a mousetrap, and nobody cares much. But now imagine storing everything in your kitchen on the kitchen floor, and likewise it is not "some" global variables and side effects, it is "too many" that makes it "bad", and as your program grows the only sensible approach is to try very hard to make it "as few as possible".

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu