1.6. Editor/IDE

Editors (and IDEs, respectively) are the one program (besides the terminal) programmers spent most time with. Hence, it does matter to choose the “right” editor/IDE for the task at hand.

Generally, for (Python) programming any text editor can be used, and there are literally zillions of these programs available for all platforms. While there are good arguments for using “only” an editor and not a full-fledged IDE, for this course, we will use an IDE, namely PyCharm. Furthermore, while for occasionally looking at code any text editor (preferrably with syntax highlighting capabilities) suffices, for actual software development, you need to use an IDE nowadays, as not using advanced IDEs usually directly corresponds to lower code quality. The reasons are simple: Only IDEs allow for easy refactoring and navigating within a code base, to name just two aspects.

1.6.1. Reasons to carefully choose your editor/IDE

Programmers should choose their editor/IDE carefully for a number of reasons:

  • Programmers spend most of their time with the editor/IDE.

  • You will read code much more often than you write code.

  • Good editors/IDEs improve the code quality.

Note that not only the functionality provided by an editor/IDE matters, but that you will always want to (and should) customise its look&feel to your liking.

For getting an idea what makes for a “good editor/IDE”, continue reading.

1.6.2. Criteria for a good editor/IDE

Reasons for carefully choosing an editor/IDE have been listed above, but what makes for a “good editor/IDE”? There is a series of general criteria, besides criteria that are specific for a particular programming language.

1.6.2.1. General criteria

These criteria are valid for any purpose and independent of the programming language (or task) you use the editor/IDE for.

  • Controllable via the keyboard

    You are much faster with your keyboard and shortcuts than with your mouse, although using a mouse is more intuitive and generally, introducing a pointing device (and graphical interfaces in general) was a giant leap forward in terms of overal usability of computers. Make it your habit to have a cheat sheet next to your computer to look up keyboard shortcuts for your IDE as long as you still learn them, and do make use of them.

  • Configurable

    Every person has slightly different ideas of what is practical, besides that those criteria do change over time and with projects. Hence, the more things you actually can configure in your IDE the better, although the amount of configuration options can be quite overwhelming at first.

  • Extendable

    Good editors and IDEs come with a plugin system that allows for easily extending their functionality both by the original vendor and by third parties. Think of a typical project where you would like to have support for different languages. For a web project, this is HTML, CSS, and presumably SQL. In context of scientific software development, this may well be LaTeX (for generating reports). Besides that, all editors/IDEs used for Python software development should support basic markup languages such as Markdown and reStructured Text, besides JSON and YAML.

  • Programmable

Some of these criteria may seem unimportant on first sight, however, you will come to value each of them when frequently using the editor/IDE – or missing these features if they are not available. In the end, an editor/IDE is your primary tool, and the easier and faster you can operate it, the more productive you will be.

1.6.2.2. Criteria for a particular programming language

The criteria listed below are not specific for a particular programming language, meaning that an editor/IDE used for a particular programming language should provide you with all these features for the language of your choosing.

  • syntax highlighting

  • auto-completion

  • auto-indentation

  • refactoring

  • templates

Again, some of these criteria may seem less important on first sight. Nevertheless, the list is the result of long-standing experience. Each of the criteria listed above helps increasing both, productivity and code quality, and is hence not optional.

1.6.3. Introducing PyCharm

Having stated above that choosing the editor/IDE is crucial and needs to be done with thought and care, why am I insisting on using one particular IDE? Generally, for the context of this course, it is helpful to have a common setup. Besides that, as long as you come to value the criteria listed above for selecting an editor/IDE and make an informed choice of your own, that’s perfectly fine. The course does not depend on you using PyCharm.

So what are my reasons for choosing PyCharm? The following criteria were important to me:

  • Free of charge (community edition)

  • European development

  • Very good IDE

  • Special offers for using it in academia

  • Available for all major platforms

One additional criterion: PyCharm is a full-fledged IDE, not “just” an editor. Of course, it is highly important to not depend on the cosy interface of an IDE for anything, but to know, understand and be able to manually perform arbitrarily complex tasks. However, having understood and being proficient in all these tasks, you will quickly value the support of a good IDE.

1.6.4. A word on Spyder

Given that this is a Python course aiming at scientists, I should add a few comments on Spyder and why I chose not to use it (for this course), as it gets often used in science.

First of all, nothing is wrong with Spyder, and if you like it, go for it. However, Spyder falls short of being a fully equipped IDE with all the functionality listed above, and is hence – in my opinion – not really suited for serious programming of large programs/libraries. It clearly has a nice interface resembling, e.g., MATLAB, providing means to prototype things and play around with Python. However, that is just not the focus of this course. Perhaps one of the most crucial features missing in Spyder that made me reject it early as the editor/IDE of my choosing is its lacking support for refactoring.

This course focuses on teaching you how to survive programming larger projects, and here, code quality is mission-critical. Therefore, you will need to refactor your code all the time, and you need to get all possible support from your IDE.