DEV Community

Matt Tarasov
Matt Tarasov

Posted on

Useful tools for programmers

Yes, I know, it's too straightforward title, but I'm going to write about tools to make your coding life easier.

Scratch files

Have you ever created a temp file for logs or for sample of code? You have to choose path for save while you just want to run it. Or maybe occasionally you have committed test.json file? Stop it!
Scratch files! That is a mechanism provided by your IDE (or plugins for it) to help you manage temporary files.

I use free extension for VS code:
Image description

And simple example. If you want to create a scratch file, you just have to press cmd + shift + p and then input:
Image description
Now you can create your temporary file and choose a type:
Image description
After that you will see an empty file with a chosen extension.
Also you can run executable scratch file, open it or delete.
And no more test.json

Bookmarks

A month ago I came to a huge project (above 500k lines of code). And the most difficult things for me is a navigation through the code. There are decades similar modules and components, same names of services, etc. I've found a simple and useful tool to solve it - Bookmarks.
Also VS code example:
Image description
Then you have to just pick a line and choose bookmark label:
Image description
You can create bookmarks with labels and without them. After creation you can find your bookmarks at the sidebar:
Image description

Stash

Imagine, you are thinking up a solution for problem, fixing a horrible bug or making a feature of your dreams... brilliant. But your manager wants you to fix a small bug. You have to switch your git to master, create new branch and so on. Time to commit WIP (work in progress)! Wait a minute... Maybe there is a more simple and beautiful way to save your work and switch branch? Yes!
This simple command saves your changes on current branch:

$ git stash -u
Saved working directory and index state WIP on main: 5002d47 our new homepage
HEAD is now at 5002d47 our new homepage
Enter fullscreen mode Exit fullscreen mode

-u - is a flag to save untracked changes
To get list of stashes:

$ git stash list
stash@{0}: WIP on main: 5002d47 our new homepage
stash@{1}: WIP on main: 5002d47 our new homepage
stash@{2}: WIP on main: 5002d47 our new homepage
Enter fullscreen mode Exit fullscreen mode

For Jetbrains IDE adepts

If you use some of Jetbrains IDE, tools like bookmarks and scratch are exist in you IDE by default and you don't need any extensions.

Conclusion

I've known about these tools accidentally and I hope they will help you.

Top comments (2)

Collapse
 
paddyredbeard profile image
Patrick B

Using scratch files is a great tip! I usually handle this by adding scratch.* to my .gitignore files. That lets all collaborators make use of such files regardless of what IDE or editor they're using.

Collapse
 
dryrainbow profile image
Matt Tarasov

This is also useful practice, thank you, I thinks it's even more useful than IDE scratch files.