Connect with us

Articles

The Coding Tricks That Save Me Hours Of Time At Work

I’m now a decade deep into my programming career, so today, I figured I would write down some of my favorite time-saving hacks and functionalities.

I’m now a decade deep into my programming career, so today, I figured I would write down some of my favorite time-saving hacks and functionalities.

Hopefully, some of them will be new to you, or even get the same kind of head-slapping “how did I survive without this before”.

The ToDo Explorer

I remember watching over the shoulder of an experienced colleague when I was still an apprentice, and every second sentence out of my mouth was “how did you just do that?”

A lot of those were keyboard shortcuts, but I remember being actively stunned when I discovered the ToDo-Explorer thanks to him — after like two years of my apprenticeship. That thing changed my life.

In essence, all it does is collect your comments that start with // todo, and it’s a great practice to run through that little window before you commit changes or create a pull request.

And another nice benefit is how it allows you to quickly jump between classes and functions you are working on — complex solutions can really mess with your ability to find things.

The Shift-Alt-L shortcut

This is highly specific to Visual Studio and ReSharper, but I assume other IDEs have similar functionality.

You use it while your cursor is in your editor window, and it will then open the solution explorer, and mark the currently active class in your folder structure. This sounds simple, but it’s a total game changer.

Before, when you wanted to find your class in the tree view, you would have to scroll up, take a look at the namespace, then navigate the folder tree until you find it. This easily takes a minute or two and lets you lose your focus — and now, instant. And you don’t even have to scroll up and lose focus of your currently active line of code.

I often use this to check small things, like “Am I working on the unit- or integration test BaseSetup class?”

I honestly use this key a dozen or more times per day, and it always gives me fuzzy feelings, as well as ‘Nam flashbacks to the time before I learned that shortcut.

The breakpoint window

One thing that routinely messes with me is how debugging code results in like two dozen open tabs. Now, where the heck was that class where I just set the breakpoint?

Visual Studio has a really nifty breakpoint window that you can find through Debug/Windows/Breakpoints — and by god, that thing lives rent-free on my screen real estate.

Outlook sorting rules

Any kind of “real programming” lives and dies by communication. Any kind of “real coding” lives and dies by the lack of interruptions. The balance between the two? Totally unattainable, but that doesn’t mean you can’t try.

It is no exaggeration to say that creating email rules and sorting incoming mail into the right folders will save you an hour each day, and possibly more. The evolution of that is to change which of these rules get to trigger a desktop alert — and then, you’ll likely want to silence your Outlook notifications on your phone to not get notified twice for an email you already read at your computer.

Writing weird shit into bug descriptions

When you discuss any kind of coding question, bug or feature request, you will likely brush past a possible follow-up concern, or your team member talks about a function that you will never remember the name of unless you write it down — so here is your chance to pour all those tiny details into the bug description.

I have linked everything from prior change requests, tutorials, code snippets from a different project — and I always write down which classes are affected if there is a planning meeting where things are discussed. It saves SO MUCH time to simply copy-paste the class namespace into the description, so when you tackle that task two weeks later, you don’t have to spend years to find the entry point that you already found before.

Multiple cursors in VS Code

I actually don’t use VS Code much at work, though at home it is my exclusive editor for more than just code.

However, there are times when I really love the efficiency of how VS Code handles multiple cursors. They are a bit like search-and-replace, only better, and once you get the hang of them, they start to make so much sense. Other people can actually explain them better, I just love to use them.

HTML, JSON files, anything with a repetitive structure — multiple cursors can save you so much time and sanity, it’s unreal.

Database code is another great example, I often find myself pasting Oracle packages into VS Code, turning an hour-long mess into a five-minute task, then pasting it back into the database tool to run and commit the changes. If you’ve ever had to change a function signature in like fifty places, then VS Code will be your friend.

I mostly use Control-D (selects the current word and then the next occurrence of it) as well as Control-Alt-D (creates a new cursor directly under your current one).

Full Article: keypressingmonkey @ Level Up Coding

Advertisement

Trending