Code Style

code-style
Follow the link below, Ilya Cantor gives very good recommendations:
http://learn.javascript.ru/coding-style

The main things that I would like to draw your attention to:
1) The names variables and methods should be clear and concise, don’t skimp on characters.
2) Methods should not exceed 30-40 lines, they are intended for solving a single specific task, and poor methods do everything.
3) Comment your code using JsDoc.
4) Declaring variables is best done at the beginning of the method. Searching for variables throughout the body of the function is a doubtful pleasure.
5) Store long conditions in variables: var myMother = (woman === whoKnowsDateOfMyBirthday === whoLovesMyFather === notMyGrandMother)
6) Try to use comparison without type casting (may have unexpected results):var fakeZero = false, isZero = fakeZero == 0, isTrueZero = fakeZero === 0;
Here you will get: isZero: true, isTrueZero: false
7) Never store different data in one variable, the variable must exactly match the name.

 

We are looking forward to meeting you on our website soshace.com

About the author

Stay Informed

It's important to keep up
with industry - subscribe!

Stay Informed

Looks good!
Please enter the correct name.
Please enter the correct email.
Looks good!

Related articles

How I Built an Admin Dashboard with Python Flask

In this article, I will share the how I built an admin dashboard. I will give a step by step guideline on how I built this application with Python ...

Getting started with Git Hooks using ghooks

Git hooks are configured scripts that are executed at specific moments during git operations. ghooks is a package that configures git hooks so that ...

React Native vs. Flutter: Which One Would Suit You Better?

Unveiling pros and cons of such cross-platform development frameworks as Flutter and React Native. Discover what suits you ...

No comments yet

Sign in

Forgot password?

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy

Password recovery

You can also try to

Or use a social network account

 

By Signing In \ Signing Up, you agree to our privacy policy