Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 27, 2022 02:33 pm GMT

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 -uSaved working directory and index state WIP on main: 5002d47 our new homepageHEAD is now at 5002d47 our new homepage

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

$ git stash liststash@{0}: WIP on main: 5002d47 our new homepagestash@{1}: WIP on main: 5002d47 our new homepagestash@{2}: WIP on main: 5002d47 our new homepage

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.


Original Link: https://dev.to/dryrainbow/useful-tools-for-programmers-ick

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To