Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Jul 26, 2009 #1
    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.
     
  2. jcsd
  3. Jul 27, 2009 #2
    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.
     
  4. Jul 27, 2009 #3
    Why don't you just install both OS?
     
  5. Jul 27, 2009 #4
    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.
     
  6. Jul 27, 2009 #5
    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.
     
  7. Jul 27, 2009 #6

    Hurkyl

    User Avatar
    Staff Emeritus
    Science Advisor
    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.
     
  8. Jul 28, 2009 #7
    There are of course many ways of doing this. My preferred method for console apps is just

    Code (Text):

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

        return 0;
     
    Nice and portable.

    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.
     
  9. Aug 3, 2009 #8
    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).
     
  10. Aug 5, 2009 #9
    It's funny, I was born and raised on the Unix side, and for me
    it's the opposite : I get a very satisfied feeling when I find where to click under MS :biggrin:
     
  11. Aug 8, 2009 #10
    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.
     
  12. Aug 10, 2009 #11
    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.
     
  13. Aug 10, 2009 #12
    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: Aug 10, 2009
  14. Aug 10, 2009 #13
    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.
     
  15. Aug 10, 2009 #14
    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: C,C++,Fortran,Java: better to learn them in linux or windows?
  1. C to fortran (Replies: 9)

Loading...