Saurabh Agarwal wrote:
Is there any Coding Guidelines for Palm OS Programming.
I want to prefix my variables with some standard string/char which can tell
the data type.

For example:
b is for Boolean
d is for Double
rc for RectangleType
p for Pointer (EventPtr).

This is bad practice in general, and is incompatible with object-oriented programming. For example, suppose you're using doubles and prefix everything with d, but later decide you'd get better performance with floats. You'd be in find-replace hell and would completely toast your version control system. For that matter, you just plain don't need the reminder; if you make a mistake and use a type the wrong way, the compiler will tell you. Hungarian notation is a legacy of K&R C which no one should ever adopt. In any case, don't do it because you foolishly think it's standard, because it's not. (For that matter, don't use __var, type_t, or CType unless you know why those conventions were invented in the first place.)

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to