How to accelerate your code work?

How to accelerate your code work?

Tools that support the software development process play a fundamental role in the development and convenience of daily programming work. In this article, we will review two tools: Save Code and Template String Converter.

Save Code - the most commonly used scripts at hand

Save Code is an extension that can make it much easier to store, organize and use frequently used code snippets between projects. Have you happened to write a script that you find extremely useful and would like to use in other repositories without having to rewrite it from scratch? You'll do it with Save Code.

How does Save Code work?

With the extension, we can save the scripts we use most often and use them between different repositories. It is a personal library of code snippets that can easily access and use in any project. This process saves time and effort by eliminating the need to search through previous projects for the same or similar solutions.

Review your snippets easily

Once we save our scripts using Save Code, we can browse through them easily using a custsom command. In most development environments where we are used to using keyboard shortcuts, we can use command+shift+f8 (or Windows/Linux equivalent) and we will get to our snippets.

Tired of reading? Watch this video to see how Michał makes things quick and easy (available in Polish only).

Wyświetl ten post na Instagramie

Post udostępniony przez Ragnarson (@ragnarsoncom)

Template String Converter - easy string interpolation

Another tool worth exploring is Template String Converter. With this small extension, you can interpolate strings effortlessly in the code editor. Did you happen to work with long strings, in which it was necessary to use  a number of quotes and concatenation operators? Template String Converter can significantly simplify this process.

How does the Template String Converter function?

When you want to use string interpolation in the code editor, instead of the traditional quotation marks and concatenation operators, just use ${}. This is where Template String Converter comes into action. After typing the ${} character, the editor automatically converts a regular string into a backtick (` character). Inside the backtick we can place our variables, using the  ${variable_name} notation. The result is more readable and easier to maintain code.

Here is a simple example of how to use the tool:

const name = 'John'; const age = 30; const message = `Cześć, nazywam się ${name} i mam ${age} lat.`; console.log(message);

In the example above, we use Template String Converter to interpolate the name and age variables into a messagestring. Instead of concatenating the strings using the + operator, we can conveniently place the variables inside the backtick and tag them with  ${}.

With Template String Converter, we can increase the readability and conciseness of our code, which translates into more convenient work and less chance of making a mistake.