I have a great urge learn some coding. However I'm a bit undecided as to which programming language to begin with. Word around is Python but is it the right choice for a guy with limited knowledge in QBASIC?

11 Answers 11


I too would recommend Python as a friendly, accessible language without excessive syntactic sugar. While it looks very simple, it is not a toy language, it's a language used by Google, NASA, YouTube and many other places. It's quite powerful and flexible, and supports both imperative and Object Oriented programming paradigms.

Its syntax is straight to the point, and teaches you good habits in terms of formatting your code (unlike other languages, whitespace, ie indentation etc matters. So while you can write non-functional code, it'll always look nice :)

So, count me as a fan of Python. It's free, cross platform and can be used interactively. That means, you can open up a Python shell window and try out commands right there without having to edit a file and save and compile it. Python also comes with its own IDE named IDLE, it's not super-sophisticated like eclipse, but usable.

You may want to visit Python.org for more information, perhaps this Beginner's Guide to Python will be useful.

Just to provide a quick example to convey the flavor, here's how to print "Hello World" in C, Java and Python:

In C:

#include <stdio.h>

int main(void)
   puts("Hello World");
   return 0;

In Java:

public class HelloWorld
   public static void main(String[] args)
     System.out.println("Hello World");

In Python:

print("Hello World")

If you google, you'll find a lot of Python tutorials on-line.

Have fun with it!


My intention is not to start a "mine is better than yours" language war. The question was what language is good for beginners; My answer is (and stays) Python.

I already outlined the benefits above, there is much less conceptual baggage with Python (or Ruby for that matter). Beginners can focus on programming concepts, not extraneous matters. They can open a shell Python window and type in Python statements and observe the output immediately and interactively. Unlike C or Java, there is no need for separate steps of editing source files, compiling them and then running them early on, nor are explanations about "header files" in C, or the whole public static void main incantation in Java needed :) Nor why we use puts() or System.out.println() when we really want/mean "print".

Simply take a look at the 3 examples above. Which code would be more easily understood by a beginner? Which language would you rather learn if you didn't know anything about programming? (Aside: Does taking out the return 0 in C make it really that much more comprehensible?)

If the question is what is the language to use for systems programming in Unix/Linux then I'd say C, and Java has its use too. Would C with its pointers and no-bounds checking on arrays and "manual" memory allocation and freeing be a good language for beginners? No, not in my opinion. Should a competent programmer know about these things? Yes, of course, in due time, after they master the fundamental concepts. We are taking about beginning programmers here.

Look at it this way: if you had someone who was trying to learn to drive a car, would you recommend a Ferrari to learn the basics?

  • 1
    Python is where I started my 9 year old son. +1 – Tim Jun 21 '12 at 19:20
  • 1
    +1 for python. swaroopch.org/notes/Python is a good tutorial. – Rufo El Magufo Jun 21 '12 at 21:09
  • 2
    Your comparison is very biased. The C-Example, can be reduced to int main () { puts ("Hello World"); } and on the other hand, I have seen python-code with ` __main__` -boilerplate too. – user unknown Jun 21 '12 at 22:48
  • 1
    @userunknown Those are standard constructs for the language without any any sort of bloat or artificial inflation. Notice the return type of main in C is int,so it should have a return, a value of 0 meaning the program terminated normally. So, yes, you can "optimize" programs by leaving out things, or putting it all on one line, but that doesn't make them any less complex. Is your final argument that one can write poor programs in Python? Well, yes of course .. you can do that in any language! My point is Python's syntax is simple and w/o much of the extra things needed in others. – Levon Jun 21 '12 at 23:01
  • 2
    @userunknown Your optimized C code left out the header file .. I suppose that's optional too. Also, at least gcc 4.4.3 doesn't return 0 in its default setting without a return 0. Having to use compiler switches etc is fine, but why burden beginners with that? They have enough other things to worry about. Your "tricks" and rules to optimize introduce all this extraneous stuff beginners shouldn't have to worry about. No one is putting down C or Java, the question is what is a good language for beginners to learn programming. – Levon Jun 22 '12 at 1:08

There's a free book online by Chris Pine called Learn to Program which uses Ruby.

It begins assuming that you know nothing about programming and teaches from there. Even if you do know a little bit about programming, the first chapters build strong skills in Ruby, but don't feel repetitive.


Asking which programming language is best for a beginner is like asking which tool is best for a beginning plumber. It's completely irrelevant. The important thing is what you learn, not the language in which you express it.

If you're interested in programming in general and are serious about it, I would suggest you start reading through Structure and Interpretation of Computer Language. It's a little more complicated than your average "learn C++ in 7 days and become rich that easily...", but it is the shortest path to becoming a real programmer.

But this is far beyond the scope of the current website. The Stack Exchange network has other websites where this question may be relevant. To make things adequate, how about I assume you want to learn some Unix-related programming. I would recommend spending a few weeks learning C, then grabbing a copy of Advanced Programming in the Unix Environment, by Stevens. That should get you started.

  • 3
    I would disagree about the choice of language being "irrelevant", just especially since we are talking about beginners. For them, you want them to be able to focus on the main concepts and not worry about all the various syntactic requirements. Of course every language has those, but as my 3 examples in my answer showed, Python (and Ruby too) keep them to a minimum. Explain to someone why if they want to print something they can't simply say print 'something', but instead have to learn about public class .... etc. :-) – Levon Jun 21 '12 at 19:52
  • 1
    .. and tossing in the Stevens book (great book for experienced programmers) with the comment "that should get you started" for someone who describes themselves as "limited knowledge in QBASIC" is simply too much conceptual stuff to swallow. C and pointers and memory management ... If it sounds as if I have definite/strong opinions on this, it is because I do :) It's part of my job to think about exactly these sort of things. [ok, I'll get off my soapbox .. we now resume our regularly scheduled program] – Levon Jun 21 '12 at 20:10
  • C syntax may be repelling at first, but it also does an incredible job of correctly representing the underlying machine. But most importantly I still maintain that it's irrelevant. Learning to program is about learning how to build abstraction, understanding data-structures, managing complexity, etc. It's not about the details of how you write your for loop. I gave C as an example by assuming he wants to do Unix programming, but any (reasonably readable) language can do. – rahmu Jun 22 '12 at 5:47
  • And mentioning the Stevens book is not a bad idea either. In all fairness notice I did suggest he learns C (with a link to the K&R) first. There's a tendency to treat beginners as idiots who cannot grasp anything slightly complicated, or lazy people who won't bother thinking for themselves. This is wrong. It is my experience that beginners respond far better to challenging problems. I wouldn't call Unix programming in C particularly difficult; it can be tedious, but it's not that big a feat. Isn't time we stopped demonizing C? – rahmu Jun 22 '12 at 5:53
  • Thanks for clarifying your points, very helpful. And you are right, you did recommend Stevens after learning C first, my mistake. Also, just to be clear, I am not trying to demonize C, I used it professionally for a number of years some time ago, it has its place. I just don't think it makes a good "first language" for the reasons I stated in my answer/comments. It's not a matter of how short the code is (ie LOCs), but rather how straight forward/simple the syntax is and the lack of need to understand (initially) unnecessary extraneous things for beginners trying to grasp basic concepts. – Levon Jun 22 '12 at 11:27

If you are interested in Python, you can download a PDF book called "Invent Your Own Computer Games with Python" by Al Sweigart that starts very at a basic level. It's aimed at teaching kids programming techniques in addition to the Python language, but given your limited experience in programming it might be helpful. Each chapter teaches you a new concept and then shows you how to program with what you have just learned.

Best of all the book is free as a PDF with the option to donate to the author.


Considering you are in Linux I would go with C because it is its' native language. C++ to me does not count as I do not agree with it being merged into the kernel. There is a vast amount of free resources to go with it.

check out http://freeprogrammingresources.com/

This is where I started to look for a language to learn.

  • 2
    C++ hasn't been merged into the kernel ( whatever that's supposed to mean ). The kernel is written in C. – psusi Jun 22 '12 at 0:49
  • I remember seeing c++ code being compiled on my last kernel upgrade but I would have to look into the source to be sure i guess as the screen fly like an SR-71 Blackbird. – Joe Jun 22 '12 at 20:07
  • To learn object oriented programming, you should choose the original: Smalltalk.
  • To learn functional programming, Haskell might be one of the purest such.
  • Logicial programming can be learned with Prolog.

This will teach you very different concepts of programming.

If you look for something which you can use to make improvements, to participate in Linux development and applications, your options are

  • C for the Linux kernel.
  • Python for many Gnome apps
  • C and C++ for the many native Linux apps, with the two mainly used frameworks, gtk and Qt.
  • To handle small issues on the shell, bash is most widely used but other shells are fine.

If you want to develop big things on the server or small apps for the android plattform, Java is the the way to go. But since Java is not only a language, but a plattform too, where many bindings exist, you could use JRuby, JPython, Scala, Clojure and other languages too, which means, that nearly everything might be suitable.

So it is more easy to discourage from some languages, than to encourage. I would discourage from some, because they are made from Microsoft where Linux versions might exist, but is a second class citizen, like

  • C#
  • F#
  • VBA

Some languages work, and you get your job done, but they aren't elegant, like

  • PHP
  • Perl
  • Basic
  • Javascript

Many are of a very specialized scope, so that they aren't too useful for a beginner without that specialized problem, like

  • sed (a stream editor language, very useful for text manipulation with regular expressions)
  • awk (similar scope like sed )
  • R language for math, especially statistics/matrix operations
  • Javascript (not that useful outside a browser, while not impossible to use - see rhino)

The lists aren't meant to be complete.

Whichever language you learn: Read The art of Unix programming from Eric S. Rayomond too.


I'd suggest JavaScript. It is the language of the Web, so it is useful and runs everywhere. You can also get some satisfying results quickly. Try codecademy.


Python. We teach it as a first language at The North Carolina School of Science and Mathematics. We have been doing this since 2004. It's a great language for beginners.


The only real answer here is it depends. Turing-completeness guarntees that all your major contenders are pretty much the same.

So you should actually consider the bells and whistles. Which language offers the most of what you consider fun? Fun keeps you interested.


Python & Perl is the best one to start with. You can also go for VB/Java script


First you have to grab the concept of structured programming. I started programming in BASIC with a very good book that started with explaining structured programming, the concept of loops, decisions, and so on before going to the first "hello world".

After that is was easy to switch over to Assembler, Pascal, Oberon, C, perl and bash (all the procedural ones).

If you plan to become a SysAdmin (aka system programmer) - python, perl, bash are ok. A little understanding of C will not harm, too.

Not the answer you're looking for? Browse other questions tagged or ask your own question.