Abstract:
Which programming language to learn first?

Created by Peter Kankowski
Last changed
Filed under General

Share on social sitesReddit Digg Delicious Buzz Facebook Twitter

Discussion: the first language

Poll results: Python - 24%, C - 23%, Basic - 10%, C++ - 9%, Java - 7%, Lisp/Scheme - 7%

What programming language should be learned first? And what was your first programming language?

Some articles on the topic

Questions

What are the criteria for choosing the first programming language? What language would you use if you wanted to teach programming to your kid? Why? And what was your own first programming language?

Your feedback is welcomed. Please use the comment form below.

Peter Kankowski
Peter Kankowski

About the author

Peter is the developer of Aba Search and Replace, a tool for replacing text in multiple files. He likes to program in C with a bit of C++, also in x86 assembly language, Python, and PHP. He can be reached at kankowski@gmail.com.

Created by Peter Kankowski
Last changed

41 comments

Ten recent comments are shown below. Show all comments

Tsaadaasmarino,

Lua, by a wide margin. (www.lua.org). I taught the language to undergrads in an African country in a week. The most readable scripting language, and the fastest, too (www.luajit.org!). And, importantly, a language operating by the principle of 'least surprise'.

Marco van de Voort,

My first language was Basic V2 (C=64), then C=64 asm, short time QB then TP. Still mostly Delphi programmer, but I do C/C++ too.

Given that history, my suggestion is predictable, but admitted, depends on target.

Testing a young kid's interest in programming? Then something scripting and visually appealing.

However once it goes in the direction of a more formal CS education, I like Pascal. (and then a procedural one). Simple syntax, string management and little boilerplate code

for a minimal program. Easy upgrade to C/C++ later.

kirbyfan64sos,

My first was Python. It's actually still my favorite(along with C++).

Simon,

Python is my favourite language by far, but I wouldn't be able to do half the things I can do in Python if I didn't know C. So my vote is learn C first, because almost everything else is written using it, in particular most compilers, BIOSes, operating systems. Some time or another you'll have to use it so why not start with it?

Anonymous,

I used BASIC at first, and it is not bad actually. However, for many programs, C is a good idea, and you should learn C too.

Ben,

As an introductory language I go with Python, but for professionals C is a must. As someone who interviews candidates for junior developer positions it is worrying to see that most newly graduated are seeing JVM as the "native" language of the CPU...

Oleg,

C, PHP, Javascript - relative languges start from it.

Adam,

I see a lot of people advocating to learn complex difficult languages first. I do see why they would advise this: it's all downhill after that.

But learning to code isn't just for the hardcore CS people. Coding is a useful skill regardless. So if you want to learn to code, don't be intimidated. You don't have to choose a difficult language to start with. Choose the language that you WANT to learn, that is best for the problems you want to tackle . I would say that languages that are light on syntax like Python are a great place to start. You can always learn more difficult languages later if needed. And you previous experience will make it easier.

Andy Pagin,

I still believe you can't beat good old fashioned B.A.S.I.C, such as I used on CP/M based machines, the BBC micro and Sinclair computers in the early 1980s. You can get across the principals of programming easily because you need to learn very little before you can write a workable program, important with a child's short attention span. Once they understand just a handful of command and the extremely simple syntax they can let their imaginations run wild, while you sit and watch from a distance.

My first language? BASIC on a CA SuperboardII.

An older kid at school told me to type in...

10 for n = 1 to 10
20 print "Hello World"

30 end for

"Er, now what" I said.

"Type run" he said.

I did, my jaw dropped, I was instantly hooked, and after thirty five years as a analyst/programmer I still am!

Kartik Agaram,

I just came across this page and wanted to share the toy VM and OS I've been using to teach programming to a few students: http://akkartik.name/post/mu. It was gratifying how many of the recommendations in your links I've ended up following:

a) Mu programs are sequences of instructions. They're like Basic in that respect, but even more so: each instruction can only contain a single operation. So more like Assembly or a VM bytecode than Basic. Indeed, I designed my toy VM to be easy to program directly in without needing any further language layers.

The core benefit of Basic and Assembly is that a statement-oriented language minimizes the amount of syntax people have to learn. In particular, it minimizes brackets. It takes newcomers a while to appreciate that putting something before a `(` is very different from putting it after. While they gradually adapt to this idea, it's helpful to minimize the number of brackets they have to deal with in the meantime.

b) Mu tries to make functions concrete the way Logo made instructions concrete. The creation of the new namespace (stack frame) in the function compared to the caller, the new names for arguments, all these things are made extremely explicit so that learners can see the transition step by step.

c) Mu uses `<-` for assignment, rather than `=` or `:=`. This agrees with the "seven deadly sins" paper. I think it also successfully walks the tightrope between being too simple and too complex.

I don't claim everyone should use Mu as their first language. It's designed for kids and others who aren't necessarily immediately looking for programming jobs. Following Adam's comment above, it's for everyone, not just the hardcore CS people.

I do feel strongly about a couple of things: i) if you can, try to find ways for your kids to learn programming 1:1 with a good tutor. If you do that they'll learn well no matter what language they start with. ii) a statement-oriented language is great for understanding the internals of the computer, particularly ideas like recursion: http://akkartik.name/post/swamp

Your name:


Comment:


Please ignore this field: