[jdom-interest] Stirring up Trouble

Brett McLaughlin brett.mclaughlin at lutris.com
Wed Jul 19 07:20:50 PDT 2000

OK, guys, I'm about to wreak some potential havok.

Because of my book being out, I've been forced to do a bit of "technical
support" on a lot of Java and XML questions. I'm sure Jason and
Elliotte, as well as Simon, know what I'm talknig about here. Lots of
people have latched on to the word "intuitive" in JDOM, as in "it is
intuitive to use", and warped that thing all out of content. So let's
set the record straight (for myself, as well).

"Intuitive to use" and "does what the developer expects" are perhaps
deceiving terms. JDOM isn't some sort of smart compiler that does the
right thing even when you tell it to do the wrong thing. It can't fix
your mistakes, and it won't make up for a complete lack of knowledge
about XML. In fact, I would say that if you don't know Java or XML at
all, you have no business complaining about why JDOM doesn't work (you'd
be surprised at how many mails I get from people who "don't really know
Java" but find "the examples don't work"). Feel free to lurk and ask
questions, but don't complain that something you have no idea about
doesn't magically fix your errors.

So what does that mean? That I am finding that intuitive is a tough
word. It means "does what the developer expects, as long as the
developer's expectations are correct." Sort of tricky, huh? In light of
that, I find that JDOM should /not/ be intuitive in the case where the
developer is wrong, as that could encourage really bad concepts and

So, here's the crux of (at least) this email:

getContent(boolean preserveWhitespace);

is perfectly intuitive.

But what does


do? I'll be the first to admit that I argued and argued that this should
not return whitespace, because that wasn't intuitive to the user. But if
the user things XML content ignores whitespace around textual content,
they would be WRONG. And I would be WRONG to encourage that belief. So
I'm now advocating that getContent() simply call getContent(true) and
return text with whitespace around it. I'm so convinced I'm willing to
make the /very/ painful changes in my book and defend the decision to
roughly 25000 readers (already!). So let the talks begin, I'm wanting
this resolved ASAP.


Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 

More information about the jdom-interest mailing list