1. #1
    Sencha User hobophobik's Avatar
    Join Date
    Jul 2010
    Location
    UK
    Posts
    22
    Vote Rating
    0
    hobophobik is on a distinguished road

      0  

    Question Naming Conventions and Case?

    Naming Conventions and Case?


    Hi,

    In particular regard to case, is there a set naming convention for Ext (or even JavaScript).

    As far as I can determine..
    • Root namespaces and constructors are UpperCamelCase
    • Sub namespaces are lowercase
    • Methods and variables are lowerCamelCase

    I only ask so that I can make use of this in my own applications.

    Cheers

  2. #2
    Sencha - Community Support Team VinylFox's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,501
    Vote Rating
    7
    VinylFox will become famous soon enough VinylFox will become famous soon enough

      0  

    Default


    That prety much summs it up.

    Also, styles, events and xtypes are always all lowercase.

  3. #3
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    That's the convention I am using, except that every part of a namespace (e.g. part1.part2.part3) is lowercase. In some cases, a part of the namespace could be in UpperCamelCase, but that would be because that part of the namespace is a singleton. I think that's why they choosed to make Ext written 'Ext' and not 'ext'. Because it has some static methods. (e.g. Ext.get()) ... but I might be wrong

  4. #4
    Sencha User hobophobik's Avatar
    Join Date
    Jul 2010
    Location
    UK
    Posts
    22
    Vote Rating
    0
    hobophobik is on a distinguished road

      0  

    Default


    At first I thought it was totally random, it was only after writing the above post I started seeing a pattern.

    As a beginner I've found the naming convention slightly confusing and frustrating; Despite knowing the name of a component, I'd always have to double check the API docs for the case of the namespace, class and method.

Similar Threads

  1. TextField - force lower case entries to upper case?
    By Bucs in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 30 Jun 2010, 3:07 AM
  2. making an column data editable in some case not editable in some other case?
    By mayanknext in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 24 Mar 2009, 1:44 AM
  3. naming conventions: id, xtype
    By mjlecomte in forum Community Discussion
    Replies: 3
    Last Post: 3 Sep 2008, 1:06 PM
  4. [2.0] HTML Editor Formatting Conventions
    By InKiev in forum Ext 2.x: Bugs
    Replies: 2
    Last Post: 6 Feb 2008, 11:13 AM

Thread Participants: 2