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

Programming for beginners

  1. Apr 12, 2012 #1
    This is a topic I have absolutely no clue about. I don't know where to start, or what to even do.

    If someone could please tell me the best language/software to start with it would be greatly appreciated.

    I've been told Fortran is a really good place to start, but is Fortran a language or would I have to learn C in order to simply understand Fortran?

    Basically I just need someone who can guide me on the best places to start and the best languages to learn.
     
  2. jcsd
  3. Apr 12, 2012 #2

    micromass

    User Avatar
    Staff Emeritus
    Science Advisor
    Education Advisor
    2016 Award

    Last edited by a moderator: May 5, 2017
  4. Apr 12, 2012 #3
    My university, as well as other Universities as well, start off with C++. The first programming language I ever learned (self-taught) was C#. C# helped me understand C++ even more. If you learn C++, you will be able to read some C code. Some syntax is different. Regarding Python, many people would say that Python is a very easy language to learn. Choosing what language you want to learn depends on what you want to do in the long run. What do you want to do in the long run?
     
  5. Apr 12, 2012 #4
    Should I start off with C?

    And how is C# different from C?

    I'm 15, so I don't really know what I would want to do regarding programming.
     
  6. Apr 12, 2012 #5
    I started self studying C last summer and found it fairly frustrating because of the syntax but I started from absolutely no knowledge of programming. After a while, I tried Python out and my learning went much faster. I think this was because Python tutorials and syntax isn't written so cryptically with programmer's jargon. For example, in C, words like arguments, parameters, argc, argv, scanf, and sscanf are all used when talking about taking input from the user or screen. In Python, you would write something like x = input("Enter a number:") and it's done. In school (EE), I do a lot of C programming and I've caught now but I don't think I would have gotten this far self studying it because of the jargon barrier.

    A lot of the choice depends on your goals. If you're going into EE or CompE then I would still start with Python but try to translate to C after you got your feet wet. If you're just self studying and want to learn the skill then grab Python and get started. They have so many great tutorials on Python.
     
  7. Apr 12, 2012 #6
  8. Apr 12, 2012 #7
    I would say if you have an application that uses C, but if you don't then I would just keep learning Python. After a while, you'll find that if you know "programming" then getting into another language isn't that difficult. It's the first language that takes some time.
     
  9. Apr 12, 2012 #8

    jtbell

    User Avatar

    Staff: Mentor

    Ask five progammers which language you should learn and you'll get seven or eight different answers. :smile:

    Don't agonize over it too much. Pick one that you can find a book (or other resources) for, that look like you can follow them fairly easily, and dive in. Focus on the generic programming concepts that apply to most programming languages, and you'll be able to pick up other languages easily when necessary. Each new language that you learn will deepen your understanding of your other languages, as you compare them. If programming becomes more than a trivial part of your life, you'll end up learning several languages.

    When I was in college in the early 1970s, "programming" meant pretty much either Fortran (for scientific types) or COBOL (for business types). C, C++, etc. didn't exist yet. I learned Fortran, and used that through graduate school. Since then I've learned Pascal, C++ and a bit of Scheme (a dialect of LISP) so I could teach introductory courses in them, along with Perl, HTML (OK, that's not really a programming language) and SQL for my own use, and am now learning PHP and Objective-C.
     
  10. Apr 12, 2012 #9

    Pythagorean

    User Avatar
    Gold Member

    I started with matlab :)
     
  11. Apr 12, 2012 #10

    chiro

    User Avatar
    Science Advisor

    Hey jbmiller.

    I would start off with a procedural language first, or at least a language/runtime environment that lets you write procedural language. When I say procedural language all I mean is code that gets run from the top of the page to the bottom like if you wrote the code on a big scroll and the computer went from the top of the scroll and worked its way down to the end of the scroll: that kind of thing.

    If you want to understand more about how things really work, go for C. If you want to start to getting something up quickly, try something like Python. If you really want to understand how computers really work, do assembly. If you want to understand object oriented programming, pick Java or C++.

    If I were you I would keep it simple first: look at something like Python or C: something where you don't have to worry too much about having to do everything else, but just enough so that you are actually doing something and learning something and with this in mind it might be better if you learn something like Python.

    Once you start to get the hang of this kind of thing and want to go deeper, then try something like C. I would recommend you know what is going on with C before C++ but this your own decision.

    Good luck!
     
  12. Apr 12, 2012 #11
    Thanks for the feedback guys, its really helped!

    I'm probably going to start with C, then after I'm really good with that I will move on to C++.
     
  13. Apr 13, 2012 #12

    jhae2.718

    User Avatar
    Gold Member

    I started learning C and Python (my two favorite languages, C for low-level, Python for OO and high-level). Along the way I picked up MATLAB, C++, and a few others.

    I haven't used it personally, but I've heard good things about Learn C The Hard Way.

    The "C Bible" is the iconic K&R, The C Programming Language by Kernighan and Ritchie.

    There's a lot of commonality between C and C++, but each language has its own idioms (e.g. C printf() compared to C++ cout). Going from one to the other isn't particularly difficult (though it is probably easier to go from C to C++ since C is more low level; it's been described as portable assembler...).
     
  14. Apr 13, 2012 #13

    Mark44

    Staff: Mentor

    LISP = Lots of Irritating Superfluous Parentheses.:eek:

    What little I know about Lisp goes back about 30 years when I bought a Lisp implementation for the Apple II computer I had at the time. I have to say, though, that at least one of the ideas that (I believe) came out of Lisp has made its way into more modern languages - lambda expressions. These are present in C# and other .NET Framework languages.
     
    Last edited by a moderator: May 5, 2017
  15. Apr 13, 2012 #14

    jhae2.718

    User Avatar
    Gold Member

    Unfortunately, due to depletion of the Strategic Parentheses Reserve, Lisp can no longer be used on a regular basis.

    Fortunately, the supply of curly braces is still high.
     
  16. Apr 13, 2012 #15

    jtbell

    User Avatar

    Staff: Mentor

    Or semicolons! What would a C or C++ programmer do without semicolons? :eek:
     
  17. Apr 13, 2012 #16

    jtbell

    User Avatar

    Staff: Mentor

    Last edited by a moderator: May 5, 2017
  18. Apr 13, 2012 #17
    I think like many others said, C++ is a great language to start off with. It is an Object Oriented Programming Language, which makes it very special and convienient to work with. Once you get a hang of C++, you could move to any other language, say Java, or Visual Basic, with are very similar, except the syntax. Assuming you master C++, you could get into iPhone App development, and similarly, if you master Java, you could get into Android app dev, and if you master Visual Basic or any Visual Studio Language(VC#,VC++,VJ#,etc.), you could get into Windows Mobile app dev. Choose wisely, and most important, have fun!
     
  19. Apr 13, 2012 #18
    I just took CS101 @ Udacity, it's a free online university of sorts with 7 week long computer science courses (I spent about 4-5hrs per week doing a course including homework). They teach programming in Python, and if you start with the "How To Build A Search Engine" course, no knowledge is assumed and they start right at the start. By the end, you'll have a working search engine and a good understanding of how it works, and of Python. I recommend at least taking a look, it's a great opportunity. I'm taking another course there starting next week.

    Also, for what it's worth, I learned C first and it was fine. It's a bit tricky in places, but you learn some good programming techniques, and I've found the transition to other languages to be pretty straight-forward.
     
  20. Apr 13, 2012 #19
    There are different things going for different languages.
    I suspect what we have here is mostly personal preferences.

    To that end - here's mine - C# - mostly because it holds your hand pretty nicely.
    Example: No int == 0 being equal to false. Its either bool or int.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook