Re: static vs global variable [message #172710 is a reply to message #172709] |
Sun, 27 February 2011 02:38 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 2/26/2011 8:42 PM, Leonardo Azpurua wrote:
>
> "The Natural Philosopher" <tnp(at)invalid(dot)invalid> escribió en el mensaje
> news:ikb2fq$o8f$1(at)news(dot)albasani(dot)net...
>>
>> That's maybe possible if you are writing OO code, but it is often
>> simpler when having functions that modify several different variables,
>> to have then as globals, in order not to either pass pointers to the
>> functions, or try and work out a way to return more than one variable
>> from a function.
>
> Hi,
>
> Perhaps I have become thick with the years, but I can't imagine why a
> function should be required to modify several different global variables.
>
> If you don't want to enter into all the details and subtleties of OOP,
> fine. But using and object to pack all the data required by a given
> process, and pass it to any function that might need it is even easier
> than having to remember the names of every global variable involved in a
> complex procedure.
>
> I am completely new to PHP, but it is universal programming common
> sense, like using structs in C, or Records in Pascal.
>
> --
>
Leonardo, as you will learn if you stick around here long enough, TNP is
not a programmer (nor the electrical engineer he claims to be). He is
merely a hacker who thinks he knows everything - but knows very little
about good programming practices. He makes all kinds of claims as to
what he's done in the past, but his comments in this newsgroup have
repeatedly shown the opposite.
It's why he uses a pseudonym instead of his real name - he doesn't want
anyone to find out who he really is.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|