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

15.03.2024

JAMstack Architecture with Next.js

The Jamstack architecture, a term coined by Mathias Biilmann, the co-founder of Netlify, encompasses a set of structural practices that rely on ...

19.01.2024

Training DALL·E on Custom Datasets: A Practical Guide

The adaptability of DALL·E across diverse datasets is it’s key strength and that’s where DALL·E’s neural network design stands out for its ...

12.06.2023

The Ultimate Guide to Pip

Developers may quickly and easily install Python packages from the Python Package Index (PyPI) and other package indexes by using Pip. Pip ...

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