C
ccc31807
having globals (really static data in this case) isn't bad but
accessing them in a global way is bad and a very bad habit you need to
unlearn.
Okay.
STOP USING & for sub calls. this is true regardless of the globals!!
Why? What is the reason for an ironclad, absolute rule against using &
for user defined function calls?
your code is hardwired
to only use those variables and only be in that file with the
globals. do you see the difference? you will now argue that this code
will only live here. that is bogus as in other cases it won't stay there
forever. then you have to rewrite all the code. learn the better api
design now and practice it.
But what if it WILL only live here? What if it's a one time script
that you KNOW that you will only use once and then delete permanently?
descriptive names can lie.
That they can do!
you can't move the code as i said above.
This is also true, but it doesn't account for those occasions when the
code is guaranteed not to move.
that is true for all sizes of programs. you haven't demonstrated the
ability to code in that style and keep defending (poorly at that) why
Don't mistake 'defending' a position for the purpose of advocating it
with 'defending' a position for the purpose of testing it. Just
because a scientist attempts to falsify a hypothesis doesn't mean that
he doesn't believe that it's false -- he simply wants to test it. I'm
not advocating a particular style, just asking questions.
your global style is good or even better. it isn't good or better in any
circumstances. passing in the refs is much cleaner, more mainatainable,
more extendable, easier to move, easier to reuse, etc. there isn't a
loss in the bunch there.
QED
CC