Tuesday, 2 June 2009

Learn Some Programming

Have you ever sat down in font of your computer and wondered "How does the Start menu come up when I click on it? How do the icons in the dock of a Mac grow bigger when I move my mouse over them? What programming language is Microsoft Office written in?". I'm here to give you some tips. Here's a list of some programming languages suitable for beginners like you to start with.

Remember, it takes patience and practice. You won't master a language overnight. You might not get some of the concepts at first glance, which is very normal. Who fails at this? It's the people who give up right away. As soon as they come across something they don't understand, they throw the book away and say "Programming isn't for me".
So my advice is, if you don't get something, go over it again and again till you get it. You have books and the Internet at your disposal. If you still can't find what you're looking for, you can always ask questions in forums and in services like Stack Overflow.

Rule of thumb: Unless you actually type and work with the examples yourself, you won't learn programming. Can you learn French without speaking it?

Now you're probably wondering how you're going to write your programs and run your programs. If you're a beginner, I suggest you download an IDE (Integrated Development Environment). Don't get upset with the lingo! An IDE is simply an application in which you write the code, and it does the rest for you at the click of a button. The alternative to using an IDE (this is the longer, more challenging method) is to write the code using a text editor like Notepad (Windows), TextEdit (Mac), or vi (Linux), and then use the command line to run the program.
Note: If you use a word processor like Microsoft Word, be sure to save the file as plain text, otherwise Word will add extra formatting and this will give you errors when you try to run the program.

One last thing, you'll notice that most programming tutorials for beginners use programs that only print out a few lines of text or perform some mathematical operation before printing (by printing I don't mean printing out on paper, I mean printing it out on the screen) out the result. No buttons, no cool animations. There's actually a very good reason behind this. Adding all those buttons and animations requires complex knowledge of something called "GUI Programming". So, besides knowing the language, you'll need to deal with GUI issues which just make things harder for you. After getting the hang of the language, you can think about writing GUI programs.

Two Language Flavors

In the way that programs are run, most fall into two categories.

Interpreted
These languages use something called an interpreter to run your programs. What they do is that they execute the program line by line, so you can't really find errors until the interpreter reaches the line containing the error. Also, interpreted programs generally run slower than the other flavor (coming up!) of programs. Keep in mind that unless the computer you want to run the program on has the interpreter installed, your program won't run.

Compiled
These languages use something called a compiler to run your programs. Compilers take the code you write (source code) and change it into a language the computer can understand (machine code). The compiler also helps you find errors before you actually run your program. Compiled programs run faster than interpreted ones.

List of some programming languages

Visual Basic
As its name suggests, Visual Basic is a very appropriate language for beginners. The language is simple yet powerful. You can create GUI applications in a few minutes without having to write that much code. Best of all, you can download it for free.

Python
Python is an interpreted language. It's also an easy one to learn because it takes out some of the hassles of other languages. You can download Python for free from Python.org.
Note: I suggest you download version 2.6 because it has easier syntax. Version 3.0 adds new syntax (syntax is just like the grammar in a normal language).

Java
Java is a useful and powerful language developed by Sun Microsystems. You can use it to create desktop and Web applications. The Java SDK (Software Development Kit) can be downloaded for free from Sun's website. A note about Java: to run Java programs, you need to install something called the Java Runtime Environment. Don't confuse this with the Java SDK. The latter allows you to write Java programs, the former allows you to run them.

Here's a little something for you. NetBeans is a free IDE for writing Java programs (Not only Java, in fact, you can also use it for Python, Ruby, Perl, C/C++, etc.).

C++
One thing I want to clarify about C++. I've had many people come up and ask me "Where can I download C++ from?". You don't download C++ as a language, you merely download the compiler. C++ has become a standard in the software industry, and I highly recommend that you take a shot at it. It might seem a little hard but it's very rewarding. C++ programs, once compiled, can be run on computers without the need of an interpreter or a runtime environment (unlike Java, which needs a runtime environment). A good IDE for writing C++ programs is Bloodshed Dev-C++, which can be downloaded for free. If you're using a Mac, you already have a C++ IDE installed. It's called Xcode. You can find it in Macintosh HD > Developer > Applications > Xcode. If by any chance you don't have it, you can download it for free from Apple's website.

Another great thing about C++ is that you'll learn two languages with the effort of learning one because C++ also includes another powerful language called C.

C#
(Pronounced C Sharp) C# is a programming language developed by Microsoft. It has some similarities to C and to Visual Basic. You can download Visual C# (for free) from Microsoft's website. C# is a compiled language.

C
C is probably the most powerful programming language today (C++ is catching up fast). C is the language of system programming. Microsoft's Windows operating system, Mac OS, and Linux are all written in C. If you learn C, you can easily master Java, C++, and C#. To write C programs, you need to download a C compiler. I use the free gcc (GNU Compiler Collection, which includes the C compiler).

There are many programming languages out there. Learn and master at least one. Believe me, you won't regret it.

"I want to create my own games. What language should I use?"
Ans.:- C++ is usually the language of choice.

12 comments:

  1. im still readn the ebook btw bt kinda progressin slowly cuz im also on 3ds max

    ReplyDelete
  2. Instead of linking to yahoo Answers. Might I suggest Stackoverflow.com

    ReplyDelete
  3. Good one dude. Do keep writing. Good that young programmers like you started to write out.

    -maheshexp

    ReplyDelete
  4. thanks dude! now to download those compilers and get to work

    ReplyDelete
  5. o.O
    omg i want you to become my master : )
    pls learn me C and C++...

    ReplyDelete
  6. I can't really teach you as I am still learning them myself. But you can find many websites out there that offer great tutorials. Also get yourself a good book like "C++ programming in easy steps" and "C programming in easy steps" (You can find them on Amazon.com).

    ReplyDelete
  7. uhmm...
    can you help me with this GCC ?
    I can't figure out how to install it :S
    And I finally bought:
    Microsoft Visual C# 2005
    Microsoft Visual Basic 2005
    Im searching now for C/C++ books.
    But it needs also a compiler, so I have choosen GCC, but still cant use...

    ReplyDelete
  8. Wow... it was kinda hard to install it.
    But now, I dont know how to use it, is it just a Command line compiler (Translated)?
    I downloaded 2 Versions of it: 4.3.4 and 4.4.1.
    And I've got one more question.
    How can I find C books, or learn it anywhere ?
    I 've found nearly all programming languages, excepted of C - C#;C++;Java;Visual Basic and Delphi.

    Thanks for reps.

    ReplyDelete
  9. I'm guessing you're using Windows. Let's take an example on how to compile a program.

    Suppose I create a little "Hello World!" program. I saved the file as "hello.c" in a folder called "MyPrograms" on the C drive. You open a command prompt window, and change directories (Type the full path to the folder).
    Type this into the command prompt: cd C:\MyPrograms

    Now you're inside the MyPrograms folder. Type this into the command prompt: gcc hello.c -o hello

    Explanation: This tells your computer to use the GCC to compile the file called "hello.c" and to output the result as "hello" (What comes after the -o is what the name of the file will be. Try not to use spaces in it)

    As for the books, I already mentioned two very good books, "C++ programming in easy steps" and "C programming in easy steps" (You can find them on Amazon.com).

    ReplyDelete
  10. Thank you very much...
    But I thaught about it and I made the decision not to use GCC, it's just annoying and rlly hard to understand with my english experiences...
    All in all, thanks a lot again.
    Im still learning C... and the next Language will be C++ I hope.

    ReplyDelete