views:

1948

answers:

18

What is the best operating system to develop while using C++? I would like the OS that has more tools and software for C++ development. I also want to develop only for the command line, because I find GUI development in C++ to be confusing.

+40  A: 

Well, to start out I recommend coding on linux with g++ for your compiler, gdb as your debugger and <insert favorite text editor> as your text editor.

For me when I was first learning C++ I always had the following windows open:

  • Termial for compiling
  • Browser at cplusplus.com for documentation
  • Gedit for editing files

That will help keep things simple to start with.

If you start doing anything more than just learning and getting used to the language and environment, I would switch to a more feature filled IDE. (Visual studio, Eclipse CDT, Codeblocks)

jjnguy
+1 for helping in my question and to learn C++, for like Linux and for use Gedit. Thanks!
Nathan Campos
Especially for CLI junkies, emacs arguably provides the best interface for debugging C/C++ apps with GDB.
Chris
Thanks Chris, but in my opnion emacs is so confusing.
Nathan Campos
That's why I like Gedit.
jjnguy
In regards to documentation I also find http://www.cppreference.com to be quite good.
Mike Lowen
cplusplus.com is not an argument as far as it accessible from any OS :)
Kirill V. Lyadvinsky
That is true. However, it is just there to be helpful, not a point for a Linux env.
jjnguy
For a beginner, the g++, gdb and vi/emacs combo is a learning curve steepness explosion! Honestly, I would recommend something simpler, like Visual Studio, XCode, ..
StackedCrooked
Don't forget valgrind! valgrind helps a lot for beginners to point out flaws from early days!
LiraNuna
vi is a bit of a learning curve, but g++ is dead simple. Even gdb isn't bad, but who uses it directly anyways? There are tons of wrapper programs for it (eclipse being my favorite, I'm somewhat ashamed to admit, even though I use Vim for all my editing).
rmeador
Wow, did Linux win this? I'm surprised. This croud is fairly Microsoft heavy.
jjnguy
For a beginner, learning the individual tools is essential to a deeper understanding of C and C++ *and* helps immeasurably anytime you want to deviate (even slightly) from the canned options an IDE presents. If your favorite editor is the one in an IDE, then use that; but learn both how to invoke the compiler independently and the basics of (some variant of) make.
Roger Pate
+2  A: 

The answer to this question is subjective by the question's very nature, but I'll go out on a limb and say that a Linux or Unix environment is probably easier to work with when doing C++ programming from the command line.

That said, many of the tools (like the G++ compiler and GNU make) you would use in such an environment are portable to other OSes, such as Windows (see Cygwin or MinGW). However, they're a little more integrated with the environment in Linux.

Nick Meyer
Thanks, but i hate to use tools that are not of my OS, like aMSN in Windows and other things..., because of this i have another PC with Linux.
Nathan Campos
@Nathan, sorry, I think I misread your question as performing your coding outside of an IDE, rather than developing a program with a command line interface.
Nick Meyer
But i'm refering to the tool or ide that i want to use. Thanks!
Nathan Campos
+32  A: 
Kirill V. Lyadvinsky
It looks like windows is winning the war so far.
jjnguy
Despite my significant 1 min head start even.
jjnguy
I like Ubuntu. But I have to admit that gdb was made when noone knew what "usability" is.
Kirill V. Lyadvinsky
Ha, I hate gdb as well. I felt bad suggesting it actually.
jjnguy
Even the command line debuggers on Windows (ntsd, kd, windbg) are better than gdb imho.
Steve Rowe
I take it none of you have looked at DDD, then?
anon
+1 Neil... The debugger in Kdevelop is pretty cool too, and Valgrind also..
LB
DDD :) that is an interesting tool. Cannot really be compared to the debugging capabilities of VS (even if I work with linux and use macosx in my spare time, I still value VS for what it's worth).
David Rodríguez - dribeas
Visual Studio is as close as it comes to "the worst way possible to start learning C++." Creating the sort of people who can't tell debugger from a compiler.
EFraim
I agree that MS have probably got the best debugger when it comes to the UI. But I think you all miss the point about gdb - it's not so much a debugger as a framework for writing debuggers. Unfortunately, no one has come up with a good UI using that framework, though DDD comes close.
anon
@EFraim, a lot of people started with MSVC++ and now they are great programmers.
Kirill V. Lyadvinsky
Concur with jia3ep. Personally I dont think the distinction between the debugger and compiler is that important to a beginning programmer anyway. Its like requiring someone to know the difference between carburetor and an ignition system before they can learn to drive.
Jherico
Argh, debuggers. VS has the best one when it comes to usability, Windbg has most features, but it is a pain in the neck to use. gdb is OK, but behind Windbg and even VS when it comes to features. ddd is a joke, sorry Neil :)
Nemanja Trifunovic
In my (limited) experience with DDD, I found the UI pretty sparse. Worse, it had a tendency to get out of sync with the underlying gdb forcing me to start the debugging session over. Definitely not something I would recommend.
Steve Rowe
@jia3ep: What you said might be right, but what I claim is that they got to be great programmers *despite* the way they started.
EFraim
DDD is not a joke at all when dealing with complex data structures.
EFraim
@Kirill: GDB's origins track back to a time when "usability" meant you could use it over a 1200 baud connection and it didn't take more CPU than the program being debugged.
Roger Pate
+5  A: 

Depends what your target platform is. Generally I would develop on the same platform that my programs are targeting.

Just because you may be developing a command line program for example, doesn't make the Visual Studio debugger any less sweet or fit for the task.

whatsisname
I have the two plataforms: Windows and Linux. Thanks!
Nathan Campos
A great way to learn multi-OS development, then. Start by writing simple programs, and make sure they run on both systems.
Nosredna
+2  A: 

If you want to learn a whole lot of tools, especially command-line tools, then Linux is an easy answer. Edit: I should also note that this will help you gain a more historical perspective on C++ development, as developing from the command line using traditional *nix tools has sorta looked the same for a long, long time. In fact, on my Linux machine I can in only a few minutes setup an "environment", if you can even call it that, that's just about identical to what I was using in 1994 on OSF (gcc, emacs, make, etc). I should also clarify that there are certainly IDEs for Linux, you're not just stuck on the command line...it's just that most tools in this camp are command-line first.

If you just want to learn C++ (e.g. click a button to compile, debug, etc without caring about the nitty gritty of compiling and linking), then there are a lot of IDEs for Windows that'll work fine and are easy to install, such as Bloodshed.

As far as communicating with the end user via the command line, it doesn't really matter which you choose, cout << "will work the same on either platform." << endl;

Boden
+3  A: 

Thanks to QtCreator you can get a pretty decent development (+debugging) environment setup on Linux, Mac, or Windows without too much hassle. You don't even need to really use Qt if you don't want too.

That being said, the OS you are developing on becomes less relevant if you are only using it for learning. The OS you use should not get in the way of your development process so pick the one that is most comfortable to you. Although, once you have a target platform for whatever you are working on, it would make the most sense to develop on that one.

Jesse
A: 

hey, don't forget good old DOS Borland Turbo C++ 3.0. I learned C++ using that compiler loooong time ago. It perfectly supported anything from compiling C code to C++ sophisticated features like RTTI and templates. And it is ideal for command line! At least I thought so back then.

justadreamer
Turbo C++ was nifty. I also used Turbo Pascal quite a bit. Anyhow, Turbo C++ 3 didn't use the final C++ standard... at least I don't think it did. So things like STL are out of the question.
Boden
In DOS I used Watcom C++ and Multiedit as editor. That was fun.
Kirill V. Lyadvinsky
Actually it's C++ standard support was pretty indecent. Alas, there was no standard yet! Really not an ideal way to start learning now. Well at least it will teach you to appreciate RAM.
EFraim
Yes STL as we know it now will not work with TC++3.0. TC++ was more like C with classes
justadreamer
A: 

Using an IDE should not be challenging - take the time to try one of the modern ones. If you want command line tools all the OSes and compilers generally have whatever tools you need.

For me, the real issue is the debugging and other productivity improving tools I can use. I prefer to use the IDE for stepping through code and debugging. Using a command line debugger is a frustration I hope to have left behind for good...

As others have said, work on the platform you are most comfortable with consider the platform(s) you are targeting.

With VMs and cross platform tools and frameworks this is less and less of an issue.

EDIT

You'll find that time spent learning how to be productive with your IDE(s) (whichever you choose) will be time well spent. If you can't get someone to show you (or just watch someone coding), then try some online tutorials or webcasts. It will be well worth it.

Your improved productivity can be huge. In general learning the tools will be a great help.

Tim
A: 

what jia3ep said...

Hardryv
Please, post this is a comment not here as an aswear. Thanks!
Nathan Campos
...or simply upvote him...
Nicolas Simonet
I did up-vote him, but my low rep doesn't allow me to 'comment' on someone else's post ;) -- although as you can see someone else's rep lets them down-vote me... -- at the rate it's going it'll be another year before I can post a comment
Hardryv
+10  A: 

I think it would be better to ask which OS you are familiar with and which OS you want to target with your implementations. I wouldn't switch operating systems just to learn a language. Both Windows and Linux (but not as much the Mac) are great places to learn C++.

Windows is best programmed in C++. The underlying APIs are all C or C++ based. The documentation is all aimed at C++ programming. Visual Studio is generally considered the best development environment for C++ on any platform (I'm sure I'll get disagreement from some corners on this one). The debugger in Visual Studio is superior to gdb/ddd that you'll find on Linux.

Linux is also a great C++ development environment. Gcc is a great compiler. Gdb is an acceptable debugger. There are lots of good tools and documentation available for how to use C++ here. Most of the OS APIs are aimed at C or C++ development.

You won't go wrong with either choice. The frustation of trying to learn a new OS along with a new language may be too much though. Stick with what you know.

Steve Rowe
The MS platform is a lot simpler to work with in .NET... IMO
Tim
@tim - Agreed, but that is really a different platform entirely. Win32 is one platform. .Net is another.
Steve Rowe
A: 

Best OS for C++: Mac OS X.

All the Unix CLI, AND all the GUI, as well as the Posix headers and many many free tools.

XCode is a decent IDE, and you can also use emacs, which can function as a command-line IDE. (so can vim, but I am not a vim person. ;-) ).

Paul Nathan
+2  A: 

If you use GNU/Linux and you look for something more like Visual Studio I would suggest that you install Eclipse CDT. That will give you a good IDE with clever auto completion (not just ctags/hippie expand), code browsing, project/build management and a graphical debugger.

+1  A: 

Linux especially since you're interested in using the cmd line. Infact c/c++ development was what originally attracted me to Linux. GCC is top notch and there's a wide variety of build tools (make, scons, cmake, jam). I would start out using gedit or something similar and then take some time and learn how to use vim.

hacim
+1  A: 

For just learning a new language, I think it's important to keep it straightforward and simple, so you can just focus on the code itself. With vi + gcc, I can write a single .cpp file and have it compile to a single executable. No PDBs, no DSWs, and no DSPs cluttering up my environment and possibly causing problems. Perfect for trying out new things to see how they work.

While IDEs are certainly useful tools for real world large projects, I've seen time and again where the extra complexity they introduce just gets in the way. When someone's still trying to learn how #include and cout work, they don't need to be worrying about project and solution settings. Therefor, I recommend using a text editor with syntax highlighting and gcc or some other standalone compiler rather than an IDE for learning.

As for the OS, learn on whatever is most comfortable to you. Learning a language (especially C++) is hard, and you don't really want to be fighting with a foreign OS at the same time. If you're comfortable on both Windows and Linux and have both readily available, switch back and forth. It'll make you more flexible, and if you're doing it right, your code should run the same on both OSes.

Warren Pena
+2  A: 

That's easy. Just choose the OS that you are most comfortable with today. Windows, MacOSX and Linux all have a good C++ tools.

StackedCrooked
+1  A: 

Either Mac or Linux. Windows has an extremely primitive command-line support.

mannicken
... Which can be easily remedied by installing and using PowerShell, Windows Services for UNIX, MSYS, or Cygwin.
greyfade
no, powershell is fail.
Matt Joiner
+1  A: 

I'm admittedly biased, but I'd recommend Linux. If you want to develop via command-line, it's perfectly suited to it; if you want an IDE, Code::Blocks is pretty nice.

If you decide to use vim for command-line hacking, I highly recommend checking out OmniCPPComplete (the site won't let me post another link, but it's just a Google search away). Sadly, it's not up to par with VS's Intellisense, but it's a heck of an upgrade to ctags. :D

jsandell
+1  A: 

There is no difference what OS you will use. You only need conformant compiler and good text editor.

big-z