Hi,
Our Organization having there own coding conventions, what if i does not followed Symbian
naming convention.
Please tell me the disadvanatages if any.
Regards,
Swapnil
Hi,
Our Organization having there own coding conventions, what if i does not followed Symbian
naming convention.
Please tell me the disadvanatages if any.
Regards,
Swapnil
The disadvantage is that you can not rely on Symbian naming conventions if you do not use them. But they are just names after all.
It is easy(ier) to spot mistakes during code reviews if you follow them.
If you don't follow them there is more chance to have a coding defect because some of the naming convention are very useful memonics.
If you don't follow them and then post code on this forum everybody will complain that it is difficult to read.
It is just a lot easier to convey meaning of different program components if you are adhering to a widely accepted naming convention.
The most essential reason for Symbian naming conventions is cleanup semantics, i.e. leave safety. For example, "C" classes derive from CBase by convention, which instantly tells a developer that the class is allowed to contain heap-based members, whereas other classes are not. It also tells the developer that in case of a leave, a "C" class is popped from the cleanup stack, and its destructor is called. Whereas "T" classes on the cleanup stack do not get their destructors called if a leave occurs (hence, T classes must not have destructors in the first place). "R" classes on the other hand, have their own cleanup semantics (e.g. CleanupClosePushL()). And when you see a class without a prefix letter, you know it is a class with only static functions.
Another essential naming convention is the "L" suffix in function names. If you don't append the "L" to a leaving function's name, users of your code are not aware that they are required to either use a TRAP harness or employ the cleanup stack for any heap-based data in the calling code in order to handle the leave safely. It's only when the program crashes at run-time that they're able to track the error down. Using an "L" suffix in the leaving function averts these kind of problems.
Using the recommended naming conventions makes it significantly easier to use code written by others, and for others to use code written by you. You may use your own naming conventions, but do so in addition to the Symbian naming conventions, not in their stead.