Learning C++ on Linux or Windows?

15,327

Solution 1

Doesn't really matter what platform you write your code on.

If you want to verify that your code is portable, you could install cygwin and gcc as well as visual studio.

Then you could compile with both compilers without having to dualboot

Solution 2

If your goal is simply to learn C++, it doesn't matter what platform you use because C++, as a general purpose programming language, is not platform-specific. You can learn standard C++ on any platform with a decent C++ compiler.

Solution 3

If you want to practice / test on Linux, you can simply create a virtual machine, for example with VirtualBox.

Solution 4

Do i miss something if I develop in C++ only on the Windows platform?

Valgrind.

Solution 5

Not really if you don't use OS specific calls or libs.

If you are asking about IDEs, compilers etc, that's a metter of your preferences about it.

Share:
15,327
Admin
Author by

Admin

Updated on July 22, 2022

Comments

  • Admin
    Admin almost 2 years

    Since you 'should' learn C/C++ and as part of 'learn as much languages as possible', i decided to learn C++ in depth.

    My OS is Windows and my question is should i re-install Linux as a dual boot to learn C++ on Linux?

    Do i miss something if I develop in C++ only on the Windows platform?

    (possible duplicate: https://stackoverflow.com/questions/1128050/best-operating-system-for-c-development-and-learning)

  • Admin
    Admin over 14 years
    I'm familar with Linux and I'm not a beginner. But if you look at job descriptions you often see C++ in combination with Linux so i wondered if C++ Linux is different then C++ Windows. Any thing that Linux is better in, eg: networking.
  • Admin
    Admin over 14 years
    Because I'm a hardcore gamer and i need C# for my work ;) Lets not start a flame war (A)
  • Panic
    Panic over 14 years
    OSs are like languages, there isn't a better one. It should be selected as the better tool for a given job...
  • Admin
    Admin over 14 years
    @Panic Gaming on Linux is a no go but i see your point, every project should be approached differently.
  • mh.
    mh. over 14 years
    @ReDAeR: The systems are different, but you can't say that Linux is "better" in general (although Linux geeks might see this differently ;-)). I'd say, make a decision which system you want to learn first, maybe chose a project to implement, and finish it. After that, you can do the same on the other platform to learn about the differences. If you want to do network programming, I'd suggest starting with Linux because in this area, the corresponding UNIX APIs are the de-facto cross-platform standard and Windows is an "exotic" system (where libs emulating corresponding UNIX APIs exist).
  • RedGlyph
    RedGlyph over 14 years
    On the other hand, a good IDE (be that Visual Studio, Qt Creator, others which can be found in other questions here) helps when you start. It gives you a map of the classes, helps with completion, has integrated help, makes it easier to spot the errors after compilation... I wouldn't turn that down.
  • Admin
    Admin over 14 years
    Thank you, mh. So UNIX is better if want to learn about networking programming. As project i'm trying to make a text editor in the console, something like nano.
  • mh.
    mh. over 14 years
    @ReDAeR On UNIX and Windows, the code to control terminal output (e.g. move the cursor, output something at a specific position, ...) is totally different. I remember terminal stuff being documented badly on Windows, so this might be a reason to do it with Linux first, but it was many years ago that I was programming in this area, so it might have improved in the meantime.
  • ndim
    ndim over 14 years
    There are a lot of other really useful tools on Linux. All in all, those tools make Linux quite developer friendly... very much in contrast to Windows.
  • StackedCrooked
    StackedCrooked over 14 years
    I'd say the tools make Linux expert-friendly, but not beginner-friendly.
  • Michael Aaron Safyan
    Michael Aaron Safyan over 14 years
    On the other hand, starting with Visual Studio will give you non-standard stuff like "stdafx.h" as well as all of Visual Studio's particular "#pragma" statements (e.g. "#pragma warning").
  • Admin
    Admin over 14 years
    +1 Not sure why you were down-voted for common sense... He's already using Windows, states he's using C# (most likely Visual Studio), and using non-standard stuff is optional
  • StackedCrooked
    StackedCrooked over 14 years
    @Michael Aaron Safyan: not if you check the "Empty project" setting when creating your solution. Non-standard stuff has never posed a problem for me.
  • Admin
    Admin over 14 years
    I started working on it today, if you are interested: pastebin.com/f356b0274
  • legends2k
    legends2k over 14 years
    I feel that without using an IDE, when one does compile or link via command line manually gives more insight on the various compiler options/flags, which in turn throws more light towards the languages' nuances. Sure it's easy to use an IDE, but it abstracts all these and I know people who've 3 years of experience without knowing when compiler options their projects invoke.
  • Zed
    Zed over 14 years
    @LiraNuna: Because he already has Windows installed?
  • Panic
    Panic over 14 years
    @RedGlyph - Don't get me wrong, Visual Studio even after being bloated as it is (after the v6) is the if not the best compiler one of the top and has the best IDE (even if it has lots of problems) the major one being pushing .net and insidiously attempting to lock you into the platform. One of my pet peeves about posts on stackoverflow.com is seeing people refer to C++ as unmanaged C++...
  • Cheers and hth. - Alf
    Cheers and hth. - Alf over 12 years
    why on Earth would you set up "the equivalent development environment on Windows"? try setting up the equivalent of the Windows dev environment, on *nix. in other words, you were assuming your conclusion.