Tom Early
Tom Early

Reputation: 165

ExtJS 4 Naming Conventions

I was discussing with my colleagues the correct naming conventions for classes, variables and objects etc within ExtJS 4, but we all had differing views.

Is there an "official" stance on this?

Upvotes: 15

Views: 2321

Answers (4)

dbrin
dbrin

Reputation: 15673

There absolutely is an official stance. It is outline in section 2 of the Class System guide. Here is the link: https://docs.sencha.com/extjs/7.2.0/guides/core_concepts/classes.html#core_concepts--classes-_naming_conventions

Upvotes: 8

Hugh
Hugh

Reputation: 1459

Official, I'm not sure, but in my opinion..

  • Root namespaces and constructors are UpperCamelCase
  • Sub-namespaces, styles, events and xtypes are lowercase
  • Methods, attributes and variables are lowerCamelCase

Upvotes: 7

dougajmcdonald
dougajmcdonald

Reputation: 20047

I recently attended an Ext.js 4 training course (delivered by Sencha) and their advice was the following:

  • Top-level namespaces and the actual class names should be Camel Cased. everything else should be in lowercase.
  • Acronyms should also be camel cased
  • Do not use underscores, hyphens an any other non-alphanumerical characters

So Hugh is pretty much on the money

Upvotes: 3

dmackerman
dmackerman

Reputation: 2966

It's preference, really. What Hugh said are good guidelines, but I actually prefer namespaces to be in ALL CAPS, but our apps have fairly short namespaces so it doesn't look ridiculous.

Upvotes: 3

Related Questions