= What is an IDE

:Author: Seth Kenlon
:Email: seth@opensource.com
:Revision: 1.0

One of the tools of the programming trade is the Integrated Development Environment, or IDE.
Having a good IDE can make all the difference when you're working with a programming language, and they can help you avoid errors that might otherwise not get caught until it's time to compile or test your code.
But if you're new to programming or to a specific programming language, you might find yourself overwhelmed by choices of IDE with little understanding of what differentiates one from another, or even what exactly an IDE is.
There's no official specification for what qualifies as an IDE, so this article looks at what really makes an IDE an IDE, and which ones you might want to try out first.

The term "IDE" suggests a few essential features:


image:ide-eclipse-emacs-mode.webp[Emacs mode in Eclipse]

== Code editor

Most of your time in an IDE is spent typing text.
An IDE must have a place to type your code, and that place must feel comfortable to you.
If the editor is clunky or inefficient, then you're not going to want to spend your day using it.
A really good IDE even has editor emulation modes so programmers accustomed to https://opensource.com/resources/what-emacs[Emacs] or https://opensource.com/resources/what-vim[Vim] can use the same key combos they have already committed to muscle memory.


image:ide-highlighting.jpg[Syntax highlighting in Eclipse]

== Syntax highlighting

When you type your code, an IDE displays keywords of the language you're using in one colour, variables in another, libraries and functions in another, and so on.
It's a small addition to your coding, but one provides context to what can otherwise be a flat, monotonous wall of text.


image:ide-lint.jpg[Code linting in PyCharm Community Edition]

== Code linting

Should you make a mistake while typing your code, your mistakes are highlighted for you.
It's not just fatal errors that are caught.
Some languages, such as Python, encourage developers to write code according to an official style guide.
Any time you deviate from the recommendations of Python Enhancement Proposals (PEP), a good Python IDE warns you about it.



image:ide-correction.jpg[Code correction in PyCharm Community Edition]

== Code correction

Linting is the process of catching errors, and many IDEs can do that based on a rudimentary schema of expected syntax.
A great IDE, though, suggests fixes for errors.
Better still, an IDE should propose _sensible_ corrections derived from the way the programming language actually works.
In other words, a Java IDE suggests fixes that make sense for Java, not Python or C++.

This isn't always perfect, of course.
An IDE can only suggest a fix based on satisfaction of language specification, and in the wrong context that can break your project.
Your own understanding of the language and what you're trying to achieve is vital, but the auto-corrections are great for obvious errors.
An IDE's automated correction can save you a lot of manual find-and-replace work and even simple refactoring.


image:ide-project.jpg[A Java project in Eclipse]

== Project aware
 
Code and assets are bundled together either literally or virtually so that when you're ready to distribute your code, you don't leave any vital element behind.
Most IDEs have some concept of a project directory, just as it's assumed by https://opensource.com/article/19/7/introduction-gnu-autotools[Autotools] or Cmake that there's a standardized layout for your code files.
Some IDEs abstract the structure of your code and its libraries so you can see everything your code depends on: both the systemwide toolkits you have installed by default (but your users may not) and the custom code you've produced locally.

What level of granularity you actually need depends on your own skill for organization, dependency tracking, and even the language and libraries you're using.
But regardless of how complex or simple your project, it's convenient for your IDE to know what directory to default to when searching for files, libraries, and assets.

image:ide-env.jpg[Qt Creator options]

== Environment aware

An IDE usually has a management system to help you set which code libraries to use, set a specific runtime, track version control, and set compiler options.
This is of important on any system, but it's vital on a development machine with multiple versions of tools installed.
It's not uncommon, for instance, to have both Qt4 and Qt5 toolkits installed, Python 2 as well as 3, different versions of Java runtimes, 32-bit and 64-bit libraries, GCC and LLVM, and so on.
For consistent results, it's nice to have an IDE manage how your project is built and bundled.

Building, running, and bebugging your code from within your IDE is also an important convenience feature.
Of course, you don't need your code editing application to also run your compiler or launch a debugger, but having those features in the same interface does bring unity to a process that's often disparate.

== An IDE is optional

Regardless of what your textbook, teacher, or boss says, you don't _technically_ need an IDE to write code.
No matter what language you're writing in, ultimately it ends with text being parsed and processed by a compiler, so all you really need is a good text editor and a build toolchain.
All of the features of an IDE that I've listed are optional, and not every IDE has every feature or as much of each feature.
You can try out different ones, find out what you can't live without, what you find pleasant to have, and what you definitely don't want, and base your decision on your experience.
Once you do find a good IDE, though, you'll probably come to know and love it, and you won't want to write code without it.

== Find an open source IDE

There are lots of open source IDEs out there.
Some are very specific to one programming language, such as https://opensource.com/resources/python/ides[Python] and https://opensource.com/article/20/7/ide-java[Java], and are of little use otherwise.
Others make allowances for different languages and different frameworks so you can potentially use them across many different projects or on projects that utilize multiple languages.
And of course, you can always choose to forego an IDE altogether and just use a text editor or a text editor https://opensource.com/article/20/7/vim-rust-ide[configured to behave like an IDE].

Ultimately, the most important feature of an IDE is your comfort and efficiency.
As with any new tool, you can expect a learning curve when you start out with an unfamiliar IDE, but after you spend time working in it, you should feel like you understand its interface, that you know where to find new features quickly, and like it's working to make you a better and faster programmer.
If you're not getting that from the IDE you chose, then try a different one.

With so many great open source IDEs to choose from, you're bound to find one that suits.
Happy hacking!