# C,C++,Fortran,Java: better to learn them in linux or windows?

I need to learn C, C++, and Fortran, and Java and am thinking of just ditching Vista and installing Ubuntu.

Attempt to sell me on or against doing this. The only reason I have ever used windows is for gaming but i don't game much any more and am only mostly going to be on my home system to learn programming for the next year.

Related Programming and Computer Science News on Phys.org
Either should be fine.

Personally, there's a very satisfied feeling I get when I use linux to code, especially in C/C++.

But Windows is good, too. If you're just learning for the first time, I might suggest you stick with Windows and go for the Microsoft C++ express edition, any Java IDE, etc.

You could go either way.

Why don't you just install both OS?

You paid a descent sum of money for a Windows Vista license, so why would you erase it?

My recommendation would be to use both OS's.

If it is a powerful computer, you can install and run Linux in a virtual machine at pretty close to the same speed (minus good graphics support).

If not, you can repartition your computer, and install Linux, and boot to the OS of your choosing.

If you just want to learn UNIX there are a few other options too, such as the UNIX subsystem that is included in professional versions of Windows, UNIX emulators such as cygwin, and x-window emulators.

I think it's better to use the GNU compiler that comes with Linux rather than through some IDE (Visual Studio, Netbeans, ect.). The reason being that you will spend more time learning to actually program rather than learning how to use the IDE. You'll also have a better idea of what is going on underneath the hood because you won't have to interface with an IDE. That being said, GNU compilers are available on both Linux and Windows (MinGW). Also, the Java compiler from Sun Microsystems is the best(and the standard) even though it is not GNU. Either OS should be fine. If you go with GNU MinGW on Windows, be sure to use a text editor such as Notepad++ or Crimson Editor. There is also some value to knowing an IDE, although I think it will slow youdown if you won't to go deep into programming. For one or two three credit courses this might not make much difference.

Hurkyl
Staff Emeritus
Gold Member
I'm going to have to disagree. A beginning programmer is unlikely to benefit from having to explicitly manage the compile/link/build process, let alone set up and maintain his build environment!

I haven't really observed Visual C++ or Eclipse getting in your way -- I'm not sure what you're thinking when you reference spending time learning the IDE instead of learning to program. The only awkwardness I've noticed is that in MSVC you have to remember to end your programs with cin.get() (or getchar()) to keep the console window from vanishing.

But it's not just the fact they are IDE's -- Visual C++ and Eclipse (for java, at least) offer exceptionally good editors. Even when I was using Cygwin/g++ to do my compiling/building, I still used MSVC to do my editing. Additionally, I don't expect a beginner to be able to use a debugger that isn't part of an IDE.

I haven't really observed Visual C++ or Eclipse getting in your way -- I'm not sure what you're thinking when you reference spending time learning the IDE instead of learning to program. The only awkwardness I've noticed is that in MSVC you have to remember to end your programs with cin.get() (or getchar()) to keep the console window from vanishing.
There are of course many ways of doing this. My preferred method for console apps is just

Code:
#ifdef (_MSC_VER)
system("PAUSE");
#else
double tmpVar;
std::cin >> tmpVar;
#endif

return 0;
Nice and portable.

Hurkyl said:
But it's not just the fact they are IDE's -- Visual C++ and Eclipse (for java, at least) offer exceptionally good editors. Even when I was using Cygwin/g++ to do my compiling/building, I still used MSVC to do my editing.
MSVC is, without any shadow of a doubt, the best C++ editor by miles. For that reason alone I'd encourage a new programmer to use it.

It does'nt realy matter on which platform you learn to program but Linux is a better choice because most the necessary are included (or if not freely available).

It's funny, I was born and raised on the Unix side, and for me
Personally, there's a very satisfied feeling I get when I use linux to code, especially in C/C++.
it's the opposite : I get a very satisfied feeling when I find where to click under MS

The biggest problem I have with windows is the price. Just compare the price of one windows licence and the price for linux. There is simply no comparison: linux is free while windows is the pay-your-pants-of OS.
Plus if linux is a better choice (Referring to secutity and stability, etc) linux is way better for any person, esp. for devs.

But if windows makes you happy, is the best choice for you.

There is a reason why linux is a great platform for programing and that is because most people who use it love programming. If you are serious about coding, I would recommend getting a linux partition but keep in mind that linux != windows, it isn't just going to be a vista with added features. Almost everything that a linux user uses is free (in the sense of freedom), so you can take a look at the code and edit and learn.

Linux also has excellent documentation. Any software that has a free license is also likely to have good documentation accompanying it. Linux offers a great amount of libraries you can use. For example for a gui you have the choice of Qt, GTK, wxWidgets etc..

Personally, I don't like Ubuntu. It kills the *nix philosophy and it is a very broken distro. I personally use Gentoo but you should do more research and find a distro that is right for you. As for an IDE, I use makefiles and vim (along with ctags). Even if you decide not to use a linux distro I recommend that you try vi (or some clone). It is very nice to code in.

I've found linux is ridiculously efficient at using a system's resources, which is the main reason I was attracted to it. I took an old pentium 4 with about 512 MB ram (which I would have thrown in a dumpster by now since windows XP was incredibly slow) and installed ubuntu. For web browsing, e-mail, and a little bit of c++ coding in my courses, that computer is now perfect. It runs smoothly and performs basic tasks well. I guess XP and Vista were just too demanding.

If you have any kind of older computer like that available to you, why not load ubuntu on that and leave your windows machine alone for the time being? Then you can have a computer for development, and keep one for gaming which you won't have to reboot every time you want to play (just in case you get bored).

And I'm not using any IDEs on the linux machine, even though I'm a beginner. I'm somewhat familiar with Microsoft visual studio and Bloodshed on windows, but I feel like right now (at the intro level) there's no difference between the IDE and using a text editor and terminal to finish coursework. I can just write extra stuff into my code if I want to see what particular function produces, and comment it out before I turn assignments in.

Last edited:
I would not recommend you switch to linux for this reason.

Although gcc/g++ is an excellent compiler for C/C++, it's not an IDE, and everyone I know who uses it with makefiles and long commandlines ends up being highly disorganized and wasting tons of times. In contrast, MSVC is the best IDE, and has a great compiler too, which is often much faster than g++.

Java is cross platform, I hate Java but I hear Eclipse is a popular compiler, and that's cross platform. Fortran I don't know, but I highly doubt there is any advantage to using Linux.

In general the only advantage to using Linux is an increased feeling of egotism due to all the additional problems you will be forced to overcome just in order to get basic functionality on par with windows. This will make you feel like a true system programmer...although it won't get your work done any faster.

I would not recommend you switch to linux for this reason.

Although gcc/g++ is an excellent compiler for C/C++, it's not an IDE, and everyone I know who uses it with makefiles and long commandlines ends up being highly disorganized and wasting tons of times. In contrast, MSVC is the best IDE, and has a great compiler too, which is often much faster than g++.

Java is cross platform, I hate Java but I hear Eclipse is a popular compiler, and that's cross platform. Fortran I don't know, but I highly doubt there is any advantage to using Linux.

In general the only advantage to using Linux is an increased feeling of egotism due to all the additional problems you will be forced to overcome just in order to get basic functionality on par with windows. This will make you feel like a true system programmer...although it won't get your work done any faster.
Another advantage is learning how to deal with UNIX programming. A good amount of the high performance computers used in scientific fields to deal with complex problems that require significant processing power run on some flavor of UNIX (or in Linux's case, UNIX-like OS).

But, I tend to agree. For someone who is just learning, using Visual Studio presents significantly less headaches.