Mastering Clean Code in JavaScript
4.2 (94 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
615 students enrolled

Mastering Clean Code in JavaScript

Learning the JavaScript framework is good and cleaner JavaScript is even better
4.2 (94 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
615 students enrolled
Created by Packt Publishing
Last updated 3/2018
English
English [Auto-generated]
Current price: $80.99 Original price: $124.99 Discount: 35% off
15 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4.5 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Structure better code in modules with ease
  • Write pure functions, avoid side-effects, and go functional
  • Explore design patterns and practices and how to use them
  • Get familiar with unit testing
  • Proper error handling in JavaScript
Course content
Expand all 36 lectures 04:41:13
+ Clean Code with JavaScript
7 lectures 01:03:58

This video provides an overview of the entire course.

Preview 03:07

We have to begin the journey to cleaner code from somewhere and variables is the perfect place to start.

Clean Variables
11:10

Developers often have mistaken ideas surrounding lexical scope.

Lexical Scope and let
07:16

Functions form the majority of a developer’s JavaScript code. Functions need to be as clean as possible.

Clean Functions
15:24

The this keyword is a common source of bugs for developers who often produce bad code because of it.

All about this
07:40

The viewer would benefit from a few tips on how to more effectively work with objects and ES6 classes.

Clean Objects and Classes
10:35

JavaScript code can often become chaotic, especially in big projects.

Using a linter
08:46
+ Clean Code with Functional Programming
6 lectures 31:34
Some viewers may not know what is functional programming.
Preview 04:49

Pure functions are fundamental to functional programming.

Writing a Pure Function
04:30

ES6 came with some really nice features that help you transform your code with functional programming.

Object.assign and the Spread Operator
06:32

Using a typical for loop is a thing of the past in JavaScript.

Forget the Loop with Map and ForEach
06:05
Map and forEach are good only for certain cases.
Reducing an Array
05:58
Sometimes you need to only accept some of the items from an array.
Filtering an Array
03:40
+ Modules in JavaScript
7 lectures 44:15

JavaScript has evolved massively during the last decade and modules have been an integral part to this evolution.

Preview 06:21

All module definitions like CommonJS and AMD have their roots in the module pattern.

The Module Pattern
07:07

Nearly all modern JavaScript applications make use of npm. There cannot be clean code without npm.

The Node Package Manager
05:31
CommonJS is the module definition most widely adopted by NodeJS projects.
CommonJS
04:59

AMD came as a solution to the synchronous nature of CommonJS not being optimal for a browser environment.

AMD
07:23

ES6 modules are the solution to multiple problems and come time they will be the norm in most JavaScript projects.

ES6 Modules
05:40

ES6 modules in combination with webpack 3 and the uglifyJS plugin offer the ability to remove unused code from the final bundle.

Tree-Shaking with Webpack
07:14
+ Design Patterns and Principles
8 lectures 01:19:59

Classes should be designed to do one thing. This is not often the case in JavaScript applications.

Preview 13:37

JavaScript functions, modules and classes should be closed to modification but open to extension.

The Open/Closed Principle
09:34

The Liskov substitution principle is often overlooked in JavaScript apps.

The Liskov Substitution Principle
05:29

An interface should not force a class to implement methods and functionality that it does not need.

The Interface Segregation Principle
07:50

Dependency Injection can really transform your applications to something great.

The Dependency Inversion Principle
10:49
Sometimes you need to have a single instance of something available in your code.
The Singleton Pattern
11:22
The observer pattern is useful when you want to watch properties.
The Observer Pattern
11:26
Sometimes you want to hot-swap similar algorithms at runtime.
The Strategy Pattern
09:52
+ Testing
4 lectures 36:01

Beginning the section, the viewer needs to be prepared for the heavy stuff that will follow regarding unit testing.

Preview 06:28
Simple unit tests are only good for simple problems and small codebases.
Installing and Using Jasmine
10:55

To make the most out of unit tests you need to incorporate them into your workflow.

Test Driven Development
12:43

After the red part of TDD you are ready to implement the functionality until all tests are passed.

Making the Tests Pass
05:55
+ Error Handling
4 lectures 25:26
Error handling plays a very important part in software engineering.
Preview 07:19

Promise rejections are much different than simple errors.

Catching Errors from Promises
05:47

The error handler we built in a previous section was a nice start.

An Error Handler with Strategy
07:11
Error Management is not just about showing nice messages to the user.
Logging
05:09
Requirements
  • Prior JavaScript programming knowledge is essential
Description

Alongside HTML and CSS, JavaScript is one of the three core technologies of World Wide Web content production. 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.

In this course, you will learn various concepts and techniques, essential principles, patterns, and practices for writing clean code in JavaScript. You will be introduced to some general guidelines on how to better structure your JavaScript code. You will then learn about clean code best practices while working with variables, functions objects, and the latest ES6 classes. Next, you will discover functional programming, how to write pure functions, and how to use built-in functional methods. You will then move on to modular JavaScript and explore the various ways you can structure your modules. After that, you will master various design patterns and programming principles. Unit testing is very important and you will learn to do this with Jasmine and Karma, to make handling errors easy.

By 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. Overall you will learn to write better code with improved readability.

About the Author :

Dimitris Loukas is a software engineer currently writing Single Page Applications and using the latest version of JavaScript with Aurelia and Angular for a trading software firm. He is also finishing his Computer Science studies at the University of Athens. He has worked for two start-ups in the past, is active in the open source community, and loves taking up small side projects. He has mastered Angular, Aurelia, and VueJS and is now interested in entering the ReactJS world. He is fascinated by modern JavaScript and where the web is going.

Who this course is for:
  • JavaScript developers