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

Fairly new to programing.

  1. May 26, 2010 #1
    So I've been looking for some guidance the past few days. I want to learn to program different things. Mainly games, or some kind of windows program. The thing is i have no idea where to begin, what program is best to start with and then eventually id learn a few.

    I plan to self learn a lot then take courses if need be to back it up. As of right now this will be more of a hobby then a career path.

    This forum seems to be pretty helpful and i was curious if someone could help point me in the right direction.

    I'm currently looking into:
    Visual Basic

    I know of these ones, and that they are mainly used, but i dont know in detail what each one is actually used for. I have learned HTML and other simple stuff, I've scratched the surface of C++ a bit, but how does C++ make a game? where does the change from Command prompt output to windows/game output happen? The command prompt output such as the "Hello World" is part of the learning, but I'm just curious how it turns out later on.

    So to sum this all up, I'm just looking for a step in the right direction. Thanks for any help and sorry if this has been stated somewhere before, i couldn't think of what to search to find the answers i wanted.
  2. jcsd
  3. May 27, 2010 #2
    Just as a point here-- the firms that produce video games typically require VERY adept, VERY ambitious programmers. From my understanding, game programmers work nights and weekends a lot, and are generally pretty dedicated. One person's interview with a game programming company consisted of being handed a C++ engine, and having to do something specific with it over the course of a weekend. He couldn't even get it to run as-is (with help from several people), as there was little documentation. It was a test to see how tenacious you were and how good you were at fiddling around with advanced programming libraries.

    I'd guess C++ or Java. I don't actually know, but I expect that most PC-based games are probably written in C/C++ since it's got really good speed, and speed is VERY important for game programming.

    But that doesn't necessarily apply to smaller games like Flash games which are typically designed more to be flexible and lightweight, rather than high-performance.

    If you want something that's lightweight, there's always JavaScript (which basically has NOTHING to do with Java other than the name). I wrote a silly RPG in JavaScript, and if you know HTML, it's pretty much instant-gratification, since you can write a basic-ish interface using HTML, then use JavaScript to make the guts.

    Syntax-wise, JavaScript is very similar to Java and Perl-- it's just easily tied into the DOM, so the learning curve is ... probably a lot lower.

    Graphics packages. There are libraries you use to provide input/output to your user. Some of those libraries are really advanced, and some are more basic. But things like the "cout" command are effectively similar-- "cout" pushes output to the standard text interface, and it uses a library to do that, even though it seems like the most basic function imaginable. To push output in the form of graphics, you need a different set of libraries, some of which are very complex to use.

    Give yourself some small challenges. Something you can show off to your friends as a silly game, or something otherwise "neat". For instance, I made a fractal landscape generator that produced a single PNG image. Something bite-sized so you don't end up getting intimidated by the swath of coding, or (more likely) just never get it to a working state because it's too big to finish.

    The language you choose doesn't matter THAT much. Java's free at least, as are JavaScript, Perl, and others. C++ I think you need a development kit (unless you're under Linux), and the same for Flash. PHP is technically free, although you need a webserver to actually RUN anything, which typically means getting an ISP (or again, if you've got a Linux server, you're all set).

    Anyway, programming is more about learning HOW to think and how to approach problems, and is less about the particular language you're using.

  4. May 27, 2010 #3


    User Avatar
    Homework Helper

    C++ isn't much of an advantage or that much different from C unless you're using some C++ specific library or template package. In a video game writing evironment, you'd end up working on some small piece of code as part of a large team. Some video game programmers are more artists than programmers, simply using 3d tools to render landscapes or gaming objects. Only a small percentage of the team is involved in creating code for the physics of a video game.
  5. May 27, 2010 #4
    Wow, thanks a lot for the tips and info! I'm not sure if this is weird, but i have been playing around with C++ like i said, but the other day i looked at Python, did i ever get lost. I'm told its suppose to be easier then C++ but i find i understand C++ way more on how its used.

    I was doing some reading, curious if i should learn C before C++ and at what point does C# come into play?
  6. May 27, 2010 #5
    Python is significantly easier - both to use and understand - than C++. As has been said on here many times, if you're interested in learning how to program, you'll progress far more quickly by first learning how to use an interpreted language like Python than by jumping straight in to C++.

    Get yourself a decent book on Python (or start by reading this) and take a year to learn it. Once you're comfortable with the language, attempt to write some simple games in Python; card games, simple board games and so on. Then turn to C++.

    To follow this route and become a reasonably competent programmer will, realistically, take you at least a couple of years. Don't rush it.

    No, you don't (and almost certainly shouldn't) learn C before C++. See Bjarne Stroustrup's reasons why.

    As to C#, if you're interested in becoming a games programmer, you probably won't need to learn it at all unless you're committed to writing for the Xbox; even then, you'll only need to use it if you're using the XNA framework.
  7. May 28, 2010 #6
    I dunno-- I felt learning C gave me a better understanding of "how things worked" in programming that interpreted languages like Perl, Python, and JavaScript don't offer so much. In particular, I have a hunch that I would find typecasting IMMENSELY tedious had I started with a language where it wasn't necessary.

    However, that said, interpreted languages ARE much easier to think about and deal with. They're typically much more robust (though slower), and are better at "doing what I mean" than "doing what I say".

    I must have missed it-- where does it say anything about not learning C before C++? I'm not sure I would recommend one or the other first, unless you had an intention to program in both; in which case I probably WOULD recommend learning C prior to learning C++.

  8. May 28, 2010 #7
    One of the principal reasons I suggest Python as being more appropriate as a first language than C++ is the Python standard library; it really is very, very good, and it's quite straightforward to write even non-trivial and rather sophisticated code with it relatively quickly. (See, for example, the Dive into Python link I pointed to earlier.)

    On the other hand, the C++ STL is, in my opinion, considerably more difficult to learn. Sure, you can pick up the basics of STL containers in an afternoon, but learning how to use them effectively is going to take a long time. And that ignores the fact that it's difficult to call oneself competent at C++ without a good understanding of the STL and Boost.

    Stroustrup touches on why learning C first is not an optimal approach here; he goes into considerably greater detail here, where he says:

  9. May 28, 2010 #8
    The language you should choose depends on what you are planning to do.
    If you want to quickly be able to make an application that would, say, work with databases, you should try C#.

    I would tell you to avoid Visual Basic (especially version 6 and older). VB6 is outdated, not
    supported anymore and will give you a lot of bad habits. New version look so similar to C#
    (as it's the same Framework) that you should better directly use C#.

    If you plan to make games for fun or to work in the industry, definitely C++.
    It's been said above that they work nights and weekend. This is not totally true.
    It depends on the company and the country. Video games studio require people who love
    what they are doing and who are ready to do their best to get a good game.

    I work in a medium french video games studio. Our teams are composed from 5 to 20 people,
    depending on the game and we work from 9am to 6pm.

    Now about how to get from the command prompt to a 3D game, we use several API.
    Simply put:
    - Win32 API: it's a set of commands which allow you to create a windows (and more)
    - DirectX: a set of interfaces to control the graphic hardware
    (both of them are used with C++)

    Now, when we make a game, we use a lot of routines that have been written over
    and over. Instead of writing these routines for each new game, we use a game framework
    or engine (Renderware, Havok, Gamebryo, ...) so we can concentrate on the gameplay.

    So to conclude, if you want to make games (of even physics-based applications), use C++
    for it's speed and performance. If you want to make any other kind of application, you
    should consider C#.

    I don't know if it answers your question, but that's my advices. I haven't used Python
    nor other high-level languages a lot.
  10. May 28, 2010 #9


    User Avatar
    Gold Member

    Computer science programs tend to require students to learn at least 2 types of language--one of which will be low level C which does require the programmer to know all about the internal computer architecture and how the operating system and compilers are allocating and arranging memory. This low level programming experience is necessary if, someday, you want to be able to make programs run efficiently.

    Then, students always have to learn an object-oriented language, which in U S high schools is mandated to be Java--but it could just as well be C# which is very similar. Python, though popular, is not as good a choice to learn on because of its loose typing, although people tend to like it more because it requires less discipline--but remember, less discipline does increase the chances that the programs you write will eventually fail in some strange unexpected way.

    Case in point--my husband programmed for years in Visual Basic, which has loose typing. One day, eventually, the compiler made the wrong choice and one of his integers started overflowing, and the program began failing in the weirdest way. When he finally discovered what had happened--the fix was explicitly to instruct the compiler to use a wider integer type--he was shocked and felt almost angry or betrayed. No one had ever warned him what the risks were of using "variants" (loosely typed variables, where the compiler guesses what type they should be).

    Loosely typed languages are really fast for quick prototyping and learning can be facilitated by them. But if you want to know what is really going on, first learn C (not C++, it is too big and messy), and then learn a strongly typed language (Java or C#) which has lots of "type safety" (the opposite of C). C lets you hang yourself, Java refuses to let you hang yourself.

    After those 2, most any other languages will come easy.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook