My Coding Convention Comment Tag HTML Comment Tag [<!-- Write your comments here -->] CSS Comment Tag [/* Write your comments here *...
My Coding Convention
Comment Tag
[<!-- Write your comments here -->]CSS Comment Tag
[/* Write your comments here */]JavaScript Comment Tag
[// Write your single comments here]
[/* Write your multiple-line comments here */]
Naming Convention
Follow S-I-D Rule:- Short: a name must not take long to type and, therefore, remember;
- Intuitive: a name must read naturally, as close to the common speech as possible;
- Descriptive: a name must reflect what it does/possesses in the most efficient way.
File Naming Convention
Use lower case url slug (most web servers are case-sensitive when it comes to handling files).rangseyhome-log.jpg
HTML Naming Convention
HTML tag and HTML style attributeThe HTML standard does not require lowercase tags, but use lowercase (stricter document types like XHTML demands lowercase).
The HTML style attribute has the following syntax:
<tagname style="property:value;">
Use space to separate each combination of property and value.
For color hex code, use lower case.
<div style="color: #0000cd; background-color:#ffffff;"></div>
HTML class attribute and HTML id attribute
<div style="color:blue; background-color:#ffffff;" class="message-box" id="message-box"></div>
JavaScript Naming Convention
A/HC/LC Patternprefix? + action (A) + high context (HC) + low context? (LC)
Actions: get, set, reset, remove, delete, compose, handle
Prefixes: is, has, should, min, max, prev, next
Singular and Plurals
const friends = ['Bob', 'Tony', 'Tanya'];
Naming Convention for Variables
var dogName = 'Droopy';
function get_name(dogName, ownerName) {
return '${dogName} ${ownerName}';
}
class DogCartoon {
constructor(dogName, ownerName) {
this.dogName = dogName;
this.ownerName = ownerName;
}
}
function DogCartoon(roles) {
return (
< div >
< span > Dog Name: { roles.dogName } < /span>
< span > Owner Name: { roles.ownerName } < /span>
< /div>
);
}
class DogCartoon {
constructor(dogName, ownerName) {
this.dogName = dogName;
this.ownerName = ownerName;
}
getName() {
return '${this.dogName} ${this.ownerName}';
}
}
COMMENTS