15

I teach programming at secondary school: this is our current status and I would appreciate any suggestions:

  • We have programmers club for advanced students. We develop in MSVC# (even commercially) and NetBeans, everything works fine
  • However, two thirds of the class are not developers: they are otherwise oriented, their job will probably not be in IT
  • According to our school agenda, we HAVE TO teach them some basics
  • So in the first year of their studies, we teach them something like "programming for dummies" to give them time to decide what they really want to do (programmers club requires to do MUCH homework)
  • The language HAVE TO BE C++ (for many reasons). Currently they develop in C++ Builder 6.0, which is slow and buggy in our school network.

So what would be the best solution for those students? The requirements are fast, reliable and very easy to undestand IDE. Console output is sufficient, something like "editor and play button". Visual programming and debugging tools are not required. The IDE should be free, preferably running on Windows.

My favorite was MSVC 2008 Express - it is really fast and pretty simple. But C++/CLI is not C++ (managed code is not the basics), so this is not an option. Any other suggestions?

Jan Turoň
  • 31,451
  • 23
  • 125
  • 169
  • For what it's worth, I'm pretty sure that Visual C++ 2010 Express allows you to create native apps. You're not restricted to C++/CLI, as far as I'm aware. http://msdn.microsoft.com/en-us/library/hs24szh9.aspx – LukeH Jun 16 '11 at 09:28
  • 4
    "two thirds of the class are not developers: they are otherwise oriented, their job will probably not be in IT" / "The language HAVE TO BE C++ (for many reasons)" : there is a logic and sanity disparity between these two statements – Lightness Races in Orbit Jun 16 '11 at 09:40
  • 1
    "My favorite was MSVC 2008 Express - it is really fast and pretty simple. But C++/CLI is not C++ (managed code is not the basics), so this is not an option" You don't _have_ to write C++/CLI in it. – Lightness Races in Orbit Jun 16 '11 at 09:40
  • 3
    @Tomalak Geret'kal: the statements are easy to reconcile. We really, really want future managers to understand that programming is very, very hard and programmers should be paid small fortunes. – MSalters Jun 16 '11 at 10:30
  • @MSalters: ... ... ... speechless :D – Eamon Nerbonne Jun 16 '11 at 14:05
  • @Tomalak Geret'kal: those reasons are: 1) some teachers doesn't want to learn a new language (like C#), so it would be difficult to put through. 2) there are other subjects and clubs (like robotics) where C/C++ is used. Nevertheless, your hints (not just here) are not just correct, but also wise. So thank you. – Jan Turoň Jun 18 '11 at 07:49
  • thank you all, it will take some time to test your suggestions and discuss it with other teachers... – Jan Turoň Jun 18 '11 at 08:51
  • 1
    @Jan: There is no such thing as "C/C++". :) – Lightness Races in Orbit Jun 18 '11 at 13:47
  • @Tomalak Geret'kal: true, but this is one of your less wise answers :) – Jan Turoň Jun 18 '11 at 16:08
  • @Jan: Everybody has an off day. – Lightness Races in Orbit Jun 18 '11 at 16:14

7 Answers7

9

You said it right there: go with Visual C++ Express.

Just because you can use it to write C++/CLI projects doesn't mean you have to. Just create ordinary Win32 console apps and you'll be using plain old C++, nothing managed whatsoever.

To clarify: C++/CLI is what you get when you create a Windows Forms, Windows Presentation Foundation or some other type of .Net-based application. If you create a Win32 Console Application, you will be using ordinary C++ without any of the managed Microsoft extensions.

dandan78
  • 13,328
  • 13
  • 64
  • 78
8

Visual C++ Express does support native C++ developement. I would strongly urge you to upgrade to the 2010 version to gain some C++0x support; C++0x makes it much easier to program in C++ without touching the nasty bits.

However, C++ as a first language sounds daunting. Particularly for those without any further programming aspiration; it's complicated, easy to misuse, and will blow up with poor error handling in hands of beginners.

For some casual programming introduction, I'd recommend something like JsFiddle: they can do it from anywhere with no special tools, and whatever they learn they might even be able to actually use as non-IT guys. It's also much more fun to get immediate feedback when learning something, which is another mark against C++.

So if you have to use C++, use C++0x to make stl algorithms "just work" using lambdas and avoid iterator complexity using the range-based for (amongst other improvements).

Eamon Nerbonne
  • 47,023
  • 20
  • 101
  • 166
  • 1
    "It's also much more fun to get immediate feedback when learning something, which is another mark against C++." How so? – Lightness Races in Orbit Jun 16 '11 at 09:39
  • Because there's the compile loop, and because compiling is exceptionally tricky in C++. In an interpreted language they'll generally see it working until the first error is encountered, i.e. a poor-mans debugger without ever needing to even understand what that means. It's not a fatal flaw, it's just not the easiest place to start. – Eamon Nerbonne Jun 16 '11 at 09:48
  • 1
    @Eamon: "the compile loop"? "compiling is exceptionally tricky in C++"? What on earth are you talking about? When you make a syntax mistake in C++ and compile your code, you get _immediate feedback_. (It is in fact **more** immediate than with interpreted code, because you don't have to wait for the working part of your program to execute first.) – Lightness Races in Orbit Jun 16 '11 at 09:51
  • You're preaching to the choir: I prefer to use statically checked languages whereever possible. But C++, partially because it's so old, has a bunch of features that make it hard for compilers to come up with appropriate error messages. If you've programmed C++ for a long time, maybe you don't even notice anymore, but small errors often result in error messages that aren't at all obvious to interpret without experience. E.g. forgetting a semicolon after a class definition, or making a mistake in a type such that template type inference doesn't choose the type at all. – Eamon Nerbonne Jun 16 '11 at 09:59
  • @Eamon: Oh, compiler error messages can be diffuse for sure; that doesn't mean that you don't get immediate feedback. And I still don't know what a "compile loop" is. – Lightness Races in Orbit Jun 16 '11 at 10:04
  • Also, for historic reasons, C++ permits a whole bunch of things that are probably unwise. There are lots of implicit conversions, lots ways to do the same thing (but often with subtly different semantics), and it's one of the few mainstream languages that isn't memory-safe, which in turn leads to errors that may not trigger immediate feedback etc. – Eamon Nerbonne Jun 16 '11 at 10:07
  • @Tomalak, oh by compile-loop I mean the write, compile, run loop as opposed to write, run loop. In a REPL you can even have persistant data-structures, so you can do exploratory expressions - does this work? This? etc., whereas is a statically compiled environment, you'd need the discipline to have a real "setup" function worked out, and then systematically only change the last bit. – Eamon Nerbonne Jun 16 '11 at 10:09
  • Hmm, which reminds me of http://root.cern.ch/drupal/category/package-context/cling: would that be useful for beginners? – Eamon Nerbonne Jun 16 '11 at 10:12
  • @Eamon: I think you mean "process", not "loop". – Lightness Races in Orbit Jun 16 '11 at 10:13
  • @Eamon: if Cling work it would be amazing (and I would be very interested too :p) – Matthieu M. Jun 16 '11 at 10:21
5

I've worked with:

  • Eclipse for C/C++ Developers (at work and at home)
  • QtCreator (at a side project I was working on while working)
  • Microsoft VS (at work)
  • Code::Blocks (on my home laptop, with Eclipse, for fun)
  • vi (at work and at home)
  • Notepad++ (at home)
  • KDevelop (at home)

I think for the beginner, in my personal opinion of course, the Eclipse, MSVS and Code::Blocks are equally great. When stuff starts getting more complicated, you need to choose based on direction. If you're developing for Windows - stick with MS. If you're developing with GCC - stick with either Eclipse (Which is kindof heavy but powerful) or Code::Blocks (which is way lighter but not as sophisticated). Use QtCreator if you're doing GUI for anything with Qt, otherwise I wouldn't keep it.

littleadv
  • 20,100
  • 2
  • 36
  • 50
  • Oh, and I forgot to mention... I **absolutely hate** vi. I'm not a vi person. But I do use it from time to time for very simple and localized code editing (I'm developing on a Linux workstation, on my home Windows laptop I use Notepad++ instead). – littleadv Jun 16 '11 at 10:05
  • I find Eclipse simply the best for any non-Microsoft code! When on Windows and .NET I also stay with VS2010. It is good to show both of these IDEs to students cause they are easy to use and exist as industry standard now. – nowaq Nov 25 '11 at 14:34
4

Code::Blocks is the one I usually recommend for beginners. I'm not a big fan of the Eclipse CDT since I've always found it needlessly complex under Windows.

Since it uses gcc under the covers, you won't find any of those "helpful" changes Microsoft made to the language, like their so-called safe functions, which are nothing of the kind, and which render your code unportable.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • QtCreator might be a better choice for C++, but yes, it doesn't have any huge issues. – Šimon Tóth Jun 16 '11 at 09:26
  • 1
    Instead, you'll find "helpful" changes GNU made to the language which render your code unportable, but `-pedantic` solves that :-) – Steve Jessop Jun 16 '11 at 09:27
  • 2
    -1: I'm not sure which helpful changes you're ranting about, but I cross-compile stuff for gcc+MSC regularly, and it's not at all that bad. This reasoning distracts from the OP's question. – Eamon Nerbonne Jun 16 '11 at 09:29
  • 1
    @Eamon: things like http://stackoverflow.com/questions/906599/why-cant-i-use-fopen/906681#906681 - you have to forcefully inform MSVC that you know what you're doing and it should just shut the hell up about it :-) I don't believe it detracts from the users question. If you want to learn C++, learn it as specified by ISO. Don't learn Microsoft's weird variations. – paxdiablo Jun 16 '11 at 09:34
  • `fopen` still works - and really, what the heck is `fopen` doing in a beginning C++ course at all? There are lots of small compiler differences like this, but they're hardly a big issue. – Eamon Nerbonne Jun 16 '11 at 09:46
  • I do agree that I generally prefer `g++`, but I think you're blowing the differences way out of proportion; it's certainly not significant enough to influence choice of IDE (for beginners!) IMHO. (removing downvote since code blocks is a fine idea). – Eamon Nerbonne Jun 16 '11 at 09:50
  • 1
    The Microsoft warnings aren't that bad for beginners. They should be using C++ classes; the Microsoft warnings are for C functions. E.g. they warn against `strcpy` but not against `std::string`, and that's OK for the target audience. – MSalters Jun 16 '11 at 09:57
  • @MSalters exactly. If they want to learn C++, they shouldn' even know fopen exists. – stijn Jun 16 '11 at 10:03
2

If you don't want to scary students with nasty or bulky look of IDE. Choose qt-creator. It's looks nice. Looks simple, but at the same time is very powerfull.

legion
  • 199
  • 1
  • 4
  • 13
1

I would have to recommend QtCreator, and it's a good thing to teach them to use a cross-platform GUI toolkit.

OneOfOne
  • 95,033
  • 20
  • 184
  • 185
0

It sounds like you want Eclipse for C/C++ Developers.

Graham Borland
  • 60,055
  • 21
  • 138
  • 179
  • 2
    No, definitely not. On Unix, maybe, but it takes a huge amount of time to support. On Windows absolutely not (it's broken as hell). – Šimon Tóth Jun 16 '11 at 09:25