Excellent Programming Tricks

Naming convention strategy | How I declare data types?

Dach(-) Vs Unsercore(-) between data types
  1. Underscore: Suppose your variable name is excellent_programming_tricks. Now if you click anywhere on the variable the whole variable is selected not the word. That's why underscore is most preferable for variable naming.  
  2. Dash: Suppose your variable name is excellent-programming-tricks. Now if you click any where on the variable the world would be selected instead of whole variable name. Dash is not support in PHP function name.
Camel Case Vs Pascal Case between data types
  1. Camel Case (medial capitals): Where first case should be lower case. New word letters should be capitalized. Ex.: excellentProgrammingTricks.  
  2. Pascal Case: First word and remaining words must be capital. Ex. ExcellentProgrammingTricks. For class name we use for pascal case.
  3. Note: No Space or underscore is required for both case.
My strategy
  1. Basically the data type strategy mainly depends on project types. Suppose your client/project leader specifies how you declare your data type style then it's a blessing for you. Otherwise you follow your own strategy. Whatever your strategy is, it must collision with other programmer.
  2. CSS
    1. Class name: Dash use or camel case.[ class="abc-xyz" or class="abcXyz"]
    2. ID: Pascal Case.
    3. Name: Lower letter with underscore.
  3. JavaScript/PHP/WordPress
    1. Constant: Upper case. 
    2. Variable name: Lower case/camel case or the first letter is a small letter. [ var iName ="CEO Dipen"]
    3. Function/Property name: Lower case/Camel case starting with underscore. [_abcXyz()]
    4. Class name: Pascal case.
    5. Instance of a class name: Camel Case.

No comments:

Post a Comment


Authentic аnd Excellent

Website

HTML Template

Wordpress Theme

Database applications

OR

Application services?

Excellent Programming Tricks (EPT) || Iftekhar-IT || We develops the Web applications and the WordPress templates. || Excellent Programming Tricks (EPT)

© 2020 Blogger Theme by Iftekhar IT || Excellent Programming Tricks

Execllent Programming Tricks. Powered by Blogger.