[OT] Names of JSPs - start with upper-case or lower-case

I had always used lower case for the whole file name with '_' to split
the names. Lately I have been starting with a lower-case and using
camel case for the various words. One of the developers here uses
uppercase like class names. I was thinking of using this because of the
camel humps feature. What do you think?

--
Norris Shelton
Sun Certified Java Programmer

8 comments

If you name the pages like verbs, then they should use a naming convention like methods, if, on the other hand, you name them like classes, then upper-case first. Example:

DocumentList.jsp
listDocuments.jsp

I prefer the latter myself.

0

Is that an "industry standard"? I've never seen/read anything on the
subject but would also be interested to hear what other people use. We
have a nasty mix of each right now.

Patrik Andersson wrote:

If you name the pages like verbs, then they should use a naming convention like methods, if, on the other hand, you name them like classes, then upper-case first. Example:

DocumentList.jsp
listDocuments.jsp

I prefer the latter myself.


--
"A man's ethical behavior should be based effectually on sympathy,
education, and social ties and needs; no religious basis is necessary.
Man would indeed be in a poor way if he had to be restrained by fear of
punishment and hope of reward after death."
[Albert Einstein, "Religion and Science", New York Times Magazine, 9
November 1930]

0

listDocuments.jsp

R

In article <cps7dj$do4$1@is.intellij.net>, Brad <brad@dontuse.com>
wrote:

Is that an "industry standard"? I've never seen/read anything on the
subject but would also be interested to hear what other people use. We
have a nasty mix of each right now.

Patrik Andersson wrote:

If you name the pages like verbs, then they should use a naming convention
like methods, if, on the other hand, you name them like classes, then
upper-case first. Example:

DocumentList.jsp
listDocuments.jsp

I prefer the latter myself.

0

I personally dislike the word Industry Standard. It means about as much as Real World. Just bullshit words to try to add extra value to something ;)

The naming convention I mentioned is just a suggestion from me. I could see how someoone would name files like that. The reasoning goes along the lines of: verbs get java-method naming, nouns get java-class naming.

0

Patrik Andersson wrote:

If you name the pages like verbs, then they should use a naming convention like methods, if, on the other hand, you name them like classes, then upper-case first. Example:

DocumentList.jsp
listDocuments.jsp

I prefer the latter myself.


Well, since the directories of the JSP files get packages and the JSPs
become servlet classes internally, I prefer the DocumentList.jsp naming
convention. I also think of a JSP as a view (a noun) and not something
that actually DOES some work (a verb), because that should not be part
of the view. Well, just my personal opinion of course. :)

Michael

0

What a jsp-page is translated into before compilation is not interesting regaring its naming. And the name of the class file is totally container dependant. Neither of those two facts are interesting.

The other things you said are the alternative to how I name jsps. NOthing wrong with it imo.

0

In article <29330735.1103273344502.JavaMail.itn@is.intellij.net>,
Patrik Andersson <pandersson@gmail.com> wrote:

What a jsp-page is translated into before compilation is not interesting
regaring its naming. And the name of the class file is totally container
dependant. Neither of those two facts are interesting.

The other things you said are the alternative to how I name jsps. NOthing
wrong with it imo.


No there isn't, it's like arguing about how to name html files, however,
if you were interested in following some type of standard so people who
come to, or use, your project know what to do and how to name things,
and then it doesn't look like a mix of unorganized stuff. See other
post I posted about where to find the suggested naming conventions.

R

0

Robert S. Sfeir wrote:

No there isn't, it's like arguing about how to name html files, however,

post I posted about where to find the suggested naming conventions.


I didn't know about that naming convention Sun proposes. I think no
convention will make everyone happy and nevertheless it is good to have
conventions (even if you personally dislike them).

But I still wonder why they picked this convention. You probably never
name classes like verbs, since it's not the class that does work but the
method (which usually is named like a verb). So I really don't get the
point in naming JSPs like verbs (e.g. processLogin.jsp in the Sun
example). At least for me this sounds like the JSP itself does some
processing. Though a JSP could contain the code for processing the
login, it should (in my opinion) either be a login form or what is
displayed after a successful or failed login. But it should not process
the login. This is what a servlet should do. So i would never name a JSP
something like processLogin.jsp but maybe LoginForm.jsp or something
like that.

But well, as I said before, proposed conventions will never make
everybody happy. :)

Michael

0

Please sign in to leave a comment.