|
Posted by AnrDaemon on 12/03/07 12:21
Greetings, Jerry Stuckle.
In reply to Your message dated Sunday, December 2, 2007, 05:03:10,
> But what I was referring to was not so much $sqlsomething or $rsomething
> (although I do like $result, $queryNameResult or similar. I meant the
> use of $k, $_k especially. You shouldn't start a variable name with an
> underscore (it's generally reserved for system stuff), and it's very
> difficult to see what you're doing in your loops with such similar names.
While You partially true, I'd point to the fact that __names reserved for
system use.
Im using $_name variables to identify read-only temporary storages such as
query strings ($_q typically) and resultsets ($_r, $_rc or something), which
is used almost immediately and assigned only once. Larger code part where I
use such names was completely fit to screen and easy to observe.
While I know that such short names are not allowed due to lack of meaning, I
have this behaviour properly documented in project description.
And it is really easy to code short names while You have mass of dealing with
external I/O (either database, files or remote websites).
Another use of _names is an internal object properties and methods, where it
is easier to determine if that property/method is public or private/protected.
--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>
[Back to original message]
|