What is PyCharm?
PyCharm is also available as a snap package. If you’re on Ubuntu 16.04 or later, you can install PyCharm from the command line. Sudo snap install pycharm-professional pycharm-community -classic.
PyCharm is an integrated development environment (IDE) used for the development of Python projects specifically. It is a very robust and well-designed system in the sense that it provides everything that a Python user would ever need. It hassupport for web elements in the form of Django and possesses equally strong tools for data science applications as well.
You may be wondering what some of these terms actually are and there is no need to worry as we will make sure that by the end of the article, you understand each and everything properly. First, we will discuss what an IDE is.
Explaining what an IDE is
All things considered, PyCharm Community Edition is a handy application that can help you create and organize your Python projects in an efficient, intuitive manner. It comes with a comprehensive. PyCharm Community Edition. Since we have covered one of the basic building blocks of the terminologies used here, we will now move on to discussing what the free version (also known as community version) has to offer to the public. I've just started experimenting with the new pycharm community edition. I have a dev environment on a USB stick which includes portable. /ppython27/Python-Portable.exe When I try to configure this, the IDE does not seem to recognize the Python-Portable.exe and the entry in the Python interpreter window reads: Unknown at F:/ppython27/Python.
To put it simply, an IDE is a kind of program where you can write code and do a number of things with it like debug it (find errors in it) and what not. Essentially, an IDE is your factory where you will be producing all sorts of codes and projects. There are tremendous amounts of IDE’s available for use in today’s world but not every one of them has what every user needs.
The requirements of every user are different and it is a wise decision to do thorough research about what exactly you need before you commit to using something particular. If you are just starting out with coding, any free IDE might do your job. On the other hand, if you have some experience under your belt, you will most likely need something that performs unique tasks that can make your daily life at work or home projects much easier. For this type of luxury, you will probably need to shell out some form of payment. Most premium IDE’s are available in a monthly subscription system and they usually offer some form of concession depending on if you are a student. To be eligible for a discount though, you might need to fulfill some of their requirements which can involve either living in a specific country/area or be enrolled in a particular institute.
PyCharm Community Edition
Since we have covered one of the basic building blocks of the terminologies used here, we will now move on to discussing what the free version (also known as community version) has to offer to the public.
Usually, the premium versions build on top of the free versions in ways that offer much more utility that an average user will typically never need. But it also means that in no way are the free versions incapable of performing the basic tasks.
If you are getting PyCharm just to get into the world of programming, everything basic will be provided to you in the free version. A basic online programming course will not indulge in anything specific like web programming and will simply cover core programming concepts that are applied in pretty much every programming language ever. If we were to make a list of some of the important features that are available in the free version, this would be it:
- Intelligent Editor
- Graphical Debugger
- Version Control Integration
- PyQt
- PyGTK
- iPython Notebook
Apart from these, the free version of PyCharm has a magnitude of other great features that will undoubtedly keep the users busy and interested at all times. In fact, almost all free versions of IDE’s are designed in ways that make the user get drawn into the world of programming and down a specific path as well. Once the user wants to, let’s say involve themselves in web development using Django and PyCharm’s specific utilities, they can look towards opting into a premium plan. There are a number of reasons why you would want to opt for a premium plan and web development is just one of them. If you want to explore the lengths you can go to, it is best to check out the official website of PyCharm to get a full list of features that are available.
PyCharm Premium Version
If you are interested in the special features that you can avail by signing up for a premium plan then keep on reading! If you happen to look at the pricing for the premium plan, you may be in shock. The reason that premium plans are expensive is that they provide professional developers with specific tools that make their day-to-day jobs much simpler and less monotonous. Professional developers will have no problem shelling out a few hundred dollars a year to get those shiny tools at their disposal since the revenue they generate with this added help is enormous.
Now that we have crossed the price shock, we will look at a premium feature, Django, in a bit more detail.
Django is a very high-level web development aid that developers are ogling over these days. You may be wondering, what makes Django so special and why is getting so much hype these days? Well, to put it simply, one of the reasons for its global acceptance is because it is open-source and therefore free to use for anyone.
It is created in a manner that allows its users to make the ideas in their turn into tangible products within the shortest possible timeframe imaginable. It’s tight security constraints and scalability allowances make it a favorite among all sorts of developers.
Other Premium features are listed below:
- Scientific Tools
- Web Development
- Python Web Frameworks
- Python Profiler
- Remote Development Capabilities
- Database & SQL Support.
How to decide if it’s time to switch to a premium version?
It’s quite simple actually. If you are bringing in good money from your freelance projects or your daily job and the complex development tasks are taking extra time off you that you feel can be utilized somewhere else, then it is a no brainer that you should start paying for the premium services.
However, it is not recommended to buy a premium version of any IDE at the start. You won’t know if you will commit to it without spending a good amount of time on it. It’s also possible that the tasks you want to buy a premium version for are available for free in a different IDE. Until you’ve done some good exploration, it is highly advised that you keep your credit card away to avoid making a purchase that you’ll regret soon afterward.
In a nutshell, Start Small, Think Big.
PyCharm vs VSCode
PyCharm Community edition and Visual Studio Code (VSCode) are both very capable integrated development environments for Python coding. While VSCode has some great support for Python coding with the 'Python' plugin by Microsoft, PyCharm is truly designed for Python development and it shows.
In this post I take PyCharm up against Visual Studio Code using the following 7 IDE criteria:
- Git Integration
- Python Code Management
- Code Completion
- Debugging
- Performance
- Refactoring
- Cross Platform Compatibility
Not sure what PyCharm is? Check out this post.
The Approach
My approach to conduct this evaluation was to pick the IDE feature that I use most often and compare the experience between PyCharm and VSCode. My Python project is very simple so it would be worth building an in depth project with each of these IDEs.
For this comparison I am using PyCharm Community installed on Ubuntu in a virtual machine and VSCode 1.47.2 on the same virtual machine with the Microsoft Python plugin. Both PyCharm Community and VSCode are free, so financials don't enter into the comparison.
Git Integration
My big measurement criteria for Git integration was to see how much could be done within the tool itself without the need to resort to command line. I expect that common actions like creating branches, committing code and managing code on remotes can be done within the IDE.
VSCode
VSCode detects if a git repo has been setup for a project and allows you to initialize one. Creating my local repo was simple, however connecting to GitHub was much more difficult. It doesn’t look like there is a way to create a GitHub repo from VSCode so I had to create it through the GitHub Web UI. Once I was OAuth connected I could only view repos. I had to log into GitHub to create the repo, then it appeared in my list. Also, the local git remote that VSCode creates is named after the repo and not called ‘origin’ which I find a bit off-putting.
You can create branches using “Checkout to…”. Publish a branch to the remote (GitHub in my case). A pull request has to be started from the GitHub web ui. Pushing and pulling code changes is all possible from within VSCode.
These is the Git integration quick actions that VSCode displays for a new project.
For me, VSCode gets a 3/5 on Git integration. It has the basics, and while I don't need to go to command line for simple tasks, I do have to go to the GitHub Web UI, which is even less convenient.
PyCharm
PyCharm's Git integration is excellent. I was easily able to create a local Git repository on my project folder and in GitHub - without using the GitHub UI. PyCharm also supports creating and viewing pull requests from within the IDE. There is no need to use the command line or the GitHub Web UI for day to day tasks.
PyCharm also supports GitHub 2 factor authentication.
While I was able to create a GitHub Pull Request in PyCharm, I wasn't able to complete and merge it? Still, I am very impressed with PyCharm's Git Integration.
PyCharm gets a 5/5 on Git integration.
Code Management
Code management is an IDEs basic reason for existence. Making it easy for a developer to navigate a code base. Both VSCode and PyCharm have built in file hierarchy displays on the left of the code window (with the default setup) and allow you to create, rename and remove files easily. You can select function names and quickly navigate to their definitions with both of these tools. The real differentiation is in the IDE search functionality and smart code features.
For code management there were 2 areas I focused on:
- Dependency Management
- Search
For each project I added a file with a function definition, then called that function from my main file. I created a greet.py module with a function called greet:
VSCode
VSCode was unaware of the new function and I had to manually add the import statement.
I also really like Find in Files. Especially with a code base that I have inherited, being able to find files anywhere in a project containing a keyword within a project is essential. VSCode does this really well. The search results are displayed on the left, and I can click through and view them in the editor pane.
A strong search, but weak code dependency management and VSCode gets a 4/5 on code management.
PyCharm
When I added the greet module and function in PyCharm it was able to detect the missing import statement and recommended adding it. This is a great help to a developer.
The find in files search that I use so often is a bit awkward in PyCharm. It is even difficult to find it.
PyCharm displays this modal with search results which site over top of the code window. It is also difficult to see the files that it has found. I do like that I can select a path and search down into it. Because of the awkward search I give PyCharm a 4/5 on code management.
Code Completion and Highlighting
Highlighting is very personal, and fast and non-intrusive code completion is very helpful. I like the dark theme, VSCode and PyCharm both support multiple light and dark themes and since this is very subjective I am leaving out of the rating.
VSCode
VSCode supports code completion and it is quite capable.
Although VSCode didn't add the import statement for my new module automatically, once the import statement was added, VSCode is able to offer autocomplete for this function.
I can type 'g' and select the greet function from a list of valid selections starting with 'g', which then shows me the function comment and signature. The code completion experience is responsive and intuitive. I would say this is an average code completion experience and so I rate it at 3/5.
PyCharm
Similar to the other capabilities I've looked at so far, code completion is just better in PyCharm. PyCharm shows the function signature as part of the autocomplete selection list, but with some extra cool features. See those 3 dots at the end?
The three dots display the following menu:
- Sort by Name
- Quick Documentation
- Quick Definition
Quick Documentation shows the function signature and return types as well as the function comment. Quick Definition shows the function code. Very handy. This is a step above VS Code and the quick actions exceeded my expectations. PyCharm's code completion gets a 5/5.
Debugging
VSCode
VSCode allows you to execute your code in debug mode and step through it. The left pane displays local and global variables, watched values, the call stack and a list of all breakpoints. Hover over a variable to see it's current value in context. All of the standard execution controls are also available, step over, step into, step out. VSCode also allows you to create conditional breakpoints which are handy it you are looking for a specific data condition that causes problems.
VSCode provides a solid debugger for Python. It gets a 4/5.
PyCharm
PyCharm has the same features as VSCode, the debug properties are displayed in the bottom pane and the call stack is called 'frames'. You can view variables, and watch values, step into, over and out of functions.
On top of conditional breakpoints, PyCharm has some other interesting breakpoint logic, like:
- Breakpoint Hit messages that allow you to log information at breakpoints without adding print messages to your code
- Remove once hit, allowing you to remove a breakpoint once it has been hit. This works well when combined with conditional breakpoint logic.
Once again PyCharm exceeds my expectations and gets a well deserved 5/5.
Performance
For this test, I am running PyCharm and VSCode inside of an Ubuntu VM hosted in VirtualBox. I have 2 CPU core allocated and 4 GB of memory for the virtual machine.
VSCode
Anaconda Pycharm Community Edition
Start Up time is good for VSCode, once the VM was primed VSCode would load in about 4 seconds. My test project is only a couple of files, so I don't have a good sense of how it handles large projects. VSCode runs a number of processes and consumes a lot of memory, almost 1 GB. I attribute this to the electron framwork.
PyCharm
PyCharm is much slower to load than VSCode, clocking in over 10 seconds. Memory usage is lower however, in the 500MB range.
Once loaded, both IDEs were quite responsive with very little stuttering when looking up autocomplete suggestions.
Performance Summary
Measure | VS Code | PyCharm |
---|---|---|
Start Up Time | 4 sec (avg) | 15 sec |
Memory Use | 895MB | 550MB (Java) |
My Rating | 3/5 | 3/5 |
In each of their own ways these two IDEs are quite fat. So I've given them both a 3/5 on performance.
Refactoring
VSCode
In order to use refactorings, I had to setup 'rope' which VSCode nicely pip installed for me. The following refactorings are supported in VSCode:
- Rename
- Extract Method
- Extract Variable
This is a pretty limited list of refactoring capabilities. A 1/5 goes to VSCode for refactoring.
PyCharm
So I expected PyCharm to do well in the refactoring category since JetBrains built their company on the ReSharper refactoring plug-in for Visual Studio and PyCharm doesn't disappoint. Refactorings include:
Pycharm Download For Windows
- Rename
- Change Signature
- Move File
- Copy File
- Introduce Variable
- Introduce Constant
- Introduce Field
- Introduce Parameter
- Extract Method
- Extract Superclass
- Pull Members Up
- Push Members Down
Impressive refactoring to PyCharm for a 5/5 in this category.
Cross Platform Compatibility
VSCode
VSCode is incredibly portable thanks to the fact that it is open source. I have VSCode running on my Raspberry Pi 4 running Manjaro, and my Raspberry Pi and Jetson Nano running Ubuntu.
VSCode runs on AMD and ARM architectures in 32 or 64 bits. It is highly portable, a clear 5/5 here.
PyCharm
PyCharm runs on java which gives it some cross platform capability too. Unfortunately the JetBrains toolbox does not run on Java and is compiled for AMD architecture only.
However, you can download the PyCharm install files and extract and run PyCharm on a Raspberry Pi or Jetson Nano and it seems to work just fine. You'll need to install the Java JDE first and you should be good to go.
PyCharm gets a 4/5 on cross platform because of toolbox - collateral damage.
Tabulated Results
Here are all the ratings for the eight categories.
Criteria | VS Code | PyCharm |
---|---|---|
Git Integration | 3/5 | 5/5 |
Code Management | 4/5 | 4/5 |
Code Completion | 3/5 | 5/5 |
Debugging | 4/5 | 5/5 |
Performance | 3/5 | 5/5 |
Refactoring | 1/5 | 5/5 |
Cross Platform | 5/5 | 4/5 |
Total | 23/35 | 33/35 |
Summary
For Python development, PyCharm is the clear winner. But don't uninstall VSCode, it's a great swiss army knife with great support for many languages.
Additional Resources
Get started with Pycharm by following my introduction to Pycharm.
If you are an avid user of VSCode, I recommend this book on VSCode for developers
Photo by Hermes Rivera on Unsplash