On 12/6/00 11:19 PM, "Conor MacNeill" <[EMAIL PROTECTED]> wrote:

>>> Well we have been debating whether that will continue to be true :-)
>> 
>> I'm -1 on typing them.
> 
> If you don't give a (good) reason, I'm afraid I'll have to downgrade that to
> a -0 :-) (Seems to be the new rule :-)

The rest of my message, and the contents of the message I just sent are my
reason for -1'ing. And it's not a new rule -- it's been the rule that a -1
needs a reason since way before we wrote the Jakarta Project Guidelines
(which contains that provision) that were based on the Apache Project
Guidelines which came from FreeBSD or some such in the long distant path.

Properties in java.util.Properties are text and we all know how to use them.
Attributes in XML files are text when you pull them out using SAX or
whatever -- and we all know how to use them.

> Hmmm. We probably have different approaches. I don't know of an occasion
> where I use a property to which I haven't given a value. Since the original
> ant behaviour, IIRC, was to replace such usage with "null", I can't imagine
> many other people did either.

The original behavior of ant was "null" because of hashing probably.. Look
up a nonexistent key in a Hashtable and you get null. I'm pretty sure that's
why even though its probably been over a year since I wrote that code. If I
had thought about it for more than 2 minutes then, I would have replaced
null with "".

> Implicitly giving undefined properties an empty value can bite badly. It has
> happened to me and I have seen it happening to users on the ant-user list.
> It is hard to debug and IMHO, it is better to fail-fast.

Like I said -- we have this same case with mistyped attribute names in
unvalidated XML files (which we parse in Ant as unvalidated) as well as in
Properties files as well as in most configuration files laying on your hard
drive. If its not a burning problem in those areas, I fail to see why we
should be more strict.

-- 
James Duncan Davidson                                        [EMAIL PROTECTED]
                                                                  !try; do()

Reply via email to