As I dove head-first into the world of programming, Visual Studio Code (VSCode) became one of my favorite tools to get the job done. Since then, I've learned a couple of ways to really improve my own programming experience. This article focuses primarily on Python, but may apply to other languages as well.

Python Docstring Generator

The first extension to cover off is the Python Docstring Generator! Developed by Nils Werner, this extension makes generating docstrings a much easier experience. Once creating a class or a function, simply enter """ and a template is generated. The extension automatically pulls out any arguments and lets you tab through all the fields you may want to populate.

Let's see what this looks like:

None
Automatically adding formatted docstrings! Source: Nik Piepenbreier

Better Comments

Next, we'll cover off Better Comments, which allows you to add tags to your comments to make them easier to identify down the road. The extension comes with five default comment styles pre-loaded, covering off important information, questions, to-do items, and more. You can modify the existing ones, change their colors, or create your own!

It's been instrumental in creating ever-growing scripts in my data science journey.

None
Giving visual cues to your comments! Source: Nik Piepenbreier

Learning Helpful Keyboard Shortcuts

The true powerhouse in increasing my productivity has been taking a few moments to remember some critical keyboard shortcuts! I'll list out some of my favorites here:

  • CTRL/Command + Enter: insert a new line directly below, regardless of where you are in the current line
  • ALT/Option +Shift + Up/Down: duplicate your current row up or down
  • ALT/Option + Up/Down: move the current row up or down
  • ALT/Option + Shift + Right: hit this twice to select everything within a current bracket(this option is called smartSelect.grow , if it needs to be re-mapped)
  • CTRL/Command + /: comment out the current line
  • CTRL/Command + [ or ]: indent lines inward or outward

Using Multi-Cursors to Make Editing Less Painful

Multi-cursors can make you a power-house when editing text. There are several use cases where this might happen and VSCode has amazing built-in shortcuts for these:

  • CTRL/Command + ALT/Option + Up/Down: insert another cursor above or below
  • CTRL/Command + D: insert another cursor at the next occurrence
  • CTRL/Command + Shift + L: add multi-cursors to all occurrences
  • CTRL/Command + U: undo the last cursor operation if you've added too many

Bracket Pair Colorizer 2

Finally, one last extension: Bracker Pair Colorizer 2. This extension adds color to your brackets to better identify matching pairs. While VSCode does a good job of highlight the current brack you're on, this extension gives you a full overview of the brackets in your file.

None
Coloring your brackets to make them easier to find! Source: Nik Piepenbreier

Thanks for reading!

Thanks so much for reading this post! I hope you found it useful and at least something in the list made your programming experience a little more seamless.

If you have any other suggestions for me to try, let me know in the comments!