From the course: Visual Studio Code Productivity Tips
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Refactor the code
From the course: Visual Studio Code Productivity Tips
Refactor the code
- [Instructor] Writing code is a constant exercise in developing your skills. First, you write and test code to ensure that it works, and then as the project progresses, you find ways to improve and change the code. This process, known as refactoring, involves restructuring your code without modifying its runtime behavior. Refactoring enhances the quality and maintainability of your project. I'm looking at my code here in this RefactorHere.js file and I see some improvements that I can make. One of the first changes is to refactor this variable shown on line eight. Currently it's named ar, which isn't very descriptive. While JavaScript developers favor short names, I can enhance clarity by adding just a few characters to make the variable name more descriptive. Some of the other refactors I'll do in this one is I'll take this literal value, this magic number, and I'll extract it into a constant. And then, you'll notice that I have this expression here that's repeated in two places…
Contents
-
-
-
Explore and navigate code: Go to Definition3m 24s
-
(Locked)
Explore and navigate code: Find All References2m 21s
-
(Locked)
Explore and navigate code: Peek Definition1m 26s
-
(Locked)
Refactor the code5m
-
(Locked)
Tidy up code layout with Format Document4m 18s
-
(Locked)
Create custom keybindings for commands2m 18s
-
(Locked)
Fun with brackets and braces2m 49s
-
(Locked)
Simple technique to move code blocks52s
-
(Locked)
Use Emmet notation to quickly add boilerplate text8m 19s
-
(Locked)
Use font ligatures to add symbols to your code3m 31s
-
(Locked)
Better document tabs5m 10s
-
(Locked)
Declutter the UI2m 16s
-
(Locked)
Work with files3m 12s
-
(Locked)
Expand selection with keyboard shortcuts2m 14s
-
-