CODING TIPS

bk_bharathikannan
3 min readJul 24, 2022

*** Rules We Should Follow ***

  • Focus on the Fundamentals……
  • Name should be readable and simple.
  • Name should be meaningful……
  • Code formatting is necessary because your code makes it easier to read…
  • Use command line because users can easily understand why you use this line of code…….
  • Write own sudo codes….
  • Watch coding videos ……..
  • READ BOOKS….…⬇️
  1. Enhances your knowledge. …
  2. Increases your imagination and creativity……
  • Practice, practice, practice……….
  • Use name casing……⬇️

FOR EXAMPLE:-

*To create an user object like names,email,age ,array,etc.,

BAD NAMES ⬇️

*Avoid Meaningless Names*
-let foo = 'what is foo??';
-let names(){
name1=pikachu;
name2=bk;
}
*Avoid single letter names*
-let x= [1,2,3,4,5];
*Avoid Abbreviations*
-let cat = 'cat or category??';

GOOD NAMES ⬇️

*Name should be meaningful*
-ler arr=[1,2,3,4,5];
-const person = {
firstName: "pikachu",
lastName: "bk",
age: 18,
eyeColor: "black"
};
-const square = function (number) {
return number * number;
}
-const x = square(4);
OR
-function square(number) {
return number * number;
}
*This is readable*
-const admin = new admin();
-database.insert (user);

NAME CASING

Snake case(snake_case)

snake_case is the process of writing compound words so that the words are separated with an underscore symbol (_) instead of a space,as follows:

*Raw: user login count

Snake Case: user_login_count

*Raw: send response

Snake Case:send_response

Camelcase(camelCase)

The use of a capital letter to begin the second word in a variable name,as follows:

*Raw: user login count

Camel Case: userLoginCount

*Raw: send response

Snake Case:sendResponse

pascalcase (PascalCase)

Pascal case combines words by capitalizing all words (even the first word) and removing the space, as follows:

*Raw: user login count

Pascal Case: UserLoginCount

*Raw: admin role

Pascal Case: AdminRole

Kebabcase(Kebab-case)

Kebab case combines words by replacing each space with a dash (-), as follows:

*Raw: user login count

Kebab Case: user-login-count

*Raw: side drawer

Kebab Case: side-drawer

— * — * — * — * — * — * — * — * — * — * — * — * — * — * — * — * — * — * — *

THINK TWICE💭-code onces!

THANKS_FOR_READING_!🌟

❤️“Have a Fine_Day”❤️

--

--