RE:[gtk-list] Re: How do I send arguments with signals?



[...]
>One thing that puzzles me, and perhaps someone may be able to enlightent
>me on this, is why most of the functions are declared static??  I've
>never seen another program use so many static functions as the GTK/GIMP
>does...... not criticism, but not being a Computer Scientist I'm just
>curious. I just do it to follow suite, without really understanding the
>importance of it!
[...]

This is done to prevent namespace pollution. A static function is not
exported from the source file it's defined in. While this means that it's
not callable from code outside the source file, it does mean that the
programmer need worry much less about the names.

In a library, all functions other than those *explicitly* intended to be
exported should be made static, because you've no idea what naming
standards a programmer using the library is going to be using... there is
nothing more annoying than having to rename a perfectly innocuous function
because it clashes with a name in a third-party library due to bad
programming.

David Given
dg@freeyellow.com



--




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