Development Environments
Steven Zeil
1 Development Environments
Software development refers to the whole range of activities required to produce working software. Certainly programming (writing code) is a major component of software development. But that code also needs to be tested and debugged. There may be also be additional steps required to deploy the software, packaging it up in a form where it can be made available to its users for use.
The collection of tools that we use to support all of these development activities is called our development environment.
1.1 The Basics
At a minimum, every development environment, will include
- An editor for writing source code,
- A compiler to translate that code into an executable program,
- Code libraries for all the code that we don’t write (e.g., the C++
std
library providing things likecin
,cout
,string
,sqrt
), and - A debugger.
- Some mechanism for launching these and for running the compiled programs.
Whether you are running on Linux, Windows, or MacOS, you need these components. Strictly speaking, you don’t need anything else. The operating system provides command-line shells from which you can launch the compiler, the debugger, and the compiled code. Code libraries simply need to be available to the compiler on demand. And you can use any text editor to edit source code, even very basic ones like nano
on Linux or NotePad on Windows.
1.2 IDEs
But few programmers really want to work with such bare-bones tools.
Instead, we usually prefer to work through and Integrated Development Environment (IDE) that manages the whole process from editing your code to compiling to debugging.
An Integrated Development Environment (IDE) is a software package that attempts to combine the primary programming activities of
- project setup,
- editing,
- building (compiling), and
- debugging
into one unified user interface. Some IDEs go even further, offering support for testing, version control, team collaboration and other activities that are beyond the scope of this course.
You may already have used some IDEs in Windows or MacOS. Eclipse, for example, is an IDE used heavily in our beginning courses. If you have taken programming courses in other universities or departments, you may have used Microsoft’s Visual Studio IDE or others.
An IDE is not a compiler.
This is a common misunderstanding among beginning programming students. An IDE uses and supports a compiler. But the compiler is a separate program. We have already seen how compilers can be invoked from the command line as separate entities.
Some IDEs are designed to work with a single programming language or even a specific compiler for a single programming language. Other IDEs are designed many different programming languages.
Every IDE will provide a facility for editing your code, compiling it, and correcting errors. Most require you to start by defining a “project”, a kind of organizing unit that keeps track of which files are in your project and of any special settings or options you might need when building (compiling) your project.
Simple IDEs often assume that the only steps involved in building a project is to compile the source code. More sophisticated ones will make use of build managers such as make
, Maven, or Gradle.
Beginning programmers might not need all that flexibility, and the best IDEs keep all that out of your way until you actually need it.
2 Development Environments are Personal
There may be times when you will be sitting in a CS Dept lab, in which case you will use the software provided on the lab machines.
But many students find that they spend a lot of their programming time working on their own PC’s. That might be a desktop machine at home or a laptop that goes back and forth between home and campus.
When it comes to planning the development environment that you want to run from your own PC, you have choices.
There are three major styles of development environment to consider.
2.1 Local Development
In earlier courses, you may have been encouraged to install an IDE (probably Eclipse), compiler, and debugger on your own (local) PC and to do all your work there.
Having the IDE and all of the development environment components on your own PC is called local development.
Advantages:
- If you have a good PC, this is fast and responsive.
- You don’t need a good Internet connection. You may not need to be on-line at all.
Disadvantages:
- If your PC is slow, your tools will be sluggish.
- There’s lots of software to install on your PC, taking up a good chunk of your hard drive.
- If your compiler is a different version than the one used by the instructor, you may sometimes get very different results. It’s possible that code that compiles on your PC will not compile for the instructor, or vice versa.
- If your operating system is different than the one used by the instructor, your compiled code may behave differently for you than it does for your instructor. This may cause your code to fail the instructor’s tests, costing you points.
Local development is outside the scope of this course (this is, after all, a course on Linux, not Windows). But if you would like to explore this option on your own, I have some recommendations and instructions.
2.2 Remote Display
In remote display development, we run the IDE, compiler, & debugger on a remote machine (e.g. the CS Linux servers) and have the results displayed on our local PC’s screen.
In a sense, this is what you have already been doing when you worked with the compiler in your SSH sessions, but we can upgrade that experience to a full IDE via X, and this is the subject of the next lesson.
Advantages:
- If you have a good Internet connection, this is fast and responsive (usually even if your PC is slow).
- If your PC is slow, that’s OK. All of the “heavy lifting” is done on the remote server.
- You don’t need to install much on your PC – X2Go will do.
- By running on the same CS machines that your instructor is likely to use, you avoid problems of compatibility when your code is graded.
Disdvantages:
- If your Internet connection is slow, everything will feel sluggish and unresponsive.
- If your Internet connection is down, you can’t work at all.
The next lesson will look at IDEs to use in this remove viewing mode of development.
2.3 Remote Development
Remote development strikes a middle point between the extremes of running everything on your PC or running everything on the remote machine.
The compiler and debugger are run on the remote machine and do not need to be installed on your own PC.
The IDE, however, is installed and run on your own PC. It communicates with the remote machine via a combination of SSH and SFTP show you your files on the remote machine, let you edit them, and to issue commands to the compiler and debugger on the remote machine.
Advantages:
- If your PC is slow, this will still feel reasonably fast and responsive, because most of the CPU-intensive tasks are done remotely.
- If your Internet connection is slow, this will still feel reasonably fast and responsive, because the amount of information being transferred is relatively small.
- There’s less software to install on your own PC than in local development.
Disadvantages:
- If your Internet connection is down, you can’t work at all.
- There are extra steps involved in starting each work session and in the initial setup of your project.
We will cover this style of development in a later lesson.
2.4 Summary
Local Development | Remote Development | Remote Display | |
---|---|---|---|
compiler runs on | your local PC | remote server | remote server |
IDE runs on | your local PC | your local PC | remote server |
load on local CPU | high | low | medium |
load on network | none | low | high |
software to install | javac, Eclipse or VSCode | VSCode | X or X2Go |