What are Integrated Development Environments?
Integrated Development Environments (IDEs) are software applications that provide a programming environment to streamline developing and debugging software programs.
An Integrated Development Environment (IDE) is a software application that provides a programming environment to streamline developing and debugging software. Rather than performing all the steps required to make an executable program as unrelated individual tasks, it brings all the tools needed into one application and workspace. Each of the tools has an awareness of the environment, and they work together to present a seamless development set for the developer.
Even a simple search for IDEs will turn up quite a few choices. IDEs are available from Open Source communities, vendors, and software companies. They range from free to pricing dependent upon the number of licenses required. There isn't a standard for IDEs and each has its own capabilities, along with strengths and weaknesses. Generally, an IDE provides an easy-to-use interface, automates development steps, and allows developers to run and debug programs all from one screen. It can also provide the link from a development operating system to an application target platform, like a desktop environment, smartphone or microprocessor.
Software Development Steps
In any environment, to develop executable software you need to create source file(s), compile the source files to produce machine code (object files), and link the object files with each other and any libraries or other resources required to produce an executable file.
Source files contain the code statements to do the tasks your program is being created for. They contain program statements specific to the language you are using. If programming in c, the source files contain c code statements; java source files contain java statements. Usually source files names have extensions indicating the code they contain. A c source file may be named "myfile.c". Compilers translate the source files to appropriate machine level code for the target environment. Linkers take all the object files required for a program and link them together, assigning memory and registers to variables, setting up data. They also link in library files to support operating system tasks and any other files the program needs. Linkers output executable files.
Life without IDEs
When not using an IDE, developers use an editor, compiler, and linker installed on their development machine to create code files, compile, and link them.
Using the editor to create a source file, the code blocks, comments, and program statements are entered and the file saved. There are no "corrective actions," taken as the editor doesn’t know this is supposed to be a "source file" as opposed to notes for class! If working in a position-dependent language like Python, the developer would have to be very careful about indenting. The file has to be saved with the correct file extension and in a directory where the compiler can find it.
Each source file has to be compiled separately; if the program has a few source files, they all have to be named separately in the compiler. When invoking the compiler, it has to be directed to look in the correct directory for the source files and where the output files should be stored. If there is an error in the source file, the compiler will output messages and fail to complete. For any errors, the developer goes back and edits the source file, working from line numbers and compiler messages to fix the problems... and these steps continue until all the source files compile without errors.
When linking, each object file is specified as being part of the build. Again, the locations for the object files and executable are given. There may be errors at this point because it isn’t until the entire program is linked that some errors can be detected. Assuming the linker finds all the variables and functions, it produces a file that can be run.
If the program is run and it works, all's well! If it seems to do nothing.... that means it's debugging time! Since there is no insight to what the program is doing, the developer may go back and put in some brute force methods, like print statements to print messages out at certain points in the program or blink some LEDs at strategic places, which means back to the editor, and the cycle continues.
Bringing up an IDE presents a workspace:
Note: This is the Dev-C++ 5.11 IDE. It was downloaded and installed to illustrate IDE concepts for this article. It is available under the GNU General Public License version 3.0 (GPLv3). allaboutcircuits.com has articles about other IDEs. Be sure to check them out if you are interested!
With an IDE, a Project provides a workspace where all the files for a program can be collected.
Select the language and the type of program to create. This IDE supports c and c++ and various application types
If set for a Windows Application in C, it brings up a template:
A console C program brings up a different template:
Depending on the IDE, it may set up code blocks automatically, indent as required, track variable names in colors, show comments. Compile? Just click the compile selection on the dropdown menu (or press F9).
Compiler results will show in one of the windows and in the log. Compiler options and directories are set up using the Options menus.
As source files are created, they are added to the project. The Rebuild selection rebuilds all the files, first checking for the latest versions, then compiles and links to produce an executable result.
Errors on the compile or link? The offending code will be shown in the code window. The statement containing the error or the lines around it is known, since the compiler, linker, and editor are seamlessly connected. You can run the executable from the IDE by selecting Run:
The results show in a separate window.
Problems when running your new program? Usually IDEs provide an option to create a debug version.
With a debug version, the IDE controls the execution of the program, allowing insight to data variables and memory locations. Some IDEs show both the high level source statements as well as the machine code. The debugger may include options to "watch" local variables and track the contents of memory locations, offer line by line execution, provide the ability to set break points to run to a certain point in the program, and the ability to step into or over function calls.
Some IDEs include emulators, allowing debugging in the IDE environment without having to export the code to the target device
IDE vs. Tool chains
The term "tool chain" usually applies to a related set of development tools: a builder, compiler, linker and debugger. The builder tells the compiler the files and options to use, and the linker and debugger are connected. An IDE includes these as well as an editor and other tools.
Choosing an IDE
When selecting an IDE you'll find there are a lot to choose from and the price can vary from no cost to pricing options dependent on the environment and number of users. The license type is important as well if you intend to produce commercial code. Some things to check:
Does it provide support for your:
Development platform? (Some only run on specific operating systems.)
Programming language(s)? (Some only support a specific language.)
Target environment(s)? (IDEs targeting desktops may not support Android environments.)
Capabilities: What is included? Does it have watch points for debugging? Can it single-step through code? Do you need to see the low-level language used or is source code debugging good enough?
Pricing and Licensing: Are you looking for a supported environment and willing to pay for it? Does your company need several licenses? Are there royalties required? Are there fees per use?
Just as the IDE in these examples brought up template code blocks for certain applications, there are IDEs that support specific microcontrollers. These specialized IDEs automatically set up some code for the microcontroller.
An IDE makes software development and debugging easier by providing a single development workspace containing all the tools needed for development; it tracks files automatically and saves time. Choosing one suited to your programming needs makes developing and debugging software much easier.