At 2:44 PM -0800 1999/03/12, J Robert Ray wrote:
>I don't like the idea of checking to see if feature X exists, and using it
>if it does, or otherwise coding around the missing feature. This would
>bloat the code and we are all striving to make small, efficient apps. The
>option of #ifdef'ing everything and releasing multiple versions of the same
>program is not very appealing either, as it is tedious and confusing for the
>users.
>
>Is there another approach that is more appetizing?
This is the age-old problem of progress versus backward compatibility.
Short answer: There is no perfect solution.
Long answer:
Checking to see if a feature exists before using it is the RECOMMENDED method of
coding. This should be done early during application startup so that if the feature is
required, the user can be alerted immediately. If the feature is optional, then what
the app does depends on what the app does...
Also keep in mind that checking just the OS version by itself does NOT guarantee any
particular collection of APIs. Our licensees' products, for example, may provide
additional functionality in a particular version of the Palm OS than our devices
running that same OS version.
Some suggestions to think about...
1. Require the latest Palm OS.
2. Go with the least common denominator (don't use the new APIs).
3. Write your app so that it behaves differently depending on
which APIs are available at run-time.
4. Use conditional compilation to produce multiple versions of
your app, each targeted for a different set of Palm OS APIs.
5. ???
Regards,
Jim Schram
3Com/Palm Computing
Partner Engineering