Re-working GNCId: removing GNCIdType enum

Derek Atkins warlord@MIT.EDU
24 Nov 2001 18:56:29 -0500


Dave Peticolas <dave@krondo.com> writes:

> The query<->scm conversion routines in engine-helpers.c uses
> that enum. But if they change to strings, the obvious solution
> would be to use the strings themselves as part of the encoding.
> 
> dave

GRF...  I think changing them to strings would inherit
too much overhead.  In particular, switch statements
would turn into a long if (!strcmp()) {} else if (!strcmp()) {}...
One would think that all those strcmps would be a lot of extra
overhead compared to the switch().

Instead, I think I just want to use a guint32 and let modules
choose their own (unique) type-value (as opposed to their
own unique type-string).

Do you have a preference of strings vs. integers?

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available