[ProgSoc] Jumpy code

Anand Kumria wildfire at progsoc.org
Thu Oct 15 02:05:59 EST 2009


Well the rationale in putting the conditional test within the RenderState is
that, ideally, you should not need to know the implementation details.
The rationale is applied in the Linux kernel; i.e. keep #ifdef inside the
function.

Rather than abstracting out the function call, keep it in and have it do
nothing. e.g. single processor and SMP functions can be in the call flow but
the single processor ones do not have to do any inter-processor
communication

Cheers,
Anand

On Wed, Oct 14, 2009 at 2:54 PM, John Elliot <jj5 at jj5.net> wrote:

> Anand Kumria wrote:
> > Why not:
> >
> >  public void Display() {
> >    DetachHandlers();
> >    ClearDisplay();
> >    RenderState();
> >    AttachHandlers();
> >  }
> >
> > public void RenderState() {
> >  if ( State == null )
> >     return;
> >  // other stuff
> > }
>
> Or...
>
>  public void Display() {
>    DetachHandlers();
>    ClearDisplay();
>     if ( State != null ) { RenderState(); }
>    AttachHandlers();
>  }
>
>  public void RenderState() {
>    // render state
>  }
>
> Deal!
>
>
>
>
>
>
>
> _______________________________________________
> Progsoc mailing list
> Progsoc at progsoc.org
> http://progsoc.org/cgi-bin/mailman/listinfo/progsoc
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://progsoc.org/pipermail/progsoc/attachments/20091014/887f1fbd/attachment.htm 


More information about the Progsoc mailing list