Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jun 2008

    Problem with naming convention


    Our Organization having there own coding conventions, what if i does not followed Symbian
    naming convention.
    Please tell me the disadvanatages if any.


  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Oslo, Norway

    Re: Problem with naming convention

    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.

  3. #3
    Nokia Developer Champion
    Join Date
    Jul 2004

    Re: Problem with naming convention

    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.

  4. #4
    Registered User
    Join Date
    Apr 2009

    Re: Problem with naming convention

    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.

Similar Threads

  1. Problem with CAknDoubleStyleListBox with a CAknSearchField
    By jjig in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-09-17, 00:58
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  4. Engine class naming convention problem
    By lauyk001 in forum Symbian
    Replies: 1
    Last Post: 2004-11-23, 05:04
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts