Dev tools —  IDE

Dev tools —  IDE

vvrubel

Track content

Writing just one program involves a whole variety of tasks: you write the code, find and fix errors that inevitably arise, then the code has to be compiled, run, and documented. And guess what, all of this has to be done over and over again (well, that's just great). With small programs like Hello World, you can perform these tasks using a simple text editor to write your source code and a set of tools to translate and start the programs. Some text editors can even highlight the syntax, which simplifies the writing process, but this may not suffice for working on something larger and more complex.

As a professional developer, you need a specialized tool to navigate through your multiple-file programs, modify, compile, run, and debug them, display syntax errors, and so on. Integrated Development Environment (IDE) is precisely that: it offers a single program in which developers can deal with all these common tasks.

§1. Brief historical background

Most modern IDEs are graphical, though the first ones were used back in the era when no one dreamed of graphics. They were built on a text-based interface and could only be operated using function keys and hotkeys to invoke various functions. This was, for example, Turbo Pascal, created by Borland:

The first IDEs were designed to be operated via a console or terminal, which were new in themselves. Indeed, before that, programs were generally created on paper and entered into the machine using pre-prepared paper media such as punched cards or punched tapes.

Here are some specific historical examples. Dartmouth BASIC was the first language designed to run in a console or terminal. This ancient IDE was controlled by commands, not even using menus and hotkeys. However, it did allow you to edit source code, manage files, compile, debug, and run programs in a manner fundamentally similar to modern IDEs.

Then it was time for Maestro I. It is a product from Softlab Munich that was the world's first integrated development environment for software. Can you believe it held a leading position in its niche for almost twenty years? Today, though, Maestro I belongs to history.

As you see, humanity did not immediately come to the multifunctional IDEs.

§2. What is a modern IDE?

IDEs were created to maximize programmer productivity through tightly coupled components with simple user interfaces. This allows the developer to do fewer steps to switch between different modes, as opposed to discrete development programs. However, modern graphical IDEs are a complex software package. It means, one can achieve the necessary acceleration of the work process only after training. Anyway, there are no big difficulties here either: many IDEs are quite interactive, and the interfaces of one manufacturer are often very similar, so it is not too hard to switch from one IDE to another.

There are a lot of IDEs for different programming languages. Some support only a single language, while others support multiple or can be extended with plugins. For instance, multiple are IntelliJ IDEAEclipseNetBeansAndroid StudioVisual Studio Code. IDEs for one specific programming language are DelphiDev- C ++IDLE for PythonPyCharm.

As an example, this is what IntelliJ IDEA IDE looks like:

All of these environments can be run on Windows, Mac OS, or GNU/Linux.

§3. IDE components

In general, the development environment includes:

  1. Text editor, which is designed to work with text files interactively. It allows you to view the contents of text files and perform various actions like inserting, deleting, and copying text, contextual search, replacement, sorting strings, viewing character codes and converting encodings, printing. They often contain additional functionality, such as syntax highlighting.
  2. Translator (compiler and/or interpreter)which translates a text written in a programming language into a set of machine codes and does this either immediately before starting the program (compilation) or line by line (interpretation).
  3. Build automation tools, which get the code ready and put everything together.
  4. Debugger, which looks for errors in the code and immediately reports them.

By and large, using an IDE makes you a more productive developer because it provides tight-knit components with a similar user interface. It also automates some routine tasks, and even gives you advice and feedback. That's all because the purpose of the integrated environment is to combine various utilities into one product. This approach allows developers to focus on solving their core problems, while common and standard operations are taken care by an IDE.

§4. Conclusion

To sum up,

  • IDE is a specialized tool that navigates through your multiple-file programs, modifies, compiles, runs, debugs them, and also displays syntax errors;
  • modern IDEs are graphical and interactive;
  • some IDEs support only a single language, while others support multiple languages.

PyCharm basics

When you start programming, choosing the right IDE can be tricky. We encourage you to use PyCharm – one of the most powerful Python IDE developed by JetBrains. It has a very user-friendly interface and provides a variety of useful features like automatic code completion, project indexing, package management, etc.

We also suggest PyCharm Community Edition (available on our website) — it's free and is powerful enough to write fairly large programs. If you want more information on PyCharm, you can visit the official PyCharm webpage. You can also find the guide to PyCharm installation.

§1. The first project in PyCharm

Now we are going to write your first ‘Hello, World’ script using PyCharm Community. We assume that you have already installed it on your computer.

1. When you open PyCharm for the first time, you’ll be offered a few settings options. Feel free to experiment, you can change them any time you want. Choose the UI theme you like the most:

2. You will be offered a few plugins to install. You do not really need them for now, but you should know, that PyCharm can easily be customized. You can always install new plugins in Settings | Plugins.

3. Once customization is done, you can either create a new project, open an existing one, or check out from any version control system like Git or Bitbucket. If you are just starting and don’t have any existing projects, just press the Create New Project’ button.

4. Choose the path for your future project, where all the project files will be stored. For educational purposes, the name of the project will be "FirstProject". It has a drop-down menu: Project Interpreter: New Virtualenv environment. It means that your project will be created with new default settings. It means is that it will be isolated from other projects. Let’s get a bit deeper into it.

Imagine you have 3 projects, each written on a different Python version: 2.7; 3.5; 3.7. They can also have different sets of libraries installed. To avoid conflicts and make the development process clearer, we create all projects in different folders with different interpreters. For now, we can proceed with the “Create” button, but let’s have a look at the settings of the interpreter.

5. The first option is the path to a new virtual environment. This is a virtual environment, an isolated “quasi-” Python distribution with its own available libraries and the Python built-in package manager, which allows you to install external libraries. The Base interpreter drop-down menu indicates the path to the actual Python, which you download and install to your computer.

Let’s say you have downloaded Python 2.7 and installed it into C:/python2.7, and Python 3.7 – C:/python3.7.

Now if you want to create a new project on Python 2.7, you will choose C:/python2.7/python.exe as the base interpreter for this project. In case you want to start a new project on Python 3.7, you will choose C:/python3.7/python.exe as the base interpreter for a project, written on Python 3.7.

Each of these projects will have its own dependencies – the libraries available (or required) for a specific project.

6. By opening the root directory, you will see another folder – your new virtual environment, which contains all Python settings for this project. The settings include libraries and the Python version.

§2. PyCharm capabilities

We have created the framework for our project, but we still don’t have a place where we can type our code. To create a new Python file in your project, you can either go to File | New | Python file, or right-click the FirstProject | New | Python file. Enter the name and hit OK.


This will create a new .py file in your project folder:


Now you can finally write the lines you desired:

print("Hello, world!")

To run the program in PyCharm, you can right-click on the .py file and press Run or use the shortcuts. To know more about PyCharm shortcuts, you can check the Shortcuts section on the official website. You can choose your operating system in the top right corner:


After running a specific file for the first time, PyCharm will remember it, so you can rerun the program by clicking the green Play button in the top left corner:


If you don't have the Play button, go to View → Appearance and check Toolbar.

When the program is executed, the result will appear in the Run tool window at the bottom of the screen:


The first line shows the path to the project interpreter and the path to the program which has been executed by this interpreter. The result of your program execution will follow. If you need more detailed information on PyCharm, you can always refer to the official tutorial.

§3. PyCharm settings

PyCharm is a very customizable IDE. Try going to File | Settings. There you will notice are a lot of sections. For example, you might want to change the PyCharm theme. We use Darcula. To find the specific settings, you can use the search box, as shown below:


PyCharm is a very intuitive and powerful IDE, and it also has a free community edition.

§4. Some other IDEs you can work with

PyCharm Community is not the only IDE you can work with if you want to complete the projects on our website.

First, let's look at the variety of PyCharms. In addition to the Community version, there are two other editions: Educational and Professional.

1) Professional edition supports many other programming languages like JavaScript and HTML for web development, database support, and a lot of features you might need once you become a pro. You can get a free trial on the official website to try this edition out!

2) Educational edition is based on the Community Edition and includes all functionality but it has several significant differences:

  • Edu version has a lightweight design with hidden elements that are not needed at first steps.
  • You don't need to install anything other than PyCharm Edu. All other items will be installed automatically.

Another way to work with Python is to install the IntelliJ IDEA plugin that copies all PyCharm capabilities. If you already have the IDEA installed, it is the fastest way to start coding in Python. Bear in mind that IDEA was initially developed for Java users, so some tools may be inconvenient for a person who is studying Python.

It does not really matter where you start after all. You can try them all and find what suits you best!

§5. Recap

In this topic, we found out:

  • how to start a new project in PyCharm Community.
  • a little bit about the virtual environment and python versions.
  • how to create files in PyCharm projects.
  • a few shortcuts that make the developer life much easier
  • how to navigate through PyCharm, find the necessary settings and run files.
  • the alternatives to PyCharm Community

Acquiring this information is one of the most important steps on the challenging path to become a real developer!


Up!

Report Page