Choosing Your Programming Environment
Steven Zeil
You are going to be doing a lot of C++ programming in this course.
Now is the time, before you actually get involved with the details of an assignment, to decide how you are going to do that and to get everything set up that you need.
This is also a good time to review material from CS252 that you may have skipped over, forgotten, or, if you took CS252 many semester ago or have transfer credit for a CS252 “equivalent” from elsewhere, may never have seen:
1 What You Need
You will need an environment that includes
- SSH-based communications
- a C++ compiler in the
g++
family - a debugger that works with your compiler
- The
git
version control program - an IDE that can tie these things together, that provides
- support for makefiles for projects with multiple executables and easily controlled compiler settings.
- A Java compiler and runtime environment (used for running tests on your C++ code).
Most students entering this course will have used Code::Blocks in earlier C++ courses. Code::Blocks is a fine IDE for beginners, but Code::Blocks will not be sufficient in this course.
2 Where Do You Want to Work?
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
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. if your hard drive is already nearly full, that may be a problem.
- 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.
2.2 Remote Display
In remote display development, we run the IDE (Eclipse), compiler, & debugger on a remote machine (e.g. the CS Linux servers) and have the results displayed on our local PC’s screen.
Advantages:
- If you have a good Internet connection, this is fast and responsive (even if your PC is slow).
- You don’t need to install much on your PC – SSH & X2Go will do.
- By running on the same CS machines that your instructor is going to use, you avoid problems of compatibility when your code is graded.
Disadvantages:
- If your Internet connection is slow, everything will feel sluggish and unresponsive.
- If your Internet connection is down, you can’t work at all.
This mode of development was a major theme of CS252, so you should already be prepared to work this way.
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 (VSCode), however, is installed and run on your own PC. It communicates with the remote machine via a combination of SSH and SFTP to show you your files on the remote machine, to 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.
This mode of development is also covered in CS252, so you should already be prepared to work this way.
3 My Recommendations…
The ordering of my recommendations is based on the fact that a significant number of students seem to have slow Internet connections that make remote viewing frustrating. Some students have PCs with underpowered CPUs that make local development slow.
So I recommend trying the remote development option first.
Then, if you decide you would prefer to local development, you can still use VSCode as your IDE but just add the compiler and related tools on your PC. You can even switch back and forth between remote and local modes, provided that you transfer your source code first. (Using git
makes that natural: get in the habit of pulling at the start of each work session, and committing and pushing at the end of the work session.)
3.1 …for Students with Windows PCs
For this course, my recommended choices for students with Windows PCs are:
- Remote Development
- Local Development (Windows & Linux)
- Windows Subsystem for Linux (WSL) is a Linux virtual machine that runs, pretty much seamlessly, on a Windows 10 machine.
- Toolset: Linux g++, gdb, java, javac, make, git in WSL
- IDE: VSCode (in Windows)
- Installation instructions are here.
- Remote Viewing
- X2Go
- Installation instructions are here.
- Toolset: already on the remote Linux servers
- IDE: Eclipse
- X2Go
3.2 …for Students with macOS PCs
My recommendations for students with macOS PCs are