[Splashy-devel] 4a/6 Make simple interface for splashy_video.h

Otavio Salvador otavio at debian.org
Mon Aug 14 23:59:01 UTC 2006


Tim Dijkstra <newsuser at famdijkstra.org> writes:

> On Mon, 14 Aug 2006 10:01:19 -0400
> Pat Suwalski <pats at xandros.com> wrote:
>
>> Tim Dijkstra wrote:
>> > [4/6 was to big for the list]
>> > Remove "splashy_video_t * video" from the functions argument list,
>> > make an instance of splashy_video_t local to splashy_video.c
>> > instead. That way the rest of splashy doesn't have to know about
>> > splashy_video_t at all. 
>> 
>> Isn't this the sort of change that is opposite of how most projects 
>> organize their code? I've always considered it good style to pass a 
>> pointer to an "object" rather than have it globally-accessible...
>> 
>> The other patches look good.
>
> Well, we will always have only one splash screen, so there is no need
> to have a pointer to a specific one. It seems a bit silly to always
> pass around an object if it's always the same object. Global objects
> are of course frowned upon, but it think this is an instance where it
> is useful.

I personally agree with you. It also makes the code simple to read and
avoid to pass obivious objects around all the code in every function call.

> If we still decide to stay with a pointer variable, I definitely want
> to change the struct, now it exposes a lot of structures to the
> user of the library that really should be private.

I think we can improve both. There's a lot of things that can be
reworked to make them more flexible and clear to someone who reads the
code by first time.

-- 
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: otavio at debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://www.freedom.ind.br/otavio
---------------------------------------------
"Microsoft gives you Windows ... Linux gives
 you the whole house."



More information about the Splashy-devel mailing list