So, sorry I didn't respond earlier; for some reason, the mailing list
didn't send me these messages until hours later.  Thanks for all your
comments; I can't speak authoritatively for the entire expert group, but
here are my own personal opinions.

On Thu, 21 Mar 2002, Steve Bang wrote:

> While Java also supports meaningful naming, in this case the goal is
> to create tag libraries for non-programmers.  So, names like "x" and
> "fmt" are not terribly clear.  The HTML tags are not cryptic, and
> whenever possible, neither should JSP tags.

Overall, I'd certainly never argue for tags that are cryptic, but HTML
tags certainly use abbreviations, just for the sake of brevity.  There's
an <a> tag instead of <anchor>; <p> instead of <paragraph>; and <img>
instead of <image>.  In fact, nearly all HTML tags are cryptic if you
don't like abbreviations.  :-)

Concerning analogies with Java, I'm not sure I agree.  The J2SE libraries
certainly use reasonably long names for classes, but namespace prefixes
are more like packages, and the standard libraries all use abbreviations:
java.io, java.util, java.lang.  Like the J2SE libraries, we don't
abbreviate the tag (class) names:  forEach, forTokens (instead of 'f' or
'ft').

At any rate, it looks (to me) like we're in good company.

> I undestand that the HTML tags don't need a prefix, but we should keep
> in mind the intended audience and minimize confusion.  If the standard
> JSP tags were <j:useBean>, <j:setProperty>, etc., it would be
> confusing -- would the "j" represent Java or JSP?  And, if HTML tags
> had to have a prefix, would you find "h" a good prefix?  I doubt it --
> I'd much prefer "html" as a prefix.  To avoid collisions and other
> confusion, I'm leaning toward having "jstl" at the beginning of the
> prefixes.  Shawn, hasn't this issue been discussed among the expert
> group? Or, was this something no one ever thought about discussing?

This definitely came up; it was debated at length in the context of
whether to provide a single JSTL tag library or multiple tag libraries.  
The rationale for the perceived inconsistency in the naming is what Henri
said:  simplicity to type.  After all, 'core' or 'jstlcore' are just as
opaque as 'c' without ANY context; given that JSTL is the standard and is
expected to be used widely, we figured that

 <c:forEach>

would be much easier to read and identify than

 <jstlcore:forEach>

FMT could be called 'f', but it does take a slight back-seat to the core
library in this regard.  I'd expect many pages just to use 'c'.  The XML
tag library might have ideally been prefixed 'xml', but the XML standard
itself rules that out :-), and we figured we'd promote the library by
giving it its own, one-letter abbreviation.

Whatever we choose would be somewhat arbitrary, so we ultimately opted to
ease the page author's burden of typing!

-- 
Shawn Bayern
Author, "JSP Standard Tag Library"  http://www.jstlbook.com
(coming this summer from Manning Publications)


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

Reply via email to