>>>>> On Wed, 14 Sep 2005 12:11:41 -0400, Robert Story <[EMAIL PROTECTED]> said:
Robert> A string offers a reduction in the chances for collisions. That's why I prefer strings in cases where registrations are used. They're much more resistant to collisions. When asked for a magic number, people tend to use something like 9999 even when 2^32 possibilities exist. When asked for a string they're much more likely to use something specific to what they're doing, which will likely be unique. As an example, I was trying to come up with a random OID the other day somewhere in the net-snmp tree and I couldn't remember which oids in the play space had been recently referred to by various things and didn't want to conflict with any outstanding discussions. I guessed in the end, after doing a quick grep. I'm still not sure I got something unique. I'm quite sure that had I been able to use a string of "ISMS" I would have been quite unique, even though I had a huge OID tree of integers to try and avoid collisions with. Robert> And in my continuing effort to avoid prolonged battles over Robert> the 'right' way to do things, I'll note that either way should Robert> check for uniqueness during registration, so it should be a Robert> big issue. Yeah, the biggest problem comes with collisions between 2 3rd party apps. DS> There's not really much to choose between the two approaches. DS> IMO, the numeric style has two (relatively minor) advantages: DS> DS> a) Numeric comparisons are more efficient than DS> string-based ones (so there'd be slightly less DS> overhead involved in looking up which port to use) Robert> I agree that this is and advantage, and a relatively minor Robert> one. In this case I think so too. I agree absolutely, though, that numbers should be used in high-use fields. Robert> I think this is the best argument in favor of strings. Again, Robert> no more battles over it, especially since I'm not offering to Robert> write the code. ;-) He who writes the code always wins right ;-) That's the advantage of doing the work instead of arguing about it :-) -- Wes Hardaker Sparta, Inc. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders