----- Original Message ----- 
From: "zerol tib" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 05, 2004 9:30 AM
Subject: Why some variables and methods have leading "_" in the servlet
compiled from JSP?


> Howdy,
>
> When I am reading the servlet compiled from JSPs, I find that
> There are  some variables and methods have leading "_" while others
> not:
>
> _jspxFactory
> _jspx_out
> _jspx_includes
>
> Why these identities have the leading underline? Is there a naming rule?
>
I have seen programs where programmers used an underscore as the first
character of all class variables and used variable names that didn't start
with underscores as local variables.

This practice is actually *against* the principles that are stated in "Code
Conventions for the Java Programming Language" at
http://java.sun.com/docs/codeconv/index.html. If you look at Chapter 9,
Naming Conventions, it has the following under Variables:

----------------
"Except for variables, all instance, class, and class constants are in mixed
case with a lowercase first letter. Internal words start with capital
letters. Variable names should NOT [emphasis added] start with underscore _
or dollar sign $ characters, even though both are allowed.
Variable names should be short yet meaningful. The choice of a variable name
should be mnemonic- that is, designed to indicate to the casual observer the
intent of its use. One-character variable names should be avoided except for
temporary "throwaway" variables. Common names for temporary variables are i,
j, k, m, and n for integers; c, d, and e for characters."

----------------
Of course these are only conventions, not rules, so people are free to
ignore them unless their shop standards say otherwise.

Rhino


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to