Re: GAtomic int finals (#63621)



On Sun, 2004-02-22 at 04:33, Sebastian Wilhelmi wrote:
> Hi Owen,
> 
> > I don't have a big opinion here, but my basic reasoning would be:
> > 
> >  - The operation is a bit "odd" - you aren't going to know how to use it
> >    unless you've seen it before.
> >  - So sticking to the name found elsewhere is better than trying to 
> >    come up with a name that makes the operation obvious.
> 
> Ok, but then we shouldn't use both swap and exchange as in
> g_atomic_int_exchange_and_add and g_atomic_int_compare_and_swap.
> We should stick to one and if we want to use established terminology,
> that would be compare_and_exchange, as swap_and_add doesn't exists
> according to google. But what an endless function name:
> 
> g_atomic_pointer_compare_and_exchange

37 characters isn't coming anywhere near the record; we just
added:

  gtk_radio_menu_item_new_with_mnemonic_from_widget

> We could use ptr instead of pointer (like in GPtrArray) and xchg/cmp
> instead of exchange/compare however:
> 
> g_atomic_int_xchg_and_add
> g_atomic_ptr_cmp_and_xchg
> 
> seems a bit easier to handle. 

Eck, I'd much rather have them written out. Generally, we follow the
"avoid abbreviations" rule in Glib/GTK+; the trouble with abbreviations
is that they make readers decipher then and they make writers remember
each time exactly how the word was abbreviated.

Regards,
						Owen





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