Loading Notifications...

Online C++ compiler recommendations

This topic has been archived, and won't accept reply postings.
 Hardonicus 19 Nov 2020

Lots of computer savvy people on here so...

Any recommendations for a good easy to use online C/C++ compiler that has been around for a while and would be good for students to run simple projects using a handful of source files and console IO.

 Andy Johnson 19 Nov 2020
In reply to Hardonicus:

I've heard of people using https://onlinegdb.com for learning. It seems to have been around for a few years and probably does what you need.

 freeflyer 19 Nov 2020
In reply to Hardonicus:

Unfortunately this isn't answering your question directly, and Andy's is a good answer, but assuming they have a capable device, could they use Visual Studio Code?

It's free, and supports a number of other languages as well as being a useful addition to their CV, and is something they would expect to use in future. A good building block ...

 Hardonicus 19 Nov 2020
In reply to freeflyer:

I was using Visual Studio, but it is quite complicated and confusing for simple jobs (these are electronic engineering students not software students). They are programming microcontrollers on this module, so this section of the course is just a refresher on very basic C fundamentals, they won't be implementing code on a PC down the line.

Onlinegb looks good - having a fiddle now.

Post edited at 12:54
In reply to Andy Johnson:

That's a good catch for this sort of thing, bookmarking.

 DancingOnRock 19 Nov 2020
In reply to Hardonicus:

I’m an electronics engineer and C++ was a required language for one of my degree modules. They should be more than capable of learning it. Along with assembly language for the microcontrollers. 

Post edited at 13:45
2
In reply to DancingOnRock:

Sure, so am I (by training, I work as a software engineer these days) and we did do C++, but he did say that it is not the aim of this module.

 mutt 19 Nov 2020
In reply to Hardonicus:

Can you install Docker? Then you can run up a debian image and compile from the terminal. That would work on windows.

sudo apt-get install build-essentials

will get all the necessary compilers.

You'd only need one instance of docker, any networked PC can then ssh  into that instance to get their own terminal.

Alternatively

========

install WSL2 on a windows 10 machine. That will allow a windows native debian image to be run as a windows process. That is a simpler route but possibly doesn't network so well,

I have both of these installed on my PC btw.

Post edited at 14:20
 Jack B 19 Nov 2020
In reply to Hardonicus:

> I was using Visual Studio,

You may know this already, but Visual Studio and Visual Studio Code (which freeflyer suggested) are, despite the similarity in naming, very different things. VS Code is much simpler and easier to set up and use, and provides a nice editor with syntax highlighting and easy compilation without all the over-the-top features of Visual Studio.

Post edited at 14:09
 Hardonicus 19 Nov 2020
In reply to Jack B:

Ok I'll check it out.

Students are all working remotely from a variety of devices which is compelling me to keep it as simple as possible or I'll be in the sh1t trying to support down the line!

 DancingOnRock 19 Nov 2020
In reply to Alkis:

Yes. They’ve clarified the problem is using different machines and remote teaching. Which changes things quite a bit.

 Jack B 19 Nov 2020
In reply to Hardonicus:

Yeah, it's not completely trivial to set up. From memory I had to install a complier (I used GCC), VS code, and a VS code extension to get it to work. I think it is easier to set up if you use MS's compiler, but that seemed to drag in many GB of unnecessary dependencies.  Not sure it would be my first choice for remote teaching, just wanted to clear up the difference between that and VS.

What toolchain will they be using to program the micros? Maybe that could also be configured to build for PC?

 Hardonicus 19 Nov 2020
In reply to Jack B:

They'll be using MPLABX and Proteus which will be running a sim of the hardware I would normally have in the lab. These two packages integrate seamlessly and this aspect is now sorted and seems to work well for what I will need. The C/C++ coding aspect is a very small part of the module, it's just a refresher really.

Visual code seems like it needs a separate compiler installed. Is there a common one for both Windows and OSX? I don't want to have to deal with variations in code listings and compiler specific bollocks across platforms if I go the Visual Studio Code route.

I though online would be the ideal solution as they are only doing very simple tasks indeed e.g. creating functions, using arrays, simple algorithm stuff etc. etc.

Post edited at 15:03
 Jack B 19 Nov 2020
In reply to Hardonicus:

I would expect both GCC and clang/LLVM to be available on both platforms.  I have no experience (of compilers or VS Code) on mac though.

Online might indeed be better.  The link above doesn't seem to be loading at the moment but I have used http://cpp.sh/ a little to check things and it seems to work.

Post edited at 15:08
In reply to Jack B:

VSCode works fine on the Mac, llvm/clang is the standard macOS toolsuite and GCC is easily available (since macOS is a BSD).

I do think that online would be less hassle if this is only a small subset of what they are going to be doing and will move to MPLAB X (Netbeans) later. Boy do I hate MPLAB X and most Java-ecosystem based IDEs... 😆

 Garrouli 19 Nov 2020
In reply to Hardonicus:

For my sins, I work as a c++ programmer so can offer you my 10cents:

I think there Is some confusion here - when you ask for a good compiler I think what you are actually referring to is a good IDE you can use. Compilers are usually platform-specific of which you have GCC (linux), Clang(Mac) and MSVC/mingw (Windows) which take the source code and compile down to machine code.

Example of IDE's include Visual Studio (Windows), Xcode(Mac) and VS Code (cross-platform). If your students are working on various platforms then VS Code is a good one but is more bare-boned due to it being cross-platform thus you will need to set up the compiler depending on the platform you are using. Though this is a lot of good on-line info for setting this up. VS Studio for windows and Xcode for Mac are easier in my opinion as these require the least amount of setting up but are platform specific.

The IDE then saves you the headache of doing things via the terminal, as it calls the compiler for you with the necessary arguments.

Post edited at 16:00
 Hardonicus 19 Nov 2020
In reply to Garrouli:

Yes excuse my sloppy terminology. The IDE needs to be minimal hassle to install, configure and use which is why I'm tending to online. Students come with a great range of ahem, 'ability'.

 Hardonicus 19 Nov 2020
In reply to Alkis:

Yes MPLABX sucks but the limited freeware version does what I need. The lack of optimisation is actually helpful when I'm trying explain the importance of sensible data types etc.!

 Snyggapa 19 Nov 2020
In reply to Hardonicus:

Might be worth checking out what arduino offer now - they were moving towards online /web based IDE.

Not sure if you can run it on a mock device though or if you need an arduino to run it onto

Post edited at 17:30
 Hardonicus 19 Nov 2020
In reply to Snyggapa:

All my material is on PICs currently, so locked into that really. The whole Sketch thing seems OK but there's a lot of abstraction and I'd rather students were coding in a C/C++. Transferable skills and all that.

Post edited at 17:49
 Cobra_Head 20 Nov 2020
In reply to Hardonicus:

> Onlinegb looks good - having a fiddle now.

Blimey, it's not THAT good, if you're going to have a fiddle I can point you at some "better" sites to help you along.

PS not online, but I cut my C++ teeth on a program called Bloodshed IIRC small footprint programming IDE with console.

Post edited at 21:21
 philipivan 21 Nov 2020
In reply to Cobra_Head:

First one I'd normally try would be repl it. Here is the c++ one. I think I used the c one once to test some algorithm I didn't understand. 

https://repl.it/languages/cpp11

 MeMeMe 21 Nov 2020
In reply to Hardonicus:

How simple do you want? 
Would http://cpp.sh do it?

 mattrm 21 Nov 2020
In reply to Hardonicus:

IT guy at a university here.  I assume that you're a lecturer who's working for a university or similar.  I'd also guess that you've got an IT department.  Have you spoken to them, as there's a good chance they've already got a solution sorted out.

I say this cause we've just spent the past 6 months or so frantically building a large number of systems to allow people to access all their applications remotely.

Otherwise as others have said, VS Code is a great editor which will handle most of what you want.  I mean personally I'd say emacs, but while it's not actually that hard to use, I suspect for some it'd be a struggle.  Hence VS Code.

 Hardonicus 21 Nov 2020
In reply to mattrm:

Remote desktop style access to applications is no good for synchronous teaching over zoom and the like. They need to run both the software and the video conferencing on the same machine to have any hope of useful interaction during lab classes with screen sharing etc.

Post edited at 13:02
 mattrm 21 Nov 2020
In reply to Hardonicus:

Ok, fair enough.  I hope you've raised your concerns with your IT dept.  I'm sure there's a way of working around it.


This topic has been archived, and won't accept reply postings.