Python is one of the most popular programming languages globally and has been said to be very easy to learn. Therefore, it’s not a huge surprise that a lot of people begin programming with Python, myself included. Python is beginner-friendly, has a relatively simple syntax, is supported by its community with lots of libraries and frameworks, and is very versatile.
However, beginners often have to ask themselves what integrated development environment (IDE) or editor to use. I also faced this challenge, and while there are several IDEs and code editors available for Python, PyCharm and VS Code have remained favorites of Python developers over the years.
PyCharm and VS Code are both excellent tools for writing Python code. However, it is vital to note that while PyCharm is an IDE, VS Code is a code editor that provides a similar experience to an IDE through extensions.
In this article, we’ll compare PyCharm and VS Code using the following metrics: price, memory consumption, setup process, code management, extensions, and Git integration. Let’s get started!
JetBrain’s PyCharm has three editions. For one, the professional edition for individuals costs $89 for the first year, $71 for the second, and $53 for the third year onwards. The professional edition for organizations costs $199 for the first year, $159 for the second year, and $119 for subsequent years.
The PyCharm community and Edu editions are both free, open source projects. However, both versions lack certain features, like support for remote development, a Python profiler, duplicate code detection, database support, and some web development tools.
VS Code price
On the other hand, VS Code is an open source project and is free for commercial and private use. Features like version control, third-party integrations, and bug tracking come out of the box with VS Code regardless of the type of project or language you intend to write with it.
VS Code doesn’t come with any plugins pre-installed, so you’ll have to manually install the necessary plugins for your Python project. You can install as many plugins as you need or want, all for free.
You want to choose a tool that will take up minimal space, use minimal RAM, and run smoothly on your computer system without causing it to lag.
PyCharm memory consumption
Downloading the community version of PyCharm requires about 372MB, which probably doesn’t seem like a lot. However, when I run PyCharm on my system, it consumes about 400MB of memory, which in my opinion, is significant.
VS Code memory consumption
On the other hand, VS Code is exceptionally lightweight, requiring only about 76.2MB to download and consuming only about 40MB of memory on my computer.
Likely on account of the difference in size, PyCharm took about three to five minutes to load and open on my machine, while VS Code started up instantly. In my opinion, the difference is clear. If managing your computer’s resources is a top priority, VS Code is a better option.
Setting up PyCharm
Setting up both PyCharm and VS Code is fairly easy. However, PyCharm was explicitly made for Python, while Microsoft created VS Code for language polyglots. Therefore, after installing PyCharm on your machine, it does not require much for you to start writing your code.
Setting up VS Code
To set up VS Code, you’d have to spend some time customizing to your Python needs, which would require you to review and download various extensions like Python, Python Indent, Python Snippets, and others. However, doing so gives you more control over what your workspace looks like, contains, and does.
Beyond the setup, I’ve found VS Code easier to navigate, understand, and work with as the interface is beginner-friendly, welcoming, and easy to navigate. It doesn’t appear cluttered, and you can easily find whatever function or feature you need by searching for it.
Code management includes features like code completion, syntax highlighting, code formatting, and linting. The right choice depends on how easily each helps you write and understand Python code. Overall, I’d say both tools include similar features, providing generally an excellent code management system.
Code management with VS Code
VS Code automatically highlights areas where potential errors are made in red, making it easier for you to find and fix errors. VS Code even goes a step further by including a problems tab, listing all potential errors in a single place and making it easier for you to review them, as seen in the image below:
Note that to use Python with VS Code, you’ll need to install a formatter and linter for Python.
PyCharm code management
One key feature of PyCharm is the Search Everywhere feature, which allows you to conduct searches beyond the scope of your project. You can find files, classes, symbols, and UI elements among other things, even if it’s not in your current project:
VS Code extensions
Both PyCharm and VS Code offer significant extensions and plugins to make the experience for every developer as seamless as possible. Extensions and plugins are a great way to add more functionality to your tool or app.
VS Code extensions
VS Code was not built solely for Python. Therefore, there are several extensions you may need to make the code editor more similar to an IDE well suited for Python.
One benefit of VS Code is that it detects the type of project you are working on, then suggests and enables the necessary extensions for that project. For example, if your project is cloud based or requires cloud plugins, you can expect VS Code to suggest plugins based on the scope of the project and what you already have installed on your computer.
You can install and enable an extension right in the app, or you can visit the VS Code marketplace to search for what you need. At the beginning of 2020, there were approximately 16,000 extensions available for VS Code. New extensions are continuously being developed and added to improve the developer experience.
PyCharm was built with Python in mind, which is clear by looking at the available extensions that are geared towards improving PyCharm. There are over 3,000 JetBrains plugins available, and PyCharm is compatible with them all.
Depending on your type of project, you may or may not need to connect to a database.
PyCharm database integration
PyCharm uses a plugin called Database Navigator to allow you to connect to databases like MySQL, Oracle, PostgreSQL, and others, all within the app. With the PyCharm Database Navigator, you can create a database connection, issue queries to a database, receive database objects, and more. However, this is only available on the professional edition, which you must purchase.
VS Code database integration
Database integration is also available on VS Code with the use of an extension called SQLTools. However, VS Code’s integration still leaves room for more. A beginner might find it difficult to use or navigate, and it can be susceptible to bugs. On the other hand, PyCharm’s database integration seems to be more thorough.
A version or source control system is essential for every developer to store and make changes to their projects.
It’s no surprise that both PyCharm and VS Code have Git integration available. You can create a new Git repository, clone an existing repository, open an existing repository, stage changes, unstaged changes, commit changes, checkout to a different branch, create a pull request, and more, all within the app.
Both tools offer excellent support for GitHub, and I honestly can’t say whether one is better.
VS Code terminal emulator
The terminal emulator is one of my favorite VS Code features, because it allows you to work in any shell that is installed on your system without leaving the app.
I am able to run Linux commands, Windows commands, Git commands, and more:
As you probably can tell, I am a big fan of VS Code. However, when choosing an IDE, you have to first consider your needs.
If you want something mature, specific, and well-configured for Python, then PyCharm is the way to go. However, if you prefer something lightweight that provides the freedom to customize, then VS Code is preferable.
Both are great tools that can serve different purposes, depending on how you choose to use them. I hope you enjoyed this tutorial.