

Mostly you should use nouns for naming variables and properties. Especially in JavaScript, justifying types through naming matters more as JavaScript is value typed not data typed language (In JS, we don't declare type while declaring variables).ĭata stored in variables or properties are of value types - number, string, boolean, array, etc, therefore, name them accordingly. The name of a variable or property should represent the type or any kind of data stored in it. Rules of Naming Variables (and Properties) But when you keep trying to come up with better names in code, you will lean towards perfect. The name should reflect whatever is inside instead of confusing your junior developer.Īlthough you don't start giving perfect names on the first go. Whatever name you provide to the variable, function, class, etc should describe it well. Good naming of variables, functions, properties, methods, classes, constants, etc makes code more predictable and contributes highly towards clean coding. Prior JavaScript programming knowledge is essential.If you aren't going to name it better then people aren't going to interpret it better. This course is for JavaScript developers who would like to immerse themselves in the concepts and practices of writing clean code. Overall you will learn to write better code with improved readability. Unit testing is very important and you will learn to do this with Jasmine and Karma, to make handling errors easy.īy the end of the course, you will have learned to learn clean coding with functional programming, explored various modules in JavaScript, and designed patterns and principles.

After that, you will master various design patterns and programming principles.

You will then move on to modular JavaScript and explore the various ways you can structure your modules. Next, you will discover functional programming, how to write pure functions, and how to use built-in functional methods. You will then learn about clean code best practices while working with variables, functions objects, and the latest ES6 classes. You will be introduced to some general guidelines on how to better structure your JavaScript code. In this course, you will learn various concepts and techniques, essential principles, patterns, and practices for writing clean code in JavaScript. You can write terrible code in any language, but if you wanted to try to write terrible code that works, JavaScript would be your language of choice.
