Mac Python Editors
You want a good editor when programming in Python, in particular if you are going to work on larger and more involved projects. But, there are so many options to choose from, so what do you choose, and how do you know if you want an editor or an IDE?
In this post I give my thoughts on three Mac code editors or IDEs that I currently use:
- Sublime Text
- Visual Studio Code
- PyCharm
Sublime Text
Sublime Text, or just Sublime, is cross-platform editor that is best characterised by the word fast, but also that it is very configurable and consumes only limited system resources (memory and CPU).
Sublime is sold as a commercial product, but it is very well-priced and provides much value for the cost. Years ago, I paid some small amount for a Sublime 2 license, and (amazingly) all upgrades have been free, even the upgrade from Sublime 2 to the much improved Sublime 3.
Sublime has many good text editing features built-in, and there is a large eco-system of developers writing plugins that augment the editor in various ways to make it even better.
What I like about Sublime:
- Really fast and snappy
- A minimal, non-intrusive UI
- Focussed on being a great text editor
- Simple code project management: A folder and its subfolders is project (No project management file or folder needed for saving state)
- Loads of plugins with nearly unlimited possibilities for extending and configuring the editor to your linkings
I use Sublime for most of my Python coding, and most other text editing. I like it mostly because of the pure focus on just being great at editing and manipulating text. What I really miss in Sublime is an interactive debugger (the one that exist seems to be unmaintained).
Visual Studio Code
Microsoft's Visual Studio Code, or just Code, is their take on the category of cross-platform editors that are in-between a pure text editor and a full fledged IDE. Code is fully open source free software, which in itself is a remarkable feature for a product coming from Microsoft.
Code appears fast and not too resource intensive, which is impressive as it is actually written in typescript/javascript and runs on the Electron framework. Though, in my experience, it happens sometimes that the resource (memory and CPU) usage grow drastically when using Code. However, it seems as it is much less likely to happen now than with the earlier versions of the product.
There is huge eco-system of developers contributing to Code itself and writing plugins, of which there are many thousands. Installing a lot of plugins will definitely lead to bloat and huge use of resources, so I tend to be very careful with that.
What I like about Code:
- Pretty fast and snappy
- The Python plugin, which makes Code a Python IDE with code linting, autocomplete ("intellisense"), interactive debugger, and all.
- Loads of plugins with nearly unlimited possibilities for extending and configuring the editor to your linkings
What I don't like about Code:
- No concept of a folder as a project, without creating a hidden-folder of files to keep state of various IDE stuff.
- The UI is rather "busy", like most Microsoft products, too many features and status indicators are shown on the screen.
- The nagging feeling of Microsoft spying on me: I turned of the telemetry, and as many as the so-called Online Services (where Code sends data to Microsofts servers about the code I write) as possible without breaking basic functionality, but each time I start the app I get the sense that there is something more I should do to ensure my privacy. Not ok!
I haven't used Code a whole lot, mostly for the above reasons, but I think it is great tool to have, and I particularly enjoy using the more advanced features of the Python plugin, such as autocomplete and debugger.
PyCharm
PyCharm is a full fledged IDE for Python, with all the features you would expect from an IDE, such as autocomplete, debugger, testrunner, code refactoring, and good documented support for a lot of the popular frameworks and application areas. PyCharm has a free Community Edition that I use, and also various paid options that include more features.
PyCharm is written in Java, and it uses a Java based UI library, which have a look-and-feel that is quite different from that of native macOS applications.
Creating a project in PyCharm is an involved process, just as it is the case for all other IDEs I have used. There is no easy way to just point to folder and make that a PyCharm project (or, if there are, I have missed it).
What I like about PyCharm:
- Visual interactive debugger
- Autocomplete ("intellisense")
I pretty much only use PyCharm when I have a need for debugging a complex Python project, but for that it is great.
Other notable Mac text editors
I assume that there are many more Mac editors than I know about, but here are some alternatives to those I listed above:
- BBEdit
- TextMate
- Komodo Edit (and also Komodo IDE)
- Spyder (an IDE focussed on scientific calculations)
- Atom
There are also the terminal editors, such as Nano, Vim and Emacs, which are all popular choices.