Some Useful Tips And Shortcuts To Help You Code Faster


Code faster with these tips and tricks.

We’re always trying to find ways to make programmers more productive. One of the most effective ways to do this is to master your tools, and one of the most common tools we work with every day is our text editor or IDE. In this post, I’ll show you some useful tips and shortcuts that will help you code faster in VSCode so you can focus on your project rather than spending time fumbling around with your dev environment.

In this post, I’ll cover:

Managing your workspaces

Searching across files

Navigating between files and symbols

Making code changes without touching the mouse

A few weeks ago we asked you to share your favorite coding tips, tools and shortcuts. We got some great responses and decided to compile them into a post.

We had a lot of fun reading your awesome tips and tricks! Here are some of the many great ones we found:

1. Use snippets (auto-complete)

“I use snippets a lot to speed up my programming. They save me time and make my code more consistent. There are plenty of extensions for most editors that let you create your own snippet library, or you can find existing ones online.” – Laura Bocciardo

2. Use keyboard shortcuts as much as possible

“I’m always trying to improve my keyboard skills by reducing mouse use as much as possible. It makes me feel like a ninja.” – Laura Bocciardo

3. Learn regex (regular expressions)

“Learn regex! Really, regex is an incredibly useful skill that can save you hours of work.” – Laura Bocciardo

4. Keep it clean!

“I like to keep my code clean and DRY (Don’t Repeat Yourself). This saves me time in the long run as I don’t have to fix things multiple times.” – Amy O’Neill

If you are a programmer, there will be times where you have to go back through your code and change things. While for some people, this is not a big deal, for others it can be extremely time consuming. Especially if you are working on a large project, or one that has code from multiple people.

In this post I am going to give you some tips and shortcuts that might save you time when coding. These tips will work for almost all programming languages and text editors.

At this point, you probably know by now that I’m the founder of dev.to and I write about tech, startups, and programming. What you might not know is that I’ve been coding for over 15 years and have worked at a couple of startups as a founder and engineer.

Over the years, with all the coding that I’ve done, I’ve developed some habits (some good, some bad) to help me churn out code more quickly. In this article, I want to share some of the tips and shortcuts that I use on a daily basis. Let’s get into it!

Keyboard Shortcuts

The first thing you should do to improve your productivity is to learn keyboard shortcuts. There are people who can code without looking at their keyboard — they use a combination of muscle memory and touch typing to make it happen. You can see an example in the video below:

https://www.youtube.com/watch?v=dDV0w_y_D7M

Speed is great, but there will be times when you need to look at your screen or document — take advantage of those moments by using keyboard shortcuts instead of reaching for your mouse. Keyboard shortcuts allow you to

In your daily life as a developer, you will often find yourself doing the same tasks over and over again. These tasks are usually very simple actions that you don’t want to waste time on or think about (we call these mindless tasks). The thing is, there are probably ways to make your life easier by automating these tasks or using shortcuts that will save you some precious time.

You can save time using shortcuts for example by creating snippets with code you use often, such as:

a to-do list

a console log

an alert

an if statement

a loop

you can also create a snippet for functions you use all the time:

map()

filter()

reduce()

Object.keys()

setInterval()

setTimeout()

I have been coding for a while, and as I went along, I started to notice certain patterns. Some of these patterns are very useful and help me write higher quality code in less time. Here, I will share some of them with you.

Use programming conventions

This was a tough one for me. I had to go through other people’s code many times to understand how they did things, but it was worth it. Nowadays, I know how the majority of programmers do things, so if someone sends me some code to look at, it is easy for me to understand what is going on. Also, if you ever want to change your job or work with someone else on a project, this will be very useful.

Learn when to use single quotes and when to use double quotes

I love using single quotes because they are faster on my keyboard (I don’t have to press Shift), but there are times when you should definitely use double quotes:

If string contains variables that need to be evaluated or you want to use the escape character \ (e.g., ‘\n’ will be treated as n and not as new line).

If string contains both single and double quotes (e.g., ‘It’s cold outside’).

Find

1. Use interpolation to save time

Don’t concatenate strings, use interpolation instead. For example, if you’re printing a string with a value inside it, you don’t need to use the + operator to concatenate the string and the value. You can just put the value directly inside the string using ${} .

const animals = {

cat: “Miauw”,

dog: “Woof”,

bird: “Chirp”

}

console.log(“The cat says ” + animals.cat); // The cat says Miauw

console.log(


Leave a Reply

Your email address will not be published. Required fields are marked *