Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a friend who has asked me to teach him how to program.

I was thinking that using a language that I do not know could be beneficial because:

  • I will learn something new too.
  • That will make me slow down, as I've been told that I usually explain things too fast.

So now I need to find some balance between what is didactic for a newbie and is useful to me.

My draft of requirements:

  • Not C, Java or Python (because I already know).
  • My personal interests now are on Erlang, Scala and C++ (but they might be too hardcore)... I could refresh Scheme or Prolog too.
  • Need a good IDE or REPL to play with.
  • Clean and simple language.
  • Good (and free!) documentation.
  • Some practical for the real world (i.e. making a web application, image processing, statistical analysis...)

About the methodology, I was thinking about this sequence:

  • Introduction to logic.
  • Basic maths and algorithms.
  • Software design principles.
  • Some foundations on computer technology.
  • Make some large project.

So, any suggestions about the language or methodology?


My "student" is a 28 years old MD, his goal is to make a web site for medicine students. As he is also into research, so I think he could find immediate use to his new programming skills for data analysis and plotting.

Ultimately I might help him directly with the project.

share|improve this question

closed as primarily opinion-based by gnat, GlenH7, Dan Pichelman, MichaelT, Snowman Jan 12 at 2:33

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

Who are you going to be teaching? To what level? –  Oded Dec 14 '11 at 15:49
I think you need to think more about your student's requirements and NOT your own. What does this student want to do with programming? What domain? What is the student's ultimate goal? –  Angelo Dec 14 '11 at 15:58
FORTRAN isn't one of the languages you know? –  Karl Bielefeldt Dec 14 '11 at 16:33
@KarlBielefeldt it is long forgotten now and I have no real interest in refreshing it ;-) (as with Pascal, TCL, BASIC and a few others) –  fortran Dec 14 '11 at 16:35

10 Answers 10

up vote 4 down vote accepted

I've done this in the past, and it works out to a certain level.

Basically, it works best if you are good at programming, and have a desire to learn the new language. You also have to be willing to put in the effort to prepare, in advance. The student should also be enthusiastic about learning the language. And make it VERY clear to your student that you are learning this specific technology.

Teaching this won't get either you, or your student up to an 'expert' level. It might only get you up to a beginner level, but as you pointed out, it will give you the opportunity to learn new tools, and perhaps become a better programmer in general as you have to explain things that maybe have become second nature to you.

share|improve this answer
thanks for sharing the experience :-) –  fortran Dec 15 '11 at 9:40

This is a terrible idea. The point of a teacher is to help the student avoid common mistakes. If you don't know the subject matter yourself, you'll be making those mistakes too.

You say you "explain things too fast". Now you'll be explaining things too fast, and incorrectly.

share|improve this answer

Why your friend wants to learn how to program makes a big difference. For your friend, I would recommend python, which would be good for both web programming and research purposes.

If there isn't a compelling reason, I would be wary of teaching in a language you don't already know, because when you self-teach a language, you tend not to write idiomatic code at first. You write Java that looks like C, for example. Then you learn the right way to do things in that language as you become more familiar with it. I think it would be very confusing to someone completely new to programming to be told the way you told them to do it before isn't the right way to do it anymore. Also, unless you are actively working on a project in that language, the learning process for yourself is going to take a lot longer than you are accustomed to.

share|improve this answer
edited the question to reflect my friend's interest –  fortran Dec 14 '11 at 16:21
@fortran, edited my answer accordingly. –  Karl Bielefeldt Dec 14 '11 at 16:31

Depends on how good a teacher you are.

One of my favorite university EECS classes was taught by a professor who was teaching the subject because he wanted to learn it. He had some really interesting fresh insights.

share|improve this answer
Not very good, patience is not among my strong points xD –  fortran Dec 14 '11 at 15:42

Go for C#. The Visual Studio IDE is excellent, and it's a simple language.

share|improve this answer
I would recommend this as well, the only problem is VS+intellisense is pretty forgiving, and personally I believe that someone just learning programming should first be exposed to a much more limited IDE so they can at least start to develop the skills to debug and code well on their own, so when their IDE's built in features fail them they aren't completely lost. –  Ryathal Dec 14 '11 at 16:31
and its a virtual clone of Java which doesn't add much to @fortran 's knowledge base. –  Rig Dec 14 '11 at 18:43
@Rig I already programmed in C# some projects at the university, but I won't mind to get more experience with the .NET platform... Maybe F# could be a better candidate (as I know some ML); but I'm a little bit concerned about Linux support (with Mono). –  fortran Dec 15 '11 at 9:44

Go could be a good teaching language (see Andrew Gerrand on Google+ )

  1. it has a quite simple grammar, that should result very familiar to you (coming from C) and should be easy to start with for your student as well
  2. you can already find good and simple material on how to do things ranging from web applications to image processing. Take a look at this interactive tutorial for instance.
  3. it's neither an object-oriented language nor a functional language, but it has elements of both, which may allow you to make some easy point on solving some problems with different paradigms
  4. as you mentioned Erlang in the list of languages you're considering, Go has some affinity with Erlang (in that it has a very strong focus on easy concurrency)

from your list of requirements, AFAIK, it still misses a good IDE and REPL, but it has an extremely fast compiler and even has an online playground where you can try building simple programs.

As for Scala, it's a language that I love very much and it could make a great language for teaching, but honestly (as a student) I wouldn't want somebody less than proficient with it teaching it to me...

Or (unless you have an allergy to parentheses) you could always return to the classics. As a response to your opening question (is it sensible to teach programming with a language I don't know), let me quote you something in the preface of SICP. I think it makes the point of why a language with a very light syntax is preferable for teaching about programming:

In teaching our material we use a dialect of the programming language Lisp. We never formally teach the language, because we don't have to. We just use it, and students pick it up in a few days. This is one great advantage of Lisp-like languages: They have very few ways of forming compound expressions, and almost no syntactic structure. All of the formal properties can be covered in an hour, like the rules of chess. After a short time we forget about syntactic details of the language (because there are none) and get on with the real issues -- figuring out what we want to compute, how we will decompose problems into manageable parts, and how we will work on the parts.

share|improve this answer

I think processing is a very compelling language for educational purposes. It has an IDE, is free, excellent graphical capabilities, and strong community.

If the student wants to do data analysis at a sophisticated level, R is awesome and popular. It also has a simple but useable IDE.

Whether or not these are useful/good for your student depends on what he wants to do.

If this person strictly wants to "create a website" I would urge you and him to avoid programming altogether and instead focus on a well-chosen CMS (for example typo3 or XWiki, etc).

share|improve this answer
Processing is amazing. –  Vitor Dec 14 '11 at 16:23

Ruby should be considered as well, especially since your student wants to do web programming (ruby on rails). PHP is a good introductory language as well and has a C like syntax.

share|improve this answer
Sorry to disagree. Ruby is one of the worst languages I've ever seen; it seems that the only design goal was to pack as many "cool features" as possible (so I don't see it any good for teaching). About PHP, it is more or less the same crap but without the cool features. –  fortran Dec 15 '11 at 9:39
@fortran Someone who chose "fortran" as a nickname, should refrain from commenting on whether a language is crap or not... –  Yannis Rizos Dec 15 '11 at 14:22
@YannisRizos and what if that nickname wasn't chosen but given? Anyway, Fortran was a huge leap forward in its time because the only other way to program was assembly, in the other hand PHP and Ruby are simply disgusting when compared with languages that predate them like Scheme, Python, Lua or even the infamous Perl. –  fortran Dec 15 '11 at 14:29
@fortran Cool. My comment wasn't really too serious. Whether a language is "crap" or "disgusting" is not a conversation to be made in comments, if at all. –  Yannis Rizos Dec 15 '11 at 14:50
@YannisRizos Maybe I wasn't clear enough when I said clean and simple. Although it is something quite subjective, it can be measured to a certain extent by the length of the language specification... Oh, those languages don't even have one! –  fortran Dec 15 '11 at 15:04

Will the student be open about learning from an impatient newbie? Wouldn't it be better to start off with something that you have a good grasp over?

share|improve this answer
I think I'd be more understanding and patient about having to repeat things if I have doubts myself... –  fortran Dec 14 '11 at 15:48

"I usually explain things too fast"

I think you should first work on that problem, and it will be probably easier for you when you don't have to learn a new language simultanously. And the requirements of your student seem to make Python a really good choice, especially in conjunction with the SciPy stack.

share|improve this answer

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