Browsed by
Tag: vs code

The First C# Code Snippets You Should Memorize (Visual Studio Code)

The First C# Code Snippets You Should Memorize (Visual Studio Code)

Code snippets are pre-written portions of code that you can summon with just a few keypresses. By automatically setting up much of the syntax required in common programming language structures, snippets speed up the mundane parts of coding.

Depending on the size of its content, a particular code snippet will save you anything from the small handful of keypresses it takes to set up the curly brackets of an if statement to the several lines of code it takes to write the skeleton of an entire class or method.

Plus, they are just plain fun to use. Look at all the code that I get “for free” here:

Read More Read More

Debugging with Deftness in Visual Studio Code

Debugging with Deftness in Visual Studio Code

Here’s a short list of keyboard shortcuts for debugging in Visual Studio Code. Right now, I don’t do a good job using many of these myself, but by writing them down for you I’m reminding myself to integrate them into my workflow. These hotkeys won’t shave hours off of your debugging sessions, but they may make the experience more enjoyable.

Inserting Print Statements

Sometimes all you really need in order to discover what your code is doing wrong is a simple print statement in the middle of a complex set of operations.

Read More Read More

Visual Studio Code Gets a Faster Terminal

Visual Studio Code Gets a Faster Terminal

The new version of Visual Studio Code from September’s development cycle is out now. The ample list of improvements, which includes macOS touchbar integration, regular expression highlighting, and a smarter process for extracting methods, also includes a behind-the-scenes overhaul of the integrated terminal renderer. The update claims to improve performance of the integrated terminal by 5 to 45 times over the previous version and abolishes forced frame skipping. Admittedly, I hadn’t noticed any issues or slowdown myself. But, as the update states, the newer renderer will at the very least be lighter on your laptop’s battery.

The VS Code team accomplished the performance improvements by migrating away from a memory-intensive DOM design to a single HTML Canvas element. Apparently, the old design invoked a sizable amount of garbage collection due to the number of elements being managed by the layout engine, while the new approach allows for more direct drawing via the one canvas element. Additionally, instead of re-drawing the terminal in its entirety after every change, the new renderer only draws the areas that have changed between frames.

More details can be found in the official update.

Speedy Project Navigation in Visual Studio Code

Speedy Project Navigation in Visual Studio Code

Writing code faster involves more than quick typing and editing. Programming projects often span tens or even hundreds of source code files. It’s easy to waste time browsing around in the project directory for the specific file you’re after, so it’s worth learning a few shortcuts that will grease the transition from one area of the project to another.

Thankfully, editors and IDEs like Visual Studio Code come with all sorts of niceties to help you manage the complexity of dealing with a large codebase. Here is a shortlist of the shortcuts that will shorten your programming the most.

Read More Read More