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

Looking to become a decent programmer Any advice?

  1. Jan 6, 2009 #1
    Looking to become a decent programmer......Any advice?

    I have never really done any programming before, but I would like to start. I am not sure which language to learn. I am looking for something that isn't too hard, but very versatile. Something that can be used to do physics to games to AI to simple programs in general? I am leaning towards C++.

    I mean I have looked at programming and it seems like a foreign language(I guess it is) which I suck at, but I have been told it is math,math, and more math, which I am cool with because I love doing math and the typical problem solving that is involved.

    I mean I look at the books and feel overwhelmed at times.
    I was given Practical C and Deitel' "How to Program C++" for free, but I will look into other books if needed.

    Any advice? What to learn? What to learn from? How to go about learning?....etc.
    How long does it take to become proficient in programming? A month? A few months? A year? A life time?
     
  2. jcsd
  3. Jan 6, 2009 #2
    Re: Looking to become a decent programmer......Any advice?

    A good way to learn is to look at other people's code. Lots of good code to look through is available through the GNU license.

    Teach Yourself Programming in 10 Years
     
  4. Jan 6, 2009 #3

    jtbell

    User Avatar

    Staff: Mentor

    Re: Looking to become a decent programmer......Any advice?

    Actually, it isn't, unless you're dealing specifically with number-crunching type programs. There are certain types of math that it's useful to know something about for a wide variety of programs, which are taught in introductory "discrete math" courses at the college/university level.

    Nevertheless, skill in solving math problems does seem to correlate with programming skill, for many people, mainly because they're branches of problem-solving in general. If you're bad at solving "word problems" or "story problems" in math (or physics!), you're likely to find programming difficult. For most people, the hardest part of programming is starting with a verbal or written problem statement, or vague mental idea for a program, and figuring out what data you need to use, how to organize it (data structures), and how to process it (algorithms) to get the result you want to get. The actual coding in a specific language and debugging is fairly mechanical, and uses a different set of skills.

    Depends on how much time you devote to it, and your natural inclination for picking up new things. Figure a few months of solid work to get a basic knowledge and skill level, and a year to become somewhat proficient. If you get to the point where you can write a program, then look at it and think, "oh gee, I could have done that better!" and then rewrite it so it is better, that's a promising sign.
     
  5. Jan 6, 2009 #4
    Re: Looking to become a decent programmer......Any advice?

    If I were starting again I'd begin by learning Python. The language itself is easy enough to pick up that you'll be doing useful things within a week, and the large number of pieces in the standard library means you can quite easily do things that would be very difficult in a lower-level language such as C++. Give it six months and you should be a reasonably proficient Python programmer.

    Once you've got your head around Python you could then think about moving to C++. Beware though: C++ is a much more involved language. Becoming comfortable with the language generally seems to take about a year; becoming good at it takes much longer.
     
  6. Jan 6, 2009 #5

    harborsparrow

    User Avatar
    Gold Member

    Re: Looking to become a decent programmer......Any advice?

    I use, and have used, lots of different languages. For beginners, high schools are now required to teach Java. So if I were you, I would start with either Java or C# (.NET). They are very similar to each other but C#, being a little newer, is a bit friendlier; Microsoft's Visual Studio Express (the development environment that makes it easier to program) is either free or very low cost and is a great tool.

    If you become proficient in either of these, you could then try C or C++. C and C++ are much more difficult because the way they act depends on which operating system and hardware you happen to be using. So migrating a C or C++ program to other machines is always risky. However, you can count on a Java or C# program to work on most platforms these days.

    Python is also good, but it tends to be used on websites and it is not quite as generally well-known as either Java or C# (though people tend to love it). It would also not be a bad choice but is simply less mainstream, especially for games. I know that people do write a lot of games in both Java and C# (.NET), though for really high performance things like, say, real-time war simulations, they might have to fall back to C and C++ for parts of the programming because those languages have a little less overhead and thus can perform faster (though not always--Java and C# are quite optimized these days).

    I concur that it will take you a few months of hard work to become fully comfortable. Finding a good book is key; check out the book reviews on Amazon for whatever language you choose. I would also suggest buying two different books if you can afford it so that you'll have a couple of different perspectives.

    Finally, once you've gotten started programming, and if you like it, consider checking out Steve McConnell's semi-famous book, Code Complete (see http://www.amazon.com/Code-Complete...bs_sr_1?ie=UTF8&s=books&qid=1231253750&sr=8-1), which is an excellent philosophical discussion of many programming matters, and what it takes to develop skills that would make you seem, to others, "a cut above" the average coder.

    Finally, my advice is (even if you do take a course), do programming recreationally for a program that you really want to make. I first learned in college courses, where someone else chose what I was working on. I didn't really come to love it until I did my very own projects, the ideas I conceived of myself. THEN I was really really motivated to get it right.
     
  7. Jan 12, 2009 #6
    Re: Looking to become a decent programmer......Any advice?

    harborsparrow,Thank you so much for those valuable information.
     
  8. Jan 12, 2009 #7
    Re: Looking to become a decent programmer......Any advice?

    You should note that several things in harborsparrow's post are, at best, highly subjective opinions that don't agree with actual facts.
     
  9. Jan 12, 2009 #8

    mgb_phys

    User Avatar
    Science Advisor
    Homework Helper

    Re: Looking to become a decent programmer......Any advice?

    Particularly the Java part!
     
  10. Jan 13, 2009 #9
    Re: Looking to become a decent programmer......Any advice?

    harborsparrow has some good points. However, I thought I would point out that usually only online games are made with Java, since it is a cross-platform binary. Despite the fact that Java has made strides in speed, almost anything that requires calculations to be done quickly and uses lots of memory is going to be written in C++. That is why you will see any big budget game written in C++. I honestly have not had much experience with C#, but it looks very promising.
     
  11. Jan 13, 2009 #10

    harborsparrow

    User Avatar
    Gold Member

    Re: Looking to become a decent programmer......Any advice?

    Java (and C#) programs "warm up" once all their parts have been JIT-compiled. If there is enough memory (and on modern machines there often is), Java and C# programs then (after warm-up) run as native code exactly as fast as any C or C++ program would. Only the startup is a little slower.

    The myths persist, however.
     
  12. Jan 13, 2009 #11
    Re: Looking to become a decent programmer......Any advice?

    If you are looking to get into the game programming industry then learn C++ or possibly C# as the former will probably remain the standard for a while, and eventually I imagine get overtaken by C#. I'm not in that industry so I can't say that will be the case, but the way MS has been evolving their development tools that would seem to be the logical step.

    I think the debate about execution speed isn't that big a deal right now for the OP. He isn't looking to write some production-ready piece of software at this time, he is looking to learn programming. I am partial to C, because that is what I deal with all day along with assembly, and my intro CS class was C++ based, but I imagine java would be a good place to start and learn about programming and about object oriented programming in particular. The basics of the language are pretty simple, then you just need access to javadoc for all the standard packages (do they still make the hardcopy almanacs?). You don't have to deal with pointers in java, and garbage collection(memory management) is handled for you. I guess an argument could be made that it would be better to start with C, or C++ in order to learn to deal with those issues properly from the start. The point is don't worry too much over language selection while learning about programming, you can work on learning a language best suited for a future project later. Don't tie yourself to just one language. Knowing multiple languages allows you to think about and attack problems in different ways. What might be extremely painful to accomplish in one language, could very well be easy to do in another. Defining the right problem is the most important step to solving the task you are trying to solve. A lot of good examples of this can be found in Jon Bentley's excellent books Programming Pearls and More Programming Pearls.

    Depending on how much time you plan on investing, and how serious you are perhaps spend some time playing with some languages that focus on different programming paradigms. Play with a functional language like Lisp, or ML. Play with a logic language like Prolog. Learn to think about a problem as a bunch of objects with an object-oriented language like Java. Play with C and learn about pointers, memory management, and how easy it is to shoot yourself in the foot if you are not careful. Get to know your processor and learn some assembly language (or spend time looking at assembly code generated from source for a higher level language) and understand how nice it really is that you don't have to spend your time trying to write your programs at that level.

    Learning a programming language is much easier than learning a foreign language. Natural languages always have tons of exceptions to all of their rules.

    Perhaps others can list some books that would be good for learning a specific language. I imagine the O'reilly books for learning different languages do the job well enough.

    If you want to learn C, the best book is still Kernighan & Ritchie's The C Programming Language.

    From what I recall Bruce Eckel's books Thinking in Java and Thinking in C++ were okay.

    Like I said before, look at other people's code.
     
    Last edited: Jan 13, 2009
  13. Jan 15, 2009 #12
    Re: Looking to become a decent programmer......Any advice?

    If you want to make games, but dont want to learn a somewhat difficult language (like C), try game maker by yoyo games. Im taking game design classes at a private university, and thats what they start with, while your learning C and C++. Gamemaker also helps you understand event driven coding, which seems to be used frequently in windows apps and games. However, keep in mind that I am by far not an experienced programmer. :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Looking to become a decent programmer Any advice?
Loading...