Re: [gnome-db] Minor API change and MySQL [update/delete]_row



On Wed, 2003-10-29 at 04:18, Paisa Seeluangsawat wrote:
> > As I said, all GNOME libs never use constas the object argument
> > (object_whatever (Object *object...), so we shouldn't do the same.
> 
> > hmm, no standard there I think, just look at the header files of
> > some GNOME libs.
> 
> When the code breaks Gnome convention, you say it is wrong.  But to
> the code that breaks standard programming convention, you live with
> it.  Why?
> 
> There are objective goals like portability, simplicity, ease of use,
> reducing programmer errors, and others.  And then there are guidelines
> like,
> 
>   1) no const object as the first argument
> 
>   2) return const if value shouldn't be edited
> 
>   3) don't force users to cast of const
> 
yes, I know, but a more important objective is to make the API really
easy to learn for people who know similar APIs. That is the case for
GNOME libraries, which are what libgda will be used on most of the time.
So I guess it is more important to follow those conventions.

> When guidelines are coined, there are rationales behind them on how
> they help us achieve the said goals.  You don't apply these guidelines
> just because "someone said so", or "all my friends do it".  You apply
> them because they help you achieve the objective goals.
> 
I apply them because we are talking about a problem we introduced in the
API because of the const stuff. If that were the right thing, we
wouldn't be talking now about it :-)

> When it seems like we can't adhere to all these guidelines, we should
> decide which guidelines lead us closer to the goals.  We can do this
> by reexamining the rationales behind them.  In some cases, we might
> even find that these guidelines aren't intrinsically in conflict, but
> the fault lies in our design.
> 
> The rationales behind 2), and 3) are well known.  So, I say we find
> out the origin and rationale behind 1) before we decide about
> updatable/static row syntax.  Is that OK?  I'm new to Gnome
> programming so, older timers (including Rodrigo) are probably more apt
> at this.
> 
I think 3) is the problem, and that's why we are talking about it. Then,
if we look at the other libraries we are using ourselves (glib, for
instance), we see that that problem does not exist, since const is only
used in a very few places. That doesn't seem to make problematic using
it, and I've never heard people complaining about non-const returns. So,
that's the rationale behind doing the same in libgda. It will solve the
problem we have ourselves introduced by trying to be "sintactically
correct".

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]