Switching to VS.Code
After years of using Sublime Text 2 I decided to switch to a newer code editor. The tipping point was wanting to use the Black Python formatter; ST2 doesn’t have support for it. (ST3 does but I don’t own that). VS.Code seems to be the new hotness so I’m giving it a try. So far I like it! Some thoughts:
Good: it feels very fast. It’s amazing how slow so many programs feel on my very fast desktop computer. VS.Code feels fast.
Good: the extension store. There’s a rich ecosystem of addons. I’ve already lost track of what all I’ve installed: Python, WSL, SQLite ... I’m still looking for a good JSON extension (the one I tried is very very slow). I’m still understanding the extension model; I keep having to install black and pytest and pylint in every project’s venv. That’s awkward but kinda makes sense.
Bad: It’s an IDE. I don’t like IDEs, I just want a tool to edit text.
Good: It’s an IDE! I can code with tools as good as the Turbo Pascal environment I used in 1986. VS.Code is notable for being a cross-language IDE. It’s also a fairly low impact IDE, you can mostly use it as a text editor to start and it’s fine. But I’ve started making peace with the Python IDE stuff and it works fine. It runs unit tests nicely (albeit without support for continuous testing on save.) The debugger works.
Mixed: linting and PyLance warnings. These are enabled by default and mostly don’t seem to show up. But I just got a warning from PyLance because os.getenv can return None and I was passing its output to a function that needs a string. But I was anticipating that and already had a try/catch block for that. At least you can suppress warnings on a line by line basis with the comment # type: ignore
Good: black. It’s instantly freed me about worrying about code formatting. My only complaint with the default black setup is it does weird multiline formatting if any lines go over 88 characters by default. You can change the line length but the whole point of black is one standard consistent style, so I hate to change that.
Mixed: Intellisense suggestions. It’s very nice when exploring but the default settings are awfully chatty. Currently trying out these settings to tone it down some:
"editor.tabCompletion": "on",
"editor.quickSuggestionsDelay": 500,
"editor.suggestOnTriggerCharacters": false,
Good: The command palette UI is nice. VS.Code didn’t invent that but seems to lean on it heavily. Emacs users used to typing M-x will feel right at home.
Bad: preferences. For years the only way to change preferences in VS.Code was editing settings.json. There’s now a GUI for it but it’s clearly generated from the JSON specs and it shows. It’s clumsy.
Good: Settings sync. You log in via Microsoft or GitHub and VS.Code syncs your settings, UI state, etc. It’s optional.
Mixed: the look and feel. Something about the very spare UI chrome and the color schemes feels wrong to me. Maybe I’ll get used to it. I’m using the Dark+ theme now and it’s mostly fine, I just feel a bit dislocated. I have a particularly hard time with the filename tabs. This customization might help:
"workbench.colorCustomizations": {
"tab.border": "#888",
"tab.activeBorder": "#888",
}
Great: git integration. I don’t think it’s trying to be a full git client but it has a nice UI for quickly seeing what code has changed and staging and committing code. The diff viewer is terrific.
Good: I can launch VS.Code from a WSL shell with code . It automatically loads the VS.code project file for me. It also seems to detect my venv/ directory and use it.
???: security. Every time I load files from a new directory VS.Code asks me if I trust the files in the directory. WTF? I guess VS.Code or some extensions will run code snippets it finds in files you are editing in some circumstances. That seems like a terrible security risk and passing it off to the user is not good.