Re: Getting libgnome* into shape
- From: Bastien Nocera <hadess hadess net>
- To: Michael Meeks <michael ximian com>
- Cc: gnome-2-0-list gnome org
- Subject: Re: Getting libgnome* into shape
- Date: Fri, 07 Sep 2001 09:41:57 +0100
Michael Meeks wrote:
It's been a while and I didn't respond to this at all - but
perhaps it's interesting to do so:
On 29 Aug 2001, Havoc Pennington wrote:
I've seen this repeated several times - I would like to point out
that if you have a string that you parse, it still constitutes an
Of course - the real question is: is it a better API ? and
what are the alternatives.
Let's use a popular #gnome joke as an example. Say I have the
int strcmp (const char *a, const char *b);
So I change this to a moniker:
I do not now have less API. I now have an untypesafe ad-hoc
True, there is no less API - but there are a few plusses:
* Type Safety:
I think any loss in type safety here is traded vs.
convenience; ie. you can do:
And instead of a segfault on a NULL string2 pointer
you are protected, and 123 is mapped to a
string. Alternatively if you don't like automatic type
coercion, you could specify needing strings to have ''
delimitation, and then return a warning.
As for type safety - so much of our code is
horrendously type unsafe - signal emmision, closures
etc. etc. and much of our type checking is done at run time
Data based APIs such as the above are expandable; eg.
Bad example again ;) We have g_strcmp which is safer than the libc
equivalent strcmp... Just picking on you on that.
] [Thread Prev