If you have followed my blog you may have noticed that a lot of focus have been put on how to learn programming (particularly in Python). I have also written about Integrated Development Environments (IDEs). IDEs may, in fact, be very useful when learning how to code. When it comes to Python IDEs it may be hard to choose the best one (PyCharm vs Spyder?)
In this post I will discuss two IDEs, namely PyCharm and Spyder. The second, Spyder, is my old favorite and the one I (still) use in the lab. However, I got a suggestion in one of my blog comments (see the comments on this post: Why Spyder is the Best Python IDE for Science) that I should test PyCharm and I did. After testing out PyCharm I started to like this IDE. In this post you will find my views on the two IDEs. E.g., I intend to answer the question; the best Python IDE; PyCharm or Spyder?
The post will divided into the following sections:
In the first section (1) I will outline some shared features of PyCharm and Spyder. I will then continue with describing features that is unique to PyCharm (2) and Spyder (3). Finally, I will go on and compare the two Python IDEs (4).
Shared features of PyCharm and Spyder
I will start discussion some of the shared features of PyCharm and Spyder. First, the both IDEs are free (well, Spyder is “more” free compared to PyCharm but if you are a student or a researcher you can get the full version of PyCharm free, also) and cross-platform. This means that you can download and install both Spyder and PyCharm on your Windows, Linux, or OS-X machine. This is of course awesome! PyCharm and Spyder also have the possibility to create projects, an editor with syntax highlighting and introspection for code completion, and have support for plugins.
I must admit, the main thing I liked with PyCharm was that I could change the theme to a dark. I really prefer having my applications dark. That said, PyCharm of course comes with a bunch of features. I will not list all of them here but if you are interested you can read here. As I have mentioned earlier, both PyCharm and Spyder have support for plugins. However, I find it easier to find and install plugins in Pycharm. To install a plugin you just open up settings (File -> Settings) and click on “Plugins”:
This makes it very easy to search for plugins. For instance, one can install Markdown plugins to also write Markdown files (.md) that can be uploaded to your Github page. That leads me into another GREAT future of PyCharm; support for different types of Version Control Systems (VCS: e.g., GitHub, Subversion, and Mercurial). E.g., uploading your work to GitHub is only a few click aways (if you prefer not to use command line, that is).
Another great feature is that you can set the with of your code and PyCharm will end our line and move it to next line (great if you are a lazy programmer.)
Another feature of PyCharm is that you can safely rename and delete, extract your methods, among other things. It may be very helpful if you need to rename a variable that is used on various places in your code.
First of all, Spyder is made in for and in Python! Of course this is not a feature of the IDE itself but I like that it’s quite pure Python!
However, one of the most obvious pros with Spyder is that is much easier to install (e.g., in Ubuntu) compared to PyCharm. Whereas PyCharm must be downloaded and installed, Spyder can be installed using Pip. It is also part of many Linux distributions package manager (e.g., apt in Debian Ubuntu). There is one thing, however, that I really like with the Spyder interface; the variable explorer.
If you are getting stuck, and is not sure how to use a certain function or method, there is a section of the Spyder IDE in which you can type in the object and get the document string printed out. It can come in very handy, I think.
Spyder vs Pycharm
It is easier to install Spyder (at least in Linux) but PyCharm is not that hard to install. In fact, if you are running Ubuntu you can just add a PPA (See here on how to install PyCharm this way) and install PyCharm using your favourite package manager. If you are a Windows user, you just download an installation file (Download PyCharm).
Spyder is also part of a great Python distribution Python (x, y) for Windows users. Python (x, y) is intended for scientific use, and you will get most of the Python packages that you may need (and probably more than you need!) That is, for a Windows user, you will get most of what you need to do your Python programming AND the Spyder IDE with one installation.
PyCharms built-in support for VCS systems, such as Git and Mercurial, is also a great feature that is in favor for PyCharm. I know that some people find this attractive; they don’t have to use the command line.
Okey, which IDE do I think is the best? I think that Spyder, still, is a great IDE. PyCharm do, of course, offer a lot more features. If you are running a relatively new computer and is using Linux (e.g., Ubuntu), PyCharm may be the best (almost) free Python IDE.
On the other hand, if you are using Windows and don’t want to install a lot of Python packages by your self, Spyder is part of the great Python distribution Python (x, y). You may very well find yourself more pleased if you installed Python(x, y).
In fact, in the lab where we run Windows 10, I have installed Python (x, y) and code using Spyder but at home I tend to write in PyCharm (except, for when I do data analysis and visualizations, then I use Jupyter Notebooks, but that is a different story).
In conclusion, for scientific use maybe Spyder is the best free Python IDE (for Windows, Linux and OS-X). If you are a more general programmer or want to have a lot of features within the interface, PyCharm may be your choice!
The post PyCharm vs Spyder: a quick comparsion of two Python IDEs appeared first on Erik Marsja.