From the course: Visual Studio Code Productivity Tips
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Refactor the code - Visual Studio Code Tutorial
From the course: Visual Studio Code Productivity Tips
Refactor the code
- [Instructor] I'm looking at my code in this RefactorHere.js file, and I think there's some improvements I can make. I can refactor this code to make it better. The first thing I want to edit is this variable name on line 11, it's called ar. And that's not very descriptive of what this variable does. In JavaScript, we like short names. But I can improve this by only adding a couple of extra characters. You know that writing code is a constant push and pull on your development skills. You write some code and you test and make sure it does what you think it will do. That it works the way you intended. And then, as you learn new techniques, or as the project progresses, you discover ways to improve and change the code. So that's what we're doing here. The first attempt at naming this. Just renaming it area, that's a better name. It only changes one line. It doesn't change line 12 and line 14. So I can fix that. Go back to the old variable name. And then right click and choose Rename…
Contents
-
-
-
(Locked)
Use Go to and Peek Definition to find code references4m 29s
-
(Locked)
Refactor the code4m 12s
-
Favorite extensions: Bracket Pair Colorizer2m 53s
-
(Locked)
Tidy code layout with Format Document6m 54s
-
(Locked)
Favorite extensions: XML Tools2m 36s
-
(Locked)
Create custom keybindings for common commands2m 40s
-
(Locked)
Favorite extensions: Spell Checker2m 40s
-
(Locked)
A simple technique to copy code blocks1m 1s
-
(Locked)
Favorite extensions: Sort lines2m 2s
-
(Locked)
Use Emmet notation to add boilerplate text6m 14s
-
(Locked)
Favorite extensions: GitLens4m 24s
-
(Locked)
Use font ligatures to add symbols to your code2m 46s
-
(Locked)
-