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 lives in Siberia, the land of sleeping sun, beautiful mountains, and infinitely deep snow. He likes to program in C with a bit of C++, also in x86 assembly language, Python, and PHP (on Windows platform). He can be reached at kankowski@narod.ru.

31 comments

Ten recent comments are shown below. Show all comments

Peter Kankowski,

Thank you very much for your opinion! Old good BASIC was a nice introductory language. My first computer was a cheap Russian clone of ZX Spectrum and I spend a lot of time in my school where "real" computers (IBM PCs) were installed. The teacher was so kind that I could write programs in evening, when there was nobody in the computer class.

LOGO may be good for learning programming, because of its intuitive turtle graphics. Here is a nice e-book and an online interpreter. (However, there is no OOP and first-class functions in LOGO; the syntax for variable assignment is terrible, etc.)

Microsoft has Small Basic language, which is (IMHO) worse than 40-years-old LOGO (no function parameters!)

John McPherson,

I agree with David Mercer, for novice programmers FORTH is pretty hard to beat. The entire metaphor, if taught properly, rapidly gets a beginner up to speed as to what the machine really is and that is by no means a small feat. I know professional programmers with years of experience that still do not understand the fundamental premise upon which the machine is built, logic gates. FORTH, because of its stack orientation is somewhat similar to the way the CPU works. Also, in a stack based system programmers tend to learn good habits. That, coupled with the extensibility of the language through creating new 'words' tends to make learning and understanding easier for novices.

Years ago I was flabbergasted by a program, written in FORTH, for the Apple II computer, Das Fleeter mouse. It was written by a German in FORTH to simulate a bat flying. It was fast, represented the bat as well as it could for that era. But let me say this again, it was FAST. This was on an 8 bit machine (6502) running at 1 MHz with 32 KB of accessable memory! Yeah, the II could have up to 64KB but because the video memory was mapped stating at 8000H the upper memory was virtually useless without patching your way around it. I dissected the code and was amazed at how you could build this simulation in that language by building up a set of 'words'.

I haven't looked at FORTH in probably going on 3 decades, being a profession programmer I am caught up in the Microsoft world, C#, HTML, VB, java, oop, agil, etc. But I do still remember learning how to do this stuff. Fortunately for me the school I attended taught us logic, how to manipulate the CPU and the basics of machine design. Back then we delt with punch cards and had to load them into an IBM 5250 card reader.

My first program of any significance was a loan amortization program written in Fortran 77 on a mainframe using an acoustically coupled teletype. Now I'm dating myself but I am probably the only one I can get a date with!

But, in all seriousness, learning to program is not the easiest thing for most people and when you heap C++, C#, OOP, understanding the machine, Assembly and a whole bunch of other stuff with questionable application on a poor college student who just entered his or her first year of computer science. It can be and very often is, overwhelming.

An introductory course with something like FORTH or Logo or even VB as the language would be a much 'gentler' way to go about it.

Patrick,
x86 assembly, because the person learning it also learns how a CPU works.
Furthermore if a person is able to use the complete x86 instruction set, he is also able to program nearly every other CPU in assembly because most other CPUs only use only a subset of all the x86 instructions available.

If someone can program decently in assembly, the person won't have any problems using pointers, arrays etc. in any HLL. He will also know how to program fast because he knows how the CPU works. He will also know how to use a debugger, if his complier doesn't work properly or if some apps needs some reversing.
th3cl41,
i love C
Your name here,
It appears that most people are saying their favorite language is the "best" one to be a person's first language. Nobody is mentioning anything about aptitude or career choice. If the student is planning to write business software in the commercial world, I doubt that I would start them with assembler.

The responses that cite an easy to use development environment that explains syntax errors and catches the various "beginner" programming errors sounds good, but ... Having learned to program using FORTRAN on punch cards, and with limited resources such that I only had about 14 attempts to get an assignment correct, I quickly learned to be meticulous and thorough. I don't see that in the junior programmers today.

IMHO, I think a first language should be one that is available on ALL platforms and has tools available through the public domain. It is a serious career error to become locked into an architecture or operating system. A good software engineer (differentiated from "programmer") will look at the programming language as a carpenter does his tools, as an artist does their brushes and paints.

My choice for "best" first language -- pick the worst (hardest, complicated, etc.) one there is. If you can learn that one and still want more, send me your resume. Otherwise, go get an MBA.
John Wagner,
For a first language, say, one that could be taught in high schools, I would say that Python seems obvious, for its clarity and elegance. In University, Scheme/Racket/Lisp ought to be taught simply because this group emphasizes recursion, and recursive techniques are often the first approaches to try; also, at this time, Discrete mathematics should be clearly made a part of CS. When Data Structures and Machine design are studied, so should C be mastered. But in these courses, previous languages once learned shouldn't be forgotten: a good practice would be to ask of homework in a C class to be translated into last year's Python, as well. Promising students ought to be taught Ocaml or Haskell, or another functional language, as these seem to be the future. Students that are not promising should be shown Java. And the door.
Kevin Whitefoot,
My first language: Basic on remote timesharing computer via acoustic modem and paper tape (LeaseCo? London, 1969?).

Recommended first language: Erlang because it has lightweight processes and encourages you to write parallel code, it is also concise, clear, and useful for real world tasks. It also has some great virtues that can positively influence the way you write code in other languages: no globals, single assignment of variables, etc.

No beginner should ever be asked to learn a language that does not have parallel processes as part of the language. We will never get away from the dumb calculator approach that most of us were taught if we don't start taking parallel processing, multiprocessing, multitasking, distributed computing, cooperative sequential processes, etc., seriously.
Josef,
First, C for its power and simplicity. Then assembly to learn what happens behind the code you write and hardware interfaces. That should do all your programming necessities.

If people start to lose their interests when learning these languages and saying they're too hard. Then they should stop and do something else instead because programming isn't easy. Either they're going to know that soon or soon enough.
Carl,

TCL. TCL starts with a stunningly simple syntax. Originally, everything was a string. Hello World is incredibly simple to write. Ditto for the basic console apps you start off with when learning just about any language. However, from there you can go in some very interesting directions:

* Since source code is data, you can do lots of the cool things Lispers can do, without all the annoying parentheses.

* TCL makes a great scripting language, especially when you consider expect.

* TCL has an easy to learn GUI library (Tk) included which runs on all operating systems.

* TCL is a dead enough language that its features are stable. If you write a TCL example in a textbook, it is still likely work ten years from now.

* And if you want speed later, you can hook TCL up to C or C++.

* And though it is a mostly dead language, it is easy to extend, either using C/C++ or within TCL itself to build your own domain specific language.

* Ousterhout's original book on TCL was wonderful. Haven't seen the later edition.

If you are doing a lot of mathematics, then TCL's need for expr can be annoying, but it is far less annoying than Lisp's bizarre syntax, or that of any stack based language.

Alan,

Programming is never easy.

Learn the most complex high level language.

then go for most complex low level language.

Simplicity never precedes complexity.

Your name:
Comment:

Please ignore this field: