The Best First Language For a Young Programmer 634
snydeq writes "Fatal Exception's Neil McAllister questions whether Scheme, a dialect of Lisp taught as part of many first-year CS curricula and considered by some to be the 'latin of programming,' is really the best first language for a young programmer. As he sees it, the essentially write-only Scheme requires you to bore down into the source code just to figure out what a Scheme program is trying to do — excellent for teaching programming but 'lousy for a 15-year-old trying to figure out how to make a computer do stuff on his own.' And though the 'hacker ethic' may in fact be harming today's developers, McAllister still suggests we encourage the young to 'develop the innate curiosity and love of programming that lies at the heart of any really brilliant programmer' by simply encouraging them to fool around with whatever produces the most gratifying results. After all, as Jeff Atwood puts it, 'what we do is craftmanship, not engineering,' and inventing effective software solutions takes insight, inspiration, deduction, and often a sprinkling of luck. 'If that means coding in Visual Basic, so be it. Scheme can come later.'"
Pascal (Score:4, Insightful)
Re: (Score:3, Interesting)
Java is also a very nice first language. I know personally that I loved the built in UI stuff (started in C++). Stay the crap away from Flex (no concept of threads, a lot of voodoo beneath the hood, etc).
I think started in a garbage collected space and then moving to manual memory management is a good path as well.
Re: (Score:3, Insightful)
Get a Commodore 128 emulator, and start programming a game in BASIC. That's how I started, until I realized that BASIC is too slow so then I switched to C.
Re:Pascal (Score:4, Insightful)
How about teaching people to write algorithms ? You know, the kind we used to learn on the 60s-80s, which could be used to program in ANY language (from Assembly to Pascal/Cobol/Fortran), and not today's verbalized Pascal that people call algorithm ?
That was the first "language" I learned and, having learned 20+ languages after that (including some obscure ones lines Forth and Lua), even today I thank my teacher for giving me such a good understanding of programing without relying on any specific language's concepts.
Re: (Score:3, Insightful)
I would say that learning manual memory management first is more beneficial than learning to be lazy ant let the GC do all the work, and, the day you need to use a language which doesn't clean up in your path, write memory leaking piece of feces. Of course, it means that when you need to write in java, you'll be sorely missing the freedom to decide WHEN the garbage is collected.
It's a bit like the difference between living in your mom's basement and having her come and clean up you room randomly when you're
Re:Pascal (Score:4, Funny)
It's a bit like the difference between living in your mom's basement and having her come and clean up you room randomly when you're not at home (or when she thinks you are not, but are in fact, having a good time with your girlfri... I mean, inflatable doll)
Call me perverted, but as a Java programmer, I AM THE MOM, and the program is the permanent teenager. And I don't want that teen to fuck $whoever in the basement, without me knowing - no, without me _asking for it_. Garbage collection is just an automated facility (think of a roomba) to help me control the mess the goddamn kid creates (used condoms and smelly sneakers).
Re:Pascal (Score:4, Interesting)
nahhh .. in my analogy, the GC is your mom. the programmer is the one with the smelly condoms and the used sneakers.
This is /. after all, so I guess I should have used a car analogy :
You most definitely don't want to learn driving in THAT, but once you're used to the beetle, you'll want something fast, better
okay .. the analogy is probably a massive fail and I'm burning Karma as if there was no tomorow here, still .. I stand to my point : start with something really easy, and when you want to play with the big kids, use a language which keeps the hand-holding to a minimum.
Re:Pascal (Score:5, Insightful)
Being a professional software developer who works in Java, and a former nightclass teacher of Java I can say without reservation that Java is NOT the best first language. Java forces you to use Object constructs from the get go. These things get in the way of communicating the principles that you want to teach. Say you want to discuss IF statements, instead of writing this:
a = 5
if a>7:
print "a is bigger than 7"
else:
print "a is smaller or equal to 7"
you need to write something like
public class Example{
public String main( String[] args ) {
int a = 5;
if( a> 7)
{
System.out.println("a is bigger than 7");
} else {
System.out.println("a is smaller or equal to 7");
}
}
How different is this? Well, first of all you have the concept of a class, which you can either gloss over or explain in full. Students don't know off the bat what is important and what isn't, so the class details obscure the point being made about conditional constructs. Second, the System.out.println lines introduce several ideas, such as Classes (again), the differences between classes and instances (objects) and what methods are. The first example is Python, the second Java. In summary, Python is a far better language to start with because you can teach concepts in isolation.
Java is still my favourite professional language, and to be sure it isn't a knarly twisted mess like C++, but it still isn't the ideal language to introduce students to.
Re: (Score:3, Informative)
For logic programming, we were taught Prolog.
Pseudo Code (Score:3, Interesting)
If they want to understand the logic of computers, then they should write pseudo code first.
Do this until they are not new programmers.
Re:Pseudo Code (Score:4, Informative)
So... you recommend Python?
Re:Pascal (Score:4, Informative)
Sorry, but I started with Pascal and then Delphi. And it blocked me. Because I always walked around C/C++, and never really learned it.
I loved it, back then. But frankly, ObjectPascal, as a language, and Delphi, (as in:) the libraries, are extremely outdated today. After years of Java, PHP, Python and Haskell, I found myself crippled by their lack of features. And only C and C++ beat it in lack of elegance. But C/C++ at least have more features.
I recommend starting out with Python, and maybe the WebDev area (which is much fun right now, with HTML5, JS, SVG, CSS3, Firebug, etc, in Firefox 3.5).
And then go straight for the full package:
C and Java (forget C++, it tries to be C and Java, but fails to beat both) on the practical side, and
Haskell and Ocaml on the fun and educational side. (With Haskell, you're in for a ride, but it is totally worth it.)
There is no walking around it, by clinging to simple languages for years. The nice thing is, that when you learn the most advanced languages, you automatically learn to program in a better way in less elegant languages (like using full OOP and functional programming styles in C and JS.)
Re: (Score:3)
Yeah and the mirror is surely the reason your face seems ugly.
Instead of blaming tools, blame your incompetence. I started with Pascal/Delphi myself, had to switch to C and C# later, doing a bit of Java right now. In no way is Pascal really lacking features and Delphi Language is pretty much as powerful, as any other modern OOP language is. The syntax is different than the syntax of a curly brace language but then again, Delphi Language comes from a different language family (Algol) so it is to be expected.
Re:Pascal (Score:4, Informative)
C and Java (forget C++, it tries to be C and Java, but fails to beat both)
I'll readily agree that C++ is an awkward and complicated language that is absolutely not suitable for beginners, but how can it try to be Java? C++ predates Java by over a decade.
Re: (Score:3, Insightful)
I think most of the comments here are missing the point. A first prepgramming language should be about doing "stuff" with as little programming drivel as possible.
Alice is a language designed for people new to the idea of programming. If your subject is under 14 it is definitely worth looking into. For someone older, stanford has a great intro to programming clas online. It is cs106 with Dr. Sahami. The first couple of lessons are with karel, and then. It eases into java.
Re: (Score:3, Interesting)
Alice is a language designed for people new to the idea of programming
There are a lot of languages designed for people new to programming, and many of them are better known and more widely supported than Alice. And I'm still far from convinced that a functional language is the best way to start. A lot of standard tasks are complicated by the functional approach. Alice at least is based on Standard ML which is not a pure functional language (more along the lines of LISP than, say, Miranda, the language I
Re: (Score:3, Funny)
I wrote: And I'm still far from convinced that a functional language is the best way to start. A lot of standard tasks are complicated by the functional approach. Alice at least is based on Standard ML which is not a pure functional language (more along the lines of LISP than, say, Miranda, the language I learned functional programming with), but I'd still avoid it for a few reasons, most notably the fact that the only GUI binding available for it is GTK+ which is a very complicated environment that I would
Python then C/C++ (Score:3)
Nowadays I would suggest Python as firs language as it is fairly easy, clean and powerful general purpose scripting language. Then extend it with C/C++.
Just don't start with VB, PHP, Java or C# as it will screw the person up for lifetime.
Re:Python then C/C++ (Score:5, Insightful)
I strongly disagree with this. Refusing to learn a new way of doing things will screw the person up for a lifetime. But the blame for that is on the person who is now screwed up, for being lazy.
Re:Python then C/C++ (Score:4, Insightful)
Re:Python then C/C++ (Score:5, Insightful)
Nowadays I would suggest $_language_of_choice as firs language as it is $_reasons[0], $_reasons[1] and $_reasons[2] language. Then extend it with $_arbitrarily_superior_language.
Just don't start with $_other_language[0], $_other_language[1], $_other_language[2] or $_other_language[3] as it will screw the person up for lifetime.
Please, I get so tired of arguments like this.
As long as:
who cares what languages they learn? If they enjoy it and it allows them to learn how to program why should it matter what language they start out with?
Re: (Score:3, Funny)
Because <my language> is better than <your language>! And here on Slashdot, we need few reasons to enjoy a good language war. So go away with your "reason" and "logic"! We've got a pointless battle to fight!
And for the record:
1) Java and C# suck because they require N levels of nesting before they can type "Hello World".
2) Assembly/C sucks because they're too low-level.
3) C++ sucks because it's horribly byzantine.
4) Scheme/Lisp/Haskell sucks because they're confusing.
5) Python/Perl/Scripting
Re: (Score:3, Informative)
# it has all of the fundamentals of programming (looping, flow control, data structures, variables, etc)
Looping is not fundamental to programming languages. It's an iterative construct that is not necessary in declarative languages -- and not necessary in most languages, actually.
Re: (Score:3, Interesting)
Not all 15 year olds are gamers. My first script was for an eggdrop. I also knew several young kids on IRC who scripted for mIRC. Scripting is great because it yields quick results, allows you often to see others code, and gives functional results.
With the ADD world we live in, the investment needed to see results in a 3D graphics world is going to be a hard sell.
no right answer. (Score:2)
You have to look at the source code to figure out what a Scheme program is doing? Isn't this true in.... every language? Even if the "source code" consists of little blocks you're dragging and dropping together?
how about c++ (Score:2)
In my opinion you should start ingraining the OO paradigm as soon as possible. I would say Java for its relative simplicity, but Java hides a lot of the nitty gritty details that you get exposed to when dealing with a language like C or C++. So then C++ might be a happy medium. You get exposed to all the object-oriented concepts, but are also forced to learn about memory management, linking, etc. Plus, as a little bonus, its widely used in industry. I think this can be appealing to new programmers in a
Re: (Score:2)
My first language was Q-BASIC, then javascript, PERL, then *shudder*Java*shudder* and finally PHP
Having a grasp of OO concepts makes it easier to learn other OO languages. Depending on what your trying to program your options are different(Desktop app, vs web app)
My recommendation as a first language would be PHP. The nice thing about scripted languages is no compile time! So you can write your code and test it instantly. PHP also provides nice error handling to help you debug.
Scheme is the best teaching language (Score:5, Insightful)
for the professors, that it. By removing all the syntax, etc, you can be introducing functions, lexical scope, binding, etc in the first week. Data structures and recursion in the second.
Result: most students quit by week two, and you are left with a fairly teachable remainder.
Re:Scheme is the best teaching language (Score:5, Informative)
This is very, very true. We lost a ton of kids in my 100-level programming class because they couldn't "get" Scheme.
That was a fun class. Got to learn a new language and do almost no work that semester...
Python and Pygame (Score:3, Interesting)
For a 15 year old? Python with the Pygame toolkit. There are other toolkits besides Pygame, but that one works well.
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Informative)
No. New programmers should be looking at a problem and thinking "How can I solve this" not "Where can I find a third-party library or toolkit that solves this?" That doesn't teach them the language, it teaches them Google.
To be fair, implementing graphics by raw interface with the windowing system is so difficult that a newbie attempting it will give up in minutes, and giving up programming certainly does not teach the language.
I seriously don't see how a third party library to visualize your computations impairs the teaching of the language.
Re: (Score:3, Insightful)
To be fair, implementing graphics by raw interface with the windowing system is so difficult that a newbie attempting it will give up in minutes
I didn't mean they should be writing their own implementations of Pygame, I meant that new programmers shouldn't be doing anything so complex that it requires them to use anything other than the standard library. Learn the language, then play with the extras.
Re: (Score:2)
You recommend making a 15 year old who has never programed before interface directly with the low-level OS APIs?
No, I recommend making a 15 year old who has never programmed before start with;
print "Hello world";
Learning the standard library of the language, learning the language itself, not jumping into using an external toolkit.
(At least) two distinct objectives... (Score:5, Insightful)
The one is engagement/excitement/comprehensibility: If somebody is disinterested in, or hugely frustrated by, a subject on first contact, they will have minimal motivation to continue. Unless you simply plan to beat it into them, introductory material needs to grab the audience(this doesn't mean that everybody must be your audience, of course). In many cases, this means a (temporary) sacrifice of rigor or correctness; think of intro physics, where you start with simplified Newtonian scenarios, or math, where you generally start by talking about addition/subtraction/multiplication/division, not sets and number theory.
The second value is that of being correct and rigorous, or at least not impeding later development in completeness and rigor. You obviously cannot learn everything all at once; but there are some simplifications that make it easy to fill in the gaps later and others that actively retard that effort. This can happen either because the simplifications are hugely different than the reality, and harden people in the wrong ways, or because, in an attempt to be "engaging" the intro stuff promises that the subject will be "fun", "relevant", and "exciting" to everyone, every step of the way. Fact is, that isn't true. Most subjects have, at some point or another, patches of sucky grunt work. Promising people that they are precious flowers who will never have to soil their hands with such is a good way to make them drop out when they hit those patches.
"Not engineering"? (Score:2)
> After all, as Jeff Atwood puts it, 'what we do is craftmanship, not engineering...'
It would seem that Mr. Atwood has never done any engineering.
Re: (Score:2)
Assembly (Score:5, Interesting)
First, learn assembly, it teaches you how the machine works. (You should probably also learn electronics and digital logic)
Then learn C, it is the most widely used in both commercial and open source.
Then learn C++, it is a better C.
Then learn Java, it rules the web.
Then learn Python, it has some very clever ideas.
Finally...never stop learning
Re:Assembly (Score:4, Insightful)
I think you want to pick a first language with which the kids can get some fun results fairly quickly, and keep their interest. Assembly is not ideal for this. With that said, by all means teach them how a computer works, right from the start.
My dad taught us programming, back in the days when building a computer meant heating up the old soldering iron. He started with explaining what a computer does, the components (registers, memory, i/o) and the instructions you could use to tell the computer what to do. So he taught us about assembly without actually teaching the language, but even so it proved valuable to know more or less what goes on inside a computer at the lowest level. He then got us started off on Basic (which was pretty much the only option), taught loops, conditional statements, functions / subroutines etc.
Any modern langauge can teach these basics, and I think they are still a good fundament. From there you can move on to object orientation and using mroe complex libraries and APIs to access the higher functions of the machine. I actually like the idea of starting with C (or just program C-style in C++), then adding object orientation on top of that by moving on to C++. Java might be good but I have no experience there.
Another option is PHP. It is a lot less finicky; of course the OO aspects are rather poor but one should ask if they are teaching their kids programming fun, or preparing them for a career. PHP (or a similar language) is nice because it is a language well suited for building simple, active web sites. With any luck, your kids will quickly find a few ideas for websites that he can then implement himself... and nothing is better for keeping someone interested in learning to program is having their own project to complete. Once their first efforts go on-line, teach them about structure, web design, and security. Yes, by al means do code reviews, but keep it fun... show them how they can do things better.
Whatever language you pick, I'd start kids off by keeping them away from IDEs and letting them code in Notepad (do not make them use vi; be mindful of child abuse laws)and a command line compiler (where applicable), just to teach them what goes on under the hood. Once they get to a level where they will want to use more complex libraries, GUIs etc, get them an IDE.
As an afterthought, do introduce them to the whole open source thing. Nothing stimulates more than a thriving scene of fellow developers.
Re:Assembly (Score:4, Insightful)
Java's strong/weak point is its memory management. You'll never have to deal with/learn garbage collection or pointers.
I disagree with this. There is nothing more frustrating than trying to learn to program and getting compile/runtime errors from a command line.
Without an IDE: "What the hell? What did I do wrong on line 53?"
With an IDE: "What the hell? Oh! The syntax highlighting tells me I didn't define the variable, I'll remember that for next time."
Using notepad is a horrible way to write code! I'd rather start them off with the IDE to get them familiar with the language first. Once they're familiar they can move on to command line compiling/building, at that point they'll have a good enough understanding of the language to focus on the command line tools (be it gcc and make or javac and ant or whatever).
Re: (Score:3, Insightful)
Assembly as the first language? 99.99% of first learners who aren't doing a mandatory course in school would walk away.
The first language has to be PICK UP AND GO. It is allowed to be a horrible abstraction of what the computer can do. It should be limited, to not confuse with abilities. It should allow creativity to be expressed. It should be easy to see results, no complex build system, nothing inbetween the programmer, the code, and running the code.
Then when the first language is too slow, or doesn't al
Re: (Score:3, Funny)
Assembler is great but it's a horrible choice for a first language. It was fine as a first language 30 years ago when people had simple expectations for software. I'm not saying to never learn it, but it's unnecessary as a first language.
C is not the most widely used commercial language and it certainly does not lead the way in open source (the open source movement started with Java). Both those categories belong to Java.
Re:Assembly (Score:4, Informative)
C is not the most widely used commercial language and it certainly does not lead the way in open source
So...What is Windows written in?
What is the Linux kernel written in?
What are KDE and Gnome written in?
Autocad...Photoshop...MS Office?
AFIK, they are all C or C++
Re: (Score:3, Insightful)
So...What is Windows written in?
What is the Linux kernel written in?
What are KDE and Gnome written in?
Autocad...Photoshop...MS Office?
AFIK, they are all C or C++
Off-the-shelf packages like these are atypical, and represent I believe less than 1% of code that is written commercially. They are dwarfed by the number of payroll systems, account management systems, workflow tracker systems, management information systems, intranets, extranets, web services, etc. Most of these are written (depending on how old
Re:Assembly (Score:5, Funny)
First, learn assembly, it teaches you how the machine works. (You should probably also learn electronics and digital logic)
Better yet, first make them learn Lambda calculus, then make them understand the Church-Turing thesis. Only when they fully grasp the nuances of an Universal Turing Machine should they even *touch* an actual computer and program in Assembly.
Or perhaps teaching "from the bottom-up" isn't such a good idea.
From an HCI perspective (Score:4, Informative)
take a look at alice.org (Score:5, Interesting)
"Alice is an innovative 3D programming environment that makes it easy to create an animation for telling a story, playing an interactive game, or a video to share on the web. Alice is a freely available teaching tool designed to be a student's first exposure to object-oriented programming. It allows students to learn fundamental programming concepts in the context of creating animated movies and simple video games. In Alice, 3-D objects (e.g., people, animals, and vehicles) populate a virtual world and students create a program to animate the objects.
In Alice's interactive interface, students drag and drop graphic tiles to create a program, where the instructions correspond to standard statements in a production oriented programming language, such as Java, C++, and C#. Alice allows students to immediately see how their animation programs run, enabling them to easily understand the relationship between the programming statements and the behavior of objects in their animation. By manipulating the objects in their virtual world, students gain experience with all the programming constructs typically taught in an introductory programming course."
kulakovich
Advice from "Epigrams in Programming" (Score:2)
Alan J. Perlis said: "A language that doesn't affect the way you think about programming is not worth knowing". (personally I would remove the 'about programming' bit).
I think the same applies to a first programming language. It has to expand the learner's view of the universe. Getting a language which panders to the learner's universe does not do them any good.
Re:Advice from "Epigrams in Programming" (Score:4, Insightful)
ANY first programming language introduces new concepts. When you're starting out even something like the concept of a variable takes a little getting used to. Maybe you can relate it to memory store/recall on a pocket calculator, but with a name. Later you can introduce arrays of variables, non-numeric variables, etc.
You seem to have forgotten what it was like in the beginning to know *nothing*.
Fast and free (Score:4, Interesting)
PHP (Score:4, Interesting)
Its not consistent, its not even well designed I expect, but its a remarkably easy way to learn to manipulate a computer. Learn a bit of HTML first, some CSS, then work on OO PHP and you can accomplish a lot. People will dismiss PHP but there are a lot of very large websites built using it - ones that lots of kids will be familiar with.
Follow it up with a second language once you have gotten the basics down pat - Python is likely a very good choice.
Re:PHP (Score:5, Insightful)
I was just going to write this comment myself. The biggest advantage of PHP is that you go from zero to tangible results very quickly. No programming language is going to be interesting to teenagers if they can't instantly do something useful with it, and to a teenager, cool web stuff is the useful thing that they're most likely to be trying to do.
Re: (Score:3, Insightful)
The problem is the vast majority of PHP code in the world is bad. It can very easily teach bad habits.
I was fortunate to write my first program in 1970 (Score:2, Interesting)
I say fortunate because there was nothing in the way; no distractions like GUIs to dilute the experience. Just BASIC on the command line.
It doesn't really matter whether the youngster uses BASIC, Pascal, or XYZ. It should just be a simple language so the concept of logic and process flow is what is learned, rather than getting bogged down in arcane concepts of the language itself (or some pig of a GUI, like "Visual" this, or "Visual" that).
PS. The environment was an interactive "command line" and BA
Start simple? (Score:3, Insightful)
The best first language is anything simple that lets you jump right in and understand the basics like variables, loops, arrays, etc, without getting bogged down in an over complex or restrictive language. It doesn't need to be the worlds best language - it's to get you started. You could do far worse than start with a BASIC interpreter (instant feedback, no compiler/linker to deal with) at a very young age.
Those of use who started out at the beginning of the personal comnputer (not PC) phenomemon in the late 70's started out simple. After putting away your soldering iron, you got out pen and paper and started hand assembling machine code. And we liked it!
At the same time c.1978 a highschool math teacher and a bunch of us took adult education classes at the local university (Durham, UK), where they taught us PL/1, and some of us found a way to hang out at the university after that and started playing with BASIC, then taught ourself C. The big excitement was going from the batch-mode PL/1 class with jobs submitted on punched card decks, with printed green bar fanfold output (maybe just a syntax error) delivered some time later, to being ONLINE sitting in front of a terminal. Whoopee!
Obvious answer (Score:5, Funny)
The best first language for a young programmer is english with possibly a little bit of boolean logic, because then he could search Slashdot and find one of the Ask Slashdot stories about what the best first language for young programmers is that appear every couple of months or so.
Lua (Score:3)
There are lots of good choices for a first programming language these days, but I thought I'd chime in and suggest Lua for consideration.
Lua is free.
The Lua interactive interpreter makes exploring and learning the language a pleasure (much like the Python interactive interpreter).
There are excellent and up-to-date free tutorials for Lua available online.
Lua integrates easily with C, giving you trivial access to any low level OS features you need.
The language is a pleasure to use. It just feels right.
Give it a shot. You won't be disappointed. :-)
Quit knocking the hacker ethic... (Score:5, Insightful)
People that knock the hacker ethic are a bunch of MBA drones that could never really build a damned thing themselves.
You learn to program by diving in and doing it. The more you practice and study, the better you get at it. GM was very good at shackling some very brilliant engineers and turning them into process drones. Look at where it got them. Great things are built by individuals and the more steps you have in the way of people being individuals, the worse you will get. Products have to be owned by the engineers that make them and they are personal works of art.
At the end of the day, the managers, bean counters, and all of these other people with their measurements, metrics and fancy charts are so much fluff, a tax on the capable in society... by really a bunch of leaches that could barely feed themselves as they lack the mental self sufficiency to do anything other than to try and ride the labor of others. We condemn socialism in society there's no real difference between the PM in a three piece suit and the lowest of the homeless people. Neither add any real value to society, its just that, the PM knows how to use PowerPoint and the homeless guy does not.
Re: (Score:3, Interesting)
This comment is amusing to say the least. I have both a CS degree and an MBA, so I see both sides.
First of all, I agree with the comment about diving in and doing. You can memorize the syntax of a language all day long, and until you apply the language to a problem, its useless.
That (and some of the stuff in your link) is about all we agree on. I read you comment and I know EXACTLY your type. You are bitter because you have barely moved through the chain. You wonder why you work so hard and make "littl
Oh brother! (Score:3, Interesting)
That (and some of the stuff in your link) is about all we agree on. I read you comment and I know EXACTLY your type.
Stop.
You really think you know my type? You, just like every of your type, have it in your head that everyone has a a great desire to be just like them, or to do what they do.
Honestly, I really don't. I have no desire to be like you at all. Like, I don't need to have people beneath me to affirm myself. I don't need to have power to be satisfied with what I have done. I have myself, my two
Re: (Score:3, Interesting)
People that knock the hacker ethic are a bunch of MBA drones that could never really build a damned thing themselves.
MBA "drones" build things all the time. You just don't understand what, because they use human beings as their construction material.
You learn to program by diving in and doing it. The more you practice and study, the better you get at it.
You learn some things, but not others. You'll never learn how to write maintainable code this way.
GM was very good at shackling some very brilliant engineer
Teach him C (Score:3, Interesting)
Buy him a copy of C for Dummies and have done with it. C is kind of like the Latin of programming, except it's easier to learn than Latin.
I would have suggested BASIC around a decade ago, but I can't think of a modern BASIC implementation that's neither horrendously complex for a new programmer or insanely outdated.
anything ... (Score:2)
The reason I exclude the above three attributes is that they lengthen the learning curve to getting a "hello world" program written and working. If a newbie's first exposure to programming is spending hours in a classroom without producing any output, the teacher will start to hear CLICKing noises after the first five minutes as the children switch off (metaphorically speaking). After that, they're l
scratch (Score:2)
http://scratch.mit.edu [mit.edu] designed explicitly for this
Re:scratch (Score:4, Interesting)
Programming in Scratch helps kids
During the directed learning that takes place in a Scratch-oriented curriculum, the teaching team can introduce another programming language to show how syntax-oriented programming languages can perform the same tasks as the graphics-oriented systems. Any programming language can serve as that second language.
I find it a bit ironic that the best language for teaching programming languages isn't a language at all.
JavaScript/HTML (Score:3, Interesting)
One not-so-obvious candidate: JavaScript and HTML.
Pretty much every browser in existence supports JavaScript, so with nothing more than a simple text editor and your browser of choice you can be off and running. As far as beginning programming is concerned, JavaScript easily encompasses any programmatic constructs you'd need.
The best part is that the students can easily display the results of their test programs in HTML, either dynamically generated or just by manipulating some divs, textboxes, tables etc that they've written on their page. Additionally, an instructor could write a 'playground' bit of HTML and JavaScript, so all output variables are bound up and easy to access. At that point the student is free to focus on what really matters, his/her first logic routines. When the student has created his first masterpiece, sharing the accomplishment with parents/peers is as simple as sharing a link to their HTML file.
I think this has the potential to engage students much faster than observing console output or fighting with a front end like windows forms in VB or Swing in Java.
Re: (Score:3, Interesting)
First, JS is what powers the web, and is both a simple language to understand the basics of, and a complicated one to continue learning from. Along with HTML it can be easy to prototype ideas and have instant results, which can be very helpful for inspiring young programmers.
Secondly, it's object-oriented in a very different and arguably more powerfu
Scheme to first year CS students (Score:4, Insightful)
I don't associate Scheme with 'the hacker ethic'. I don't strongly associate any language with hacker sensibilities. I do associate Scheme with the intellectual rigor required for a programmer who really has a clue about programming.
I think Scheme is an excellent language to teach college students who think that they know how to program because they managed to smoosh together a bunch of working PHP code and make a website. I think it is a poor language to teach high school students who are learning their first language.
The association of technical knowledge with competence irritates me. A competent painter needs to know about brushes and mixing paint, the difference between oil and acrylic, and a whole host of other technical details. But that's not how you get a good painting.
One of my reasons for feeling that Scheme is a good language for people who think they know how to program is that such people frequently know all about paint but do not have the depth of understanding to be a good painter. Scheme is a language that forces you to think about programming differently than you did before. And if you understand it you are on the path to being a good programmer rather than just a code monkey.
But I would not recommend it as a first language. I would recommend Python for that. Clean, concise, expressive and powerful. It's my favorite language for a reason. :-)
According to research, its Algol 60 (Score:3, Informative)
In Germany, researchers into didactics (teaching) of computer science (Informatik) have done some work on this topic. I recently found it when I was looking into materials for the computer science course in the Netherlands (seeing if I could do better).
Based on 15 criteria, they ranked 27 languages, ranging from Scheme to Haskell, ADA to Ocaml. The worst language for teaching was, by far, APL (scored a 5, which is the worst), followed closely by Perl. The best language for teaching was Algol 60 (1,50). Second best Python (1,66), 3rd place Ruby (1,88) and scraping in at a 4th spot was Pascal (2,14).
So to summarize: better dust off your Algol 60 books and compilers :P
Failing that, Python and Ruby are nice as well for just teaching programming (although if you want to show the distinction between imperative and functional programming I'm not altogether sure that Ruby would be enough).
------
This was found in a (Dutch language) PDF: http://www.utwente.nl/elan/huidige_studenten/overig/OvO/OvO-inf/Eindverslag%20INF.pdf [utwente.nl] (see page 8 for the German criteria, and page 9 for the results). See the original research (*) here: http://subs.emis.de/LNI/Proceedings/Proceedings22/GI-Proceedings.22-12.pdf [subs.emis.de] (German language document)
(*): [LH02] I. Linkweiler, L. Humbert. Ergebnisse der Untersuchung zur Eignung einer Programmiersprache fÂur die schnelle Softwareentwicklung â" kann der Informatikunterricht davon
profitieren?, Didaktik der Informatik, UniversitÃt Dortmund, 2002.
language probably matters to some extent (Score:3, Informative)
I've actually had this experience. I've mentored someone from about 12 - 15. He's going to be one of the best programmers of his generation if he sticks to it.
First, I agree that at this age finding things he wants to do is more important than the specific technology. But I would argue that the technology does matter to some extent. There's a lot of time between 12 and college. Someone who spends a lot of it programming is going to get at least as much experience before college as in college. I'd like to see it go in the right direction. When I taught computer science 111, I sometimes had to tell kids who were self-taught in Basic to forget everything they knew. I'd hate to see that happen to someone who had invested lots of time.
I think it's the job of the mentor to encourage -- with a light enough touch not to discourage -- use of good programming techniques. That means talking about program structure and design, proper data structures, and any other concepts needed for what they're doing. (In my case the kid likes doing multi-threaded network services, so I had to teach him synchronization much earlier than you'd typically do that.)
I haven't programmed in Scheme, so my judgement on it is probably not reliable. I did do a lot of work in Common Lisp. While in many ways I liked Common Lisp more than more recent languages, I think a language like Java or C++ is more likely to push you to think about structure. C++ seems a bit low level. I'd be willing to accept either a high level language like Perl or Python, or something lower level like Java or Visual Basic (using the newer features of the language so that it's essentially the same as Java -- although C# might be a better choice).
For someone who is just going to be playing around there's a lot to be said for Perl/Python. But if they're going to be doing anything big enough where structure matters, I'd probably start with Java or maybe C#. Of course you can certainly start with Python and them move to Java.
In my case, the student I worked with started with Visual Basic, moved into a more structured form of Visual Basic, and then to Java. By now he's also done PHP and C++. It's also all been his choice. And in fact the real answer may be that when working with teenagers unless you want to spoil the fun there's a limit to how much you can or should actually determine what they do. So you may end up supporting them in whatever language they pick. But if someone is likely to be a professional, I'd probably try to get them into a structured language like Java fairly soon for at least some of their work.
"What we do is craftsmanship " (Score:3, Interesting)
And that there my friends is the crux of the problem. This is why we are now swimming in code bloat from every angle. Sorry to disagree with your view of the world, but *proper* programming IS engineering.
Now, to get back on topic, how about something like Squeak? Using squeak land, you can 'trick' the kids into learning a real language. Of course i learned by sitting in front of a 8080 i built from scratch from reading intel data books that i wanted to actually do something other then sit there, but i realize that isnt for everyone.
Python is also be a good starting point. Approachable, and 'legit'.
Brief history of my programming... (Score:3, Interesting)
I learnt BASIC first, on the Sinclair ZX-81 and then the Sinclar Spectrum.
Soon after that, I learned to program using Turbo Pascal, and I translated a lot of my BASIC programs to Pascal on my Dad's PC.
At school, I learned to program on a BBC Micro using BASIC and 6502 assembler and a little while after that I learned to how to program using 808[86] assembler.
C++ was the next main language I learned to use but between Turbo C++ and Turbo Pascal, I preferred Turbo Pascal, especially how well it managed dependencies and the sheer speed of compilation. I was a very loyal Borland customer, purchasing nearly every version of Turbo/Borland Pascal for DOS (excluding 5.5)...
And then I went pure 32bit programming in 1994 and left the Borland world behind... Used Watcom C++ and Virtual Pascal. Found the GNU compiler. For the last 10+ years, I have almost exclusively been programming using GNU compiler in C and C++.
To answer the poster's question: I would recommend Pascal as a good learning language for learning structured programming.
But to graduate to C and C++ after the basics are well understood and good practices have been learned.
A language with a popular forum. (Score:3, Insightful)
The best way to learn to program is through social interaction about the subject within a culture dedicated to a wide array of programming topics.
Languages like scheme, lisp, haskel, perl, ruby, python... these are often domain-focused, where it would be hard for the budding programmer to get into some areas of programming that might keep them interrested. For example, graphics or sound.
Languages like C# and VB.NET have a more generalized culture, where you could get into just about anything and actualy find other people doing the same stuff via online forums (in the old days it was through BBS's and FidoNet.)
So I recommend a general language, without much meaningfull limitations, that has one or more high traffic public forums online dedicated to it.
Scheme "write-only" ? (Score:3, Insightful)
Scheme isn't remotely write-only - instead it changes how one thinks about programming for the better. If you really want to see write-only, let me introduce you to my good friend perl without strictures.
C++ or Fortran (Score:5, Funny)
Personally I would recommend C++ or Fortran since that should quickly kill their interest in programming. And I really don't want more competition from bright young people.
Comment removed (Score:3, Interesting)
Re:best first language? (Score:5, Funny)
Assembler (Score:3, Interesting)
Re:Assembler (Score:5, Funny)
In before old people telling you about punch cards.
Come to think of it, is there a way to do calculations with kids on/off your lawn?
Re: (Score:3, Insightful)
Re: (Score:3, Funny)
This was before lawns were invented.
Re:Assembler (Score:5, Insightful)
It teaches you how a computer really works. That way you can become a 'real' programmer instead of an IDE user.
Really? Seriously?
I don't think assembler is the best way to instill the magic and excitement of getting the most complex machine in your house to do what you want it to. And, that's what a fifteen year old newb needs. If you start with assembler, you're assuring that it will be months before he has learned enough to be able to take a program that he's written to a friend or parent, and have that person say, "Cool!". And, it will be even longer before he can use even a fraction of the modern technology that computers now have; things like GUI's, and networking. More often than not, it will only cause frustration.
Back in the day, assembler might have been the right option. But today, I think that's a recipe for killing that spark of creativity and excitement that draws people into programming, and gets them to slog through the nitty-gritty stuff.
Re: (Score:3, Insightful)
Since we're talking about learning languages here, I think we need to remember to balance "excitement of programming" with actual learning.
Assembler is a terrible first language because it doesn't really teach programming so much as learning how a particular CPU works. You could theoretically get away with something like MIX because it's just a simple emulation of assembly, but real assembly language programming is something that really shouldn't be attempted until normal programming is learned.
On the other
Re: (Score:3, Informative)
BASIC is another good choice
No it's not, it's a godawful choice.
I don't know if you meant old-school 8-bit-style BASIC or Visual Basic.
If you meant the former then, WTF? There were technical reasons why it was popular and (to some extent) its use was justified on early microcomputers. These technical issues no longer apply, and it's entirely unsuited to programming on a modern scale.
And traditional Basic was *notorious* for fostering bad programming habits; I for one certainly suffered from that, and I really wish I'd used more
Re: (Score:3, Informative)
If it's Visual Basic, then I'm certainly not convinced that for someone coming to it from scratch it's ultimately any easier to learn than (e.g.) C# or other C/C++ derived languages. It retains much of the syntactical clunkiness of old-fashioned basic, and its syntax isn't used much anywhere else, closing off the leveraging effect you get with C-style languages- learn one of those, and you partly know the others. Ironically, this will also make other languages appear more intimidating and locking that person into Visual Basic further.
Agreed, At my college they thought us VB.Net as introduction to OOP programming. We also did C++ and you could do C#. Reason they did .Net is while it wasn't technical school, they did want to teach us a language that was in wide use. However, there is really no other language with similar syntax so when you did some C++, you got to relearn syntax ALL OVER AGAIN.
If you want to teach someone something marketable for first language and there are plenty of .Net jobs out there, C# is much better choice.
Re:Assembler (Score:5, Interesting)
I agree that Visual Basic is as bad a choice for a first language as any other complex programming platform.
What made old skool BASIC good was that it was limited in ability. Admitted data structures were limited to arrays, which was a problem. However a medium-complexity basic like Blitz Basic 2 on the Amiga allowed the creative side to be expressed, without having to wade through complex APIs like you would with a modern language.
And the best way to learn programming to a young person (under 16) is to allow their ideas to be expressed and implemented, be that writing your first football league tracking application, to a simple game, to a text adventure, and so on. If that means using BASIC, e.g., RealBasic, then so be it. It needs to be pick-up-able.
I bet there are people saying Haskell and ML on this thread, for some academic reasons. The last thing a young person wants to be doing is learning how to manipulate data structures, functionally, with all the brain-fuckery that involves, and only to get a sorted list at the end. That isn't exciting, it's not even something to be slogged through, it's tedious and will actually put them off, totally.
10 Print "I am god!" : goto 10
run
instant result.
It's sad that computer magazines don't have programming in them any more, unlike the 80s. Game type-ins promised rewards to typing, and learning was osmotic.
Re: (Score:3, Insightful)
Assembly teaches you 'how to bake a cake'. So does BASIC and Pascal and C.
The problem for me was moving from such basic programming to high-level modeling using (in my view) a much better system of OO design.
Start them with Objects... I had a hard time getting into OO programming because I started with a very low level language.
Assembler: start there and stay there (Score:4, Interesting)
Start them with Objects... I had a hard time getting into OO programming because I started with a very low level language.
I started on Fortran. It was horrible. Then I got a home computer with BASIC and advanced to assembly language.
25 years later, I still am at the assembly language stage for programming. But I use different processors and tools. The language is not as important as the tools that support that language. Visual BASIC is great because it gives a simple easy-to-use way to create programs in a Windows environment. Its structural limitations are irrelevant. It is the cost and sophistication of the development tools that is more important.
Now that you can buy a microcontroller for $1.50 that has more power than the original IBM PC, development tools like IDEs are the most important consideration. Computer science was important when computers cost a million dollars: it is meaningless today when they cost a few dollars.
I detest C because I can't debug it on the IDE that controls my $1.50 microcontroller. I can read it and write it fine. I can work with it fine. But I hate it because it's too abstract. I have no idea of what exactly the CPU is doing.
OOP is just science fiction; it's advantages are imaginary. If your application is so advanced and complex that you need OOP to create a program to do it, then it's time to completely rethink the idea of what a computer does.
Computer science is the process of reconfiguring complex concepts to fit into the limitations of the machine. Computer science becomes irreverent when you realize that the more complex the problem, the easier it is to solve by redesigning the computer to fit the problem. Not reducing the problem into small enough processes that will fit into the machine.
It is cheaper and faster to design a custom arrangement of 1000 $1.50 microprocessors to match the needs of complex problem than it is to write and debug the software that will 'solve' the problem on a $5000 standard Von Neumann computer. Microcontroller programmers are cheap and easy to recruit: OOP software development teams are expensive.
This is the new reality of the 21st-century. OOP is the last gasp of the 'big iron' boys.
Re: (Score:3, Funny)
Then maybe they should start them with Lisp instead? :)
Then we'll have lots of programmerth all over the plathe. As if nerdth didn't thuffer from an image problem as it ith.
Re: (Score:2)
I wouldn't recommend Assembly. Most of the "under the hood" things are not the job of the programmer anymore. That's why we have compilers.
If I could choose now, I'd learn Python first, for basic algorithmic programming, followed by C, to get a grip on what's really happening at runtime. After that, you're not dependent on language anymore.
Why do I think C is important, you ask? Read on [joelonsoftware.com].
Re: (Score:2, Insightful)
I wouldn't recommend Assembly. Most of the "under the hood" things are not the job of the programmer anymore. That's why we have compilers.
And that's why we have so much of shitty inefficient code around. Even when you program in a high-level language, you still have to realize how the code you write works on the machine level. I've seen PHP programmers throwing around calls to array_diff/array_unique, chaining them without mercy, without thinking about performance - because they think that those function are some magic black boxes and never consider a performance hit. "Oh, it's a C function, C is fast anyway from what I've heard". Like a good
Re:Assembler! (Score:4, Insightful)
a good programmer should know all the chain, from Java/Python/Scheme/Whatever down to the machine code.
Yes, but you don't start with assembly language. You start with something conceptually simple, like Python. I started with Basic on the Commodore 64. Before a year was up, I was doing shit in 6502 assembly because interpreted Basic was too slow. Not a chance in hell I could've picked up assembly straight off without some understanding of a higher level language. Throwing assembly at someone is like throwing a pile of parts and fasteners at someone and telling them to build a combine harvester.
Re: (Score:3, Insightful)
Most of the people posting here really haven't grasped (1) and (2).
Assembly as a first language is ridiculous, yet so many are arguing for it.
Not only is it irrelevant today apart from microcontrollers, which they might get a job programming in 10-15 years time (assuming they're young now), but it will be incredibly frustrating.
The student has to come to the decision to use C, Assembler, etc, themselves, when they decide they have to in order to realise their vision for whatever they're programming. I.e., t
Re: (Score:3, Insightful)
Re performance, you're describing algorithms.
I've programmed for 27 years, in a great many languages, starting with BASIC and several assembly languages at the beginning.
Honestly, I didn't learn properly about algorithms and algorithmic complexity until I had the chance to learn higher level languages, which weren't available on home computers when I started.
I *did* learn a lot about raw efficiency, from counting cycles and memory accesses and instructions; things like that. I learned how to write really f
Re:Assembler! (Score:5, Insightful)
The problem with assembler, little Anonymous Coward, is that it doesn't let you do anything without a significant amount of work, and what you can do is unlikely to impress a fifteen-year-old kid just getting into programming.
Being able to print a few lines to the screen won't impress that kid and make him want to keep programming. Give him a language that can easily create GUIs, so he can see his stuff in action. To do this, I'd recommend an object-oriented language, maybe Python (though I personally detest it) or C# (which is a very nice language with very nice tools).
Re:Lisp/Scheme != latin of programming (Score:4, Informative)
in fact Lisp itself is built in C
Errr...no. Lisp originally dates back to the late 1950s; C didn't emerge until the early 1970s. The first working Lisp implementation was writtien in IBM 704 machine language; A Lisp compiler (itself implemented in Lisp) was implemented in 1962 - fully 10 years before the birth of C.
Re:Python - flamebait (Score:3, Insightful)
Python is better than Perl because for beginners would takes weeks just to learn all the different possibilities
You don't need to learn them all - you just need to learn ONE to start with, then others can be added as the newbie's level of competence grows. The biggest barrier to programming is a steep learning curve - too much time spent before something tangible can be produced. Any language that lets someone just type stuff, then press "run" is a good start - maybe even Python.
The point of IntroTo Programming courses is (Score:5, Insightful)
The point of IntroTo Programming courses is to instill a comprehension and sense of awe at the ability to control the actions, operations, and functions of physical machinery by using symbols, that are non-physical. It is by using your brain to amplify your body (robotics) or by using your brain to build and control a machine that can vastly amplify your brain (a pocket calculator).
Intro To Programming needs to skip language and process at the beginning and first teach how electricity can be used to create and manipulate symbols. This is multi-stage process that teaches how to use electricity to represent binary numbers, then using binary numbers to represent decimal numbers, using decimal to represent CPU instructions, using instructions to make programs, and using programs to control machines that amplify the users physical and mental abilities. And finally, how to use the imagination to create new structures of symbols to create programs.
Install the sense of god-like awe at the ability to manipulate physical reality by rearranging symbols, and the mundane details of language structure are of minor importance to both the student and the teacher.
Re: (Score:3, Funny)
Turbo Pascal
What a bloody nightmare. I learned Pascal in high school. Two years later when I learned C, I found myself wondering why the fuck anyone would inflict Pascal on people trying to learn programming. I later ended up maintaining a piece of business software written in Turbo Pascal (and later, stuff written in fucking Delphi) and found myself entertaining fantasies of building a time machine and choking Anders Hejlsberg to death in his bed in 1980 before he could inflict his monstrosity on the world.