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

Programming advice

  1. Mar 9, 2010 #1
    Ok, let me introduce you to my problem. I am very interested in and am actively applying to many summer research positions but I find myself somewhat limited towards what I can apply for.

    My issue is that most of the positions, if not all, want programming experience and I have only done 1 first year java programming course. So my thoughts are that if I fail to get a position for the summer, I will take summer courses AND also try to teach myself some programming skills to increase my competence in that realm and show employers that I am serious about obtaining a position in research.

    The question is,
    1) What would be a good language to focus on?
    2) Where might I potentially find good resources for self learning
    3) Do you have any recommended methods for teaching myself some programming skills.

    I am just finishing my second year at the university of victoria in a physics BSc and I love what programming I have done, so anything that seems particularly relevant to physics research would likely be a good idea!

    Thanks in advance for potential input.
  2. jcsd
  3. Mar 9, 2010 #2
    what kind of research do you want to be involved with?

    I would suggest learning C++ if you are wanting to impress, java is more of a stepping stone in learning how to program (although java has its benefits, C++ is miles more suited to scientific applications).
  4. Mar 10, 2010 #3
    C++ and Fortran are the main programming languages. People also use Python and R for various things

    I'd start with www.astro-sim.org[/url] and [PLAIN]http://www-theorie.physik.unizh.ch/astrosim/code/doku.php [Broken]

    Download an open source astrophysics package and start figuring out what makes it work.
    Last edited by a moderator: May 4, 2017
  5. Mar 10, 2010 #4

    Vanadium 50

    User Avatar
    Staff Emeritus
    Science Advisor
    Education Advisor
    2017 Award

    While learning languages is always a plus, I'd suggest you might want to learn programming. There's a big difference between being able to cobble a program together and knowing how to program.
  6. Mar 10, 2010 #5
    Would C++ be a good intro into programming for someone who doesn't have any experience or should I start with java as the OP did? Vanadium do you have any resources that teach the programming basics? Thanks in advance.

  7. Mar 10, 2010 #6


    User Avatar
    Homework Helper

    C++ is OK to start with. I wouldn't recommend FORTRAN; it has a reputation of being bad for everything except number crunching. Personally, I never liked Java because of its limited functionality and slowness.

    As to how to start, I'd suggest finding an online tutorial and following it. Make sure to read EVERY word and do EVERY exercise. If you skip a few sentences because they seem boring, you'll forget what they said a few weeks later.
  8. Mar 10, 2010 #7
    I started by learning java in school. It seems to be the popular choice in programming languages for schools. Recently I have begun programming in python, and it is so amazing. Python is such a great language I can hardly describe it. It makes everything so simple so that you can focus on the actual programming and not the implementation. It is also, imho, the perfect level to program on. It is high enough so you don't have to hold its hand for everything, and low enough so you can do alot of stuff still.

    So, as you can tell, I am a big fan of python. With that being said, I am not sure if I would recommend python as a first language. It makes things to simple (which is not bad at all) but as far as learning programming I think that if it were my first language then I would have missed out on some insightful things, (but I'm not sure of this).

    I think java is a great beginning language because there are A LOT of tutorials and information on the web. There are so many great tutorials/documentation out there. It is also (from what I have heard) a bit more friendly than c or c++.

    So personally I would recommend java or python for you first language, and python for your final language because its beautiful :).
  9. Mar 10, 2010 #8
    Also if you want to do industrial numerical programming, you are going to have to learn some C++. Why learn C++ if it's a pain-in-the-rear-end language? It's because it's a pain-in-the-rear-end language. People figure (usually correctly) that if you can program in C++ you can deal with anything else.

    The other thing is that more languages is better, so being proficient in three languages is better than just knowing one regardless of what that language is. Any industrial setting will have you program in several different languages, and there are situations in which you'll be asked to program in a language that you've never seen before in your life.
  10. Mar 10, 2010 #9
    The other thing is that you'll learn a lot by trying to read code and by changing code. One of the things that helps me write good code is haven't dealt with trying to read bad code. Also, just trying to download code and get it running will teach you a lot of stuff.
  11. Mar 11, 2010 #10
    On this note, work with some really complex and somewhat broken libraries and APIs. (Play with facebook's or google's if you want something sort of fun.) Get used to bad documentation and finding answers on random mailing lists. Learn to debug code. A friend's first project at a job was making a massive program using an internal API. The API was the documentation.

    Even better is when it's an internal company language, so the only people who can help you out are your fellow employees and the docs.

    I've been doing lots of python for the past couple of years, so I vote for that as a starter language. I've gotten much better at C/C++ by messing around with python 'cause it got me programming, and that's really the most important thing for learning to code.

    Another good place to start on coding projects is project euler.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook