Coding Standards in Software Development
What are coding standards?
Coding standards means programming styles or coding conventions.
It is a set of standards and guidelines which are used at the time of writing the source program.
These all standards are rules which a developer is expected to follow.
Coding standards always vary in various companies or programming languages.
Coding standards, when implemented correctly, will give huge advantages to the produced code and also the firms implementing them.
Now we are talking about some programming language-related coding standards.
HTML Coding Standards
Validation.
Self Closing Elements - Non-empty elements must have corresponding closing tags.
Attributes and Tags.
Indentations - Documents have two spaces for indentation and no traveling of white spaces.
Doctype and layouts.
Forms.
Nested Elements.
Attribute Values.
PHP Coding Standards
Package Names - Package name must start with upper case letters, Package name not consist the special symbol, It consists a-z, A-Z, 0-9.
Namespace and Class Name - Namespace is used in categorization and ordering.
Importing Namespace - Namespace is always import using the ‘use‘ keyword.
Method Names - The name of the method is always start with lower letters and it doesn’t consist the special symbols.
Variables Names - They start with small letters but variable names should be self-explanatory.
Constant names – They are always returned in uppercase letters and they include the TRUE, FALSE, or NULL keyword.
CSS Coding Standards
Color Variables - Provide standard color variable using {$color}.
Device Rules - It defines several device classes which can adjust the behavior responsively.
Image inlining.
Why Coding Standards are important?
Generally used for ease of others in team or client who might look into your code at some point in time.
Code is easy to read.
Code is easy to understand.
Code is easy to maintain.
How we can develop our code more readable?
Commenting and Documenting.
Consistent Indentations.
Avoid the Obvious Comments.
Code grouping.
Consistent Naming Scheme.
Avoid deep nesting.
Limit Line Length.
File and Folder organization.
Write Naming Conventions with examples?
Names are written in lowercase Latin letters.
Words are separated by a hyphen (-).
For boolean modifiers, the values are not included in the name.
1)Variable Naming Conventions -
Variable names are case-sensitive.
The variable name can be legal identifiers.
The variable name doesn’t start with any numbers or any special symbols and always starts with the alphabet.
2)PHP Naming Conventions -
Use camelCase, not underscores, for variable, function, and method/technique names, arguments.
Use underscores for option names and parameter names.
0 Replies to “Coding Standards In Software Development”
Leave a Reply
Your email address will not be published.