Re: Static or OTF creation?




   IMHO, I would create the pages only when the user request it.  I take this
opinion based on the following.

   int kakadoodle()
   {
           char* p = malloc(large number)'
           
            if( something )
                  p is used
           else  /* p is not used */

        free(p)
    }

    On above, you are requesting memory that might never be used, This will
slow down your app and make the code a bit ureadable.

    I prefer:
   int kakadoodle()
   {
          char* p = null
           
            if( something )
                  malloc p and useit.
           else  /* p is not used */

        if(p) free p;
    }

   Again,  if you app is small, it really might not make a difference.

Harring.


--- Steve & Patti Getzinger <psatg bluemarble net> wrote:
I am wondering in concept which is the better way to go. I am doing a 
small app with a notebook. Some pages will never be seen unless there is 
a problem. In reality if they bail in the beginning none of the pages 
would be seen except page0. So in theory is it wiser to create based on 
if's or create statically and then call according to the same if's that 
would have created OTF?

TIA
Steve

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



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