Use Visual Studio Code To Develop Python Programs

From a perspective of a long time Emacs user

Ceshine Lee
Sep 25, 2018 · 3 min read

Joel Grus offered his critique of Jupyter Notebook in a recent talk. I think most of his points are valid and recommend you to read the slides or watch the talk. However, one thing that caught my attention is Mr. Grus’s Python IDE(Visual Studio Code). It looks so good that I decided to give it a try, which led to this blog post.

Some disclaimers first: Which IDE to use is a very personal choice. I don’t claim that Visual Studio Code is the best Python IDE that everyone should use. This is just my opinionated review, and what works best for my use case might not work best for yours.

I tried using Atom and PyCharm to write Python code before. Python support in Atom wasn’t powerful nor easy to use enough for me. And PyCharm is too heavy-weight and a simple format-on-save requires some dancing around to be done. I think Visual Studio Code has found a good middle ground: it’s lightweight enough and yet still powerful enough.

For years Emacs has been served me well. And I’ll continue to use it when I have to work in command line. The Python support of Emacs is really mature. Here are some packages I put in my dotfiles and sync to every computer I use:

  • elpy
  • flycheck(pylint)
  • anaconda-mode
  • py-autopep8
  • jedi
  • magit

IMO Visual Studio Code and its extensions are on par with these packages, if not better. Some Emacs folks shared their experiences with VS Code and pointed out the license issue. I’m not sure I should care or not, but other than that the comments were more or less positive.

Some VS Code Highlights:

  • Onboarding: VS Code is very easy to learn and use. Extensions come with sensible default configurations.
  • Terminal: the embedded terminal is pretty close to the GNOME terminal. While the one in Emacs is almost unusable without some serious customization.
  • Git integration: some say magit in Emacs is really good, but usually I’d rather directly use Git in the command line, and use gitk when I want a graphical interface. Built-in Git function in VS Code is good enough, and you can even install extensions like gitlens to do more.
  • Built-in support for various linters, including mypy. (There are emacs-flycheck-mypy and mypy-mode Emacs packages.)
  • Command palette: should be straight-forward to use for Emacs users (M-x command).
  • Nice built-in debugger interface.

I’ve written a short markdown document and published it on Github Gist. It’s still a work in progress and I’ll keep updating it with things I’ve found useful. (I’ve only started using VS Code for a few days.)

(This post is also published on my personal blog.)

Veritable

Towards human-centered AI. https://veritable.pw

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store