[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xom-interest
Subject:    Re: [XOM-interest] Re: XOM 1.0d23 Last Call
From:       Elliotte Rusty Harold <elharo () metalab ! unc ! edu>
Date:       2004-02-10 13:08:23
Message-ID: p06010201bc4e87ae8e49 () [192 ! 168 ! 254 ! 4]
[Download RAW message or body]

At 9:47 PM +0000 2/9/04, Bill de hÓra wrote:

>I consider namespace scenarios convenience 
>clutter for the most part. But then again, with 
>this line of thought, most OO methods are 
>convenience clutter including getChildCount (why 
>not just compute the count?).

Because it would be hugely more expensive. 
getChildCount() is O(1). Iterating through the 
elements until you got the last one would be O(N) 
with a big juicy multiplier for catching the 
exception. getChildCount() is  more convenient, 
faster, and more consistent with good OOP 
principles. (Specifically use exceptions ionly 
for exceptional cases.)

--

   Elliotte Rusty Harold
   elharo@metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic