Professional Practices and Advanced JavaScript

Just because we’ve nearly finished this course doesn’t mean our coding journey is coming to an end. On the contrary, it’s only just beginning. As the saying goes: as one code block closes, another opens ...

The aim of this final chapter is to give you some ideas and inspiration about where to go next.

Coding best practice

Now that we can code with confidence, it’s time to set up our coding environment and learn some best practices that can help us take our coding to the next level.

Style guides

Another good practice is to follow a coding style guide. These are usually written by teams of developers to ensure they agree on how they write code. The style guides used by Google and Airbnb are both publicly available. Following the standards outlined in a style guide will help improve the quality of the code we write and help to keep our coding style consistent.

We can also use linting tools that will highlight any style errors in our code and help ensure that any code we write follows the style guidelines we've specified. Try pasting some of your code into the JSLint online tool for a report on its quality.

Version control

Version control software allows us to track all the changes that are made to our code, because every version of our code is kept and can be recalled at any time.

One of the most popular tools for source control management is Git, written by Linus Torvalds, the creator of Linux. Git enables us to roll back to a previous version of our code. We can also branch our code to test new features without changing the current stable codebase. Git is a distributed source control system, which means that many people can fork a piece of code, develop it independently, then merge any of their changes back into the main codebase. It also means that if we make a mistake, we can roll back to the last working version of the code.

Git uses the command line to issue commands, but there’s a large number of GUI front ends that can be installed to give a visual representation of the code, including the excellent GitHub Desktop.

There are also various online services that can host Git repositories, including GitHub, GitLab and Bitbucket.

Get hands-on with 1200+ tech skills courses.