At 07:17 PM 5/4/99 -0700, Bob Ebert wrote:
>>In the Palm paradigm, an application is basically just a glorified
>>collection of scripts, and the only thing holding it together is
>>global memory.
>
>Yes, exactly.
>
>But that's not necessarily bad.
>

I didn't say it was - thats just how it is.

>
>On the other hand, the object oriented approach would mean 4 bytes extra
>for every object that allows userData.  (Forms, windows, lists, controls,
>etc.)  Add that all up, and it can be significant space. ...and most apps
>probably won't use most of those pointers.

This is mostly true - you're assuming OO means C++ and use of classes,
which is fair enough.  However it wouldn't cost much for the OS to allow
the developer to specify the structure to use as a form.  (Ok, using C++
would mean that you can insist that it derives from "CFormType").  This way
they could attach as many pieces of data as they wanted.

>In conclusion--a global isn't really any worse: it's 4 bytes of dynamic
>heap gone either way.  And in many ways it's better: there are only as many
>as necessary, they're much faster to access, and the OS doesn't get
>involved.

It isn't a good thing if you buy into the "globals are bad things" philosophy.

>
>KISS?

In general you are correct - Simple is often the best, but there are things
to be said for a little complexity when it offers more gains than loses.

Reply via email to