Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

The Best First Language For a Young Programmer

Soulskill posted about 5 years ago | from the what-language-do-the-binars-speak dept.

Programming 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.'"

cancel ×

634 comments

English without any shadow of a doubt (0)

Anonymous Coward | about 5 years ago | (#28818369)

That way you get access to more texts, more help and need fewer changes to your code to get to a wider market.

Pascal (4, Insightful)

El Lobo (994537) | about 5 years ago | (#28818375)

I always considered Pascal (or Delphi) a great language for beginners. Powerful enough, structured, type safe and very elegant. From there, jumping to other languages is quite easy.

Re:Pascal (0, Offtopic)

wilx (1065624) | about 5 years ago | (#28818779)

I totally agree. Whoever has moded the parent post down is an $&@#$&%.

best first language? (1, Flamebait)

girlintraining (1395911) | about 5 years ago | (#28818377)

The best first language for a programmer is your favorite language. Duh.

Re:best first language? (4, Funny)

Norsefire (1494323) | about 5 years ago | (#28818409)

No, it's *my* favourite language. Your favourite language is awful.

Assembler (2, Interesting)

arthurpaliden (939626) | about 5 years ago | (#28818439)

It teaches you how a computer really works. That way you can become a 'real' programmer instead of an IDE user.

Re:Assembler (5, Funny)

sakdoctor (1087155) | about 5 years ago | (#28818631)

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:Assembler (4, Insightful)

johnsonav (1098915) | about 5 years ago | (#28818715)

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:Assembler (4, Insightful)

BadAnalogyGuy (945258) | about 5 years ago | (#28818823)

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 hand, using a language that allows a student to create a "cool" application very quickly can't possibly teach them very much about programming and computer science. When there is too much "magic" and "gee-whiz" language support, exacerbated by a heavy-handed IDE, the student learns only how to press the right buttons to make their project work. They don't learn what is going on in enough detail to take those concepts to other more useful languages.

So a balance definitely needs to be struck. Python, as many have said, is a good language, though I would actually prefer one with static typing. BASIC is another good choice, though it's been much maligned by many. Personally, I think C is a great learning language, though it too has shortcomings.

Like anything, though, you can't satisfy everyone. But you might as well try to satisfy someone.

Re:Assembler (2, Insightful)

Domini (103836) | about 5 years ago | (#28818759)

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.

basic (0)

Anonymous Coward | about 5 years ago | (#28818391)

I learned to program in basic because that is what was bundled with my tandy 1000. I had a lot of fun making games with it. Later on it was easy to learn other languages and I agree let the young ones use whatever they seem to like. There will be plenty of time to complicate things later on.

Python then C/C++ (2)

Seth Kriticos (1227934) | about 5 years ago | (#28818395)

I personally started out with Pascal in the mid nineties, and it was nice back then (before Delphi came around).

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++ (4, Insightful)

nathan.fulton (1160807) | about 5 years ago | (#28818443)

Just don't start with VB, PHP, Java or C# as it will screw the person up for lifetime.

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++ (0)

Anonymous Coward | about 5 years ago | (#28818825)

New way? Python, GP's first recommendation, was created before most of these languages but isn't old school. I would certainly think of it as more modern than VB or PHP. Indeed, all of those four languages steal most of their syntax and lots of their semantics from much older languages.

Re:Python then C/C++ (1)

woutersimons_com (1602459) | about 5 years ago | (#28818557)

I started programming by learning python. Still valuable to know the language. But now I suppose I am screwed for life as I also write Java and C#. Why I would need to learn C++ is beyond me, perhaps I just need more convincing, but I have not had a project where I wished I knew more C++.

This promises to be a fun discussion, about what is good and what is best and what sucks. Personally, my opinion is that few are in a position to really say that one tool is better than the other. It is like telling a carpenter that he is better off using a screwdriver than a hammer, where obviously he has a purpose for both.

Best first language? The one you have most fun working with I think. When you have fun with a certain tool you are much more likely to have success and really learn it. But whatever tool you choose, whatever language you prefer, learning about the right way to use your chosen language is smart in any case. For that, python might be a good choice as a first language because it does force you to at least indent properly. If you are more of a mathematician it works well enough for functional programming too, so it does seem to be a safe academic choice.

Perl anyone?

Re:Python then C/C++ (1)

morgan_greywolf (835522) | about 5 years ago | (#28818593)

I personally started out with Pascal in the mid nineties, and it was nice back then (before Delphi came around)

That's not true. I was doing Delphi in the mid 90s. I started out on Turbo Pascal in the mid 1980s.

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++.

Agreed.

Re:Python then C/C++ (5, Insightful)

SirLurksAlot (1169039) | about 5 years ago | (#28818605)

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:

  1. the language (and the associated tools) are available
  2. it has all of the fundamentals of programming (looping, flow control, data structures, variables, etc)
  3. and it grabs their interest

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:Python then C/C++ (1)

FlyingBishop (1293238) | about 5 years ago | (#28818635)

My school just began (the fall after I've graduated) a pilot program with our CS1 course in Python. (It was previously Scheme.) So it looks like the curriculum will be moving to exactly what you describe.

However, while I would call Python appropriate for a High-school or middle-school curriculum, I would think a more direct approach is called for at the university level. Python is a dream, I love it. However, you cannot fully appreciate Python unless you have C++ and assembler behind you.

Me, I started with scheme, and then took our assembler course and C++ intro out of order, so my language progression was Scheme, Assembly, C++.

If I had to go back and do it again, I think the ideal progression would be Assembly, Python, C++ (since most of our research was done in C++, it makes sense to teach last what will be used most often.)

Yes, Python provides much more instant gratification than assembly or C++, and if a "hard science" major is just going to take one CS course, Python is not a bad choice (though I'd say they'd benefit more from C++, given that Python and Matlab are usually learned incidentally, while C++ can give a valuable edge if you need something optimized.)

However, for someone who intends to take the full gamut of CS coursework, assembly seems like the ideal place to start. No, it won't foster their interest. But it will give them the most solid grounding in what real programming is, and when they reach C++, its boilerplate will seem like it grants endless freedom by comparison.

Re:Python then C/C++ (1)

Turiko (1259966) | about 5 years ago | (#28818765)

too bad most schools learn VB because of MS's power to persuave schools with cost reduction... I'm one of those people that is screwed up for life i guess.

Re:Python then C/C++ (1)

FishWithAHammer (957772) | about 5 years ago | (#28818815)

You're an idiot. The majority of schools use Java and C, with some Lisp or Scheme to cover functional programming (generally at the university level).

I'd say they should be using Python and C#, with some Ocaml or F#, but since I dared suggest Microsoft tools (even ones with viable open-source alternatives) I'm going to get bitched at.

Python?? No...! (1)

Joce640k (829181) | about 5 years ago | (#28818813)

I'm pretty sure a 15-year-old isn't going to want to do "scripting", he's much more likely to want to do 3D graphics.

I'd suggest one of the 'game programming' Basics that are out there or even start by doing game mods.

Old School (0)

Anonymous Coward | about 5 years ago | (#28818401)

Turbo Pascal

Assembler! (0)

Anonymous Coward | about 5 years ago | (#28818421)

Does anybody even know what that is anymore? Oh well, it teaches an appreciation of minimalist efficiency, and an appreciation of what's going "under the hood" of other languages. It's also something that you probably won't study unless you make a point of giving it a try.

Re:Assembler! (1)

Jurily (900488) | about 5 years ago | (#28818589)

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:Assembler! (2, Insightful)

Dr.Syshalt (702491) | about 5 years ago | (#28818689)

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 driver should know the inners of a car, how engine/transmission etc. work, otherwise he couldn't drive efficiently - a good programmer should know all the chain, from Java/Python/Scheme/Whatever down to the machine code.

no right answer. (1)

nathan.fulton (1160807) | about 5 years ago | (#28818425)

I think that -- like any other question in pedagogy -- there is no right answer that applies to everyone. But I still find the reasoning in this article absurd.

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++ (1)

buddyglass (925859) | about 5 years ago | (#28818427)

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 way that learning a "educational" language isn't. I want to learn something people are actually using. Note that I'm not suggesting C++ is the easiest language to learn or master for new programmer. However, actually doing so might be more rewarding, from a "concepts learned" perspective, compared to the alternatives.

Re:how about c++ (1)

ironicsky (569792) | about 5 years ago | (#28818465)

I agree...
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.

Re:how about c++ (0)

Anonymous Coward | about 5 years ago | (#28818619)

I couldn't find the article, but remember how a couple years ago a CS professor at U of Maryland was saying Java is ruining programmers :-)

I think the worst thing you can do is start out with OO. I see it all the time, programmers who only know OO and write very bloated programs because they can't streamline their code. I don't want to turn this into procedural vs OO programing, but a good programmer can do both and knows when to use the appropriate methodology.

As far as the best language to start with, Perl or Python to get the basics down and then good old fashion C.

Re:how about c++ (1)

moon3 (1530265) | about 5 years ago | (#28818709)

C/C++ is for the pros, for hobbyist it is probably better to stick with Visual Basic, C#, Java, Ruby, Perl, Python, PHP, Automator etc.

Scheme is the best teaching language (5, Insightful)

Gorobei (127755) | about 5 years ago | (#28818429)

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.

It's a balance (1)

ComputerDruid (1499317) | about 5 years ago | (#28818431)

This is very similar to some of the strongly typed versus weakly typed language debates that seem to happen all the time. Should ease of use and fun programming come before or after learning about what's going on?

As a fan of both python and C/C++, I believe there needs to be a balance. When teaching a language to students new to CS, you have to gloss over some of the details in order to give them a basic understanding and excitement about what is going on.

My guess is that languages like scheme may inhibit this initial step, so that it is hard for students to catch on.

Python and Pygame (2, Interesting)

pcraven (191172) | about 5 years ago | (#28818441)

For a 15 year old? Python with the Pygame toolkit. There are other toolkits besides Pygame, but that one works well.

Re:Python and Pygame (1)

Norsefire (1494323) | about 5 years ago | (#28818489)

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.

Re:Python and Pygame (1)

maxume (22995) | about 5 years ago | (#28818587)

What's the difference between learning how to draw to an abstract pygame canvas versus whatever abstraction the system provides for drawing?

Re:Python and Pygame (0)

Anonymous Coward | about 5 years ago | (#28818621)

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.

You recommend making a 15 year old who has never programed before interface directly with the low-level OS APIs?

Why stop there, why not make them re-write the graphics card driver in assembler before they are allowed to see anything on the screen? If they don't manage this they are clearly too stupid or lazy to be allowed to program computers. As we all know, REAL programers would write the driver directly in machine code in RAM using an electron microscope, but we'll cut these new programmers a little slack because they are young.

Re:Python and Pygame (1)

Norsefire (1494323) | about 5 years ago | (#28818643)

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.

Re:Python and Pygame (1)

imbaczek (690596) | about 5 years ago | (#28818625)

so you suggest kids should be writing their own pygame versions? somehow i don't believe they'll learn anything.

Re:Python and Pygame (2, Informative)

Eudial (590661) | about 5 years ago | (#28818649)

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:Python and Pygame (2, Insightful)

Norsefire (1494323) | about 5 years ago | (#28818773)

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.

Only one answer (0)

Anonymous Coward | about 5 years ago | (#28818447)

LOGO

(At least) two distinct objectives... (4, Insightful)

fuzzyfuzzyfungus (1223518) | about 5 years ago | (#28818449)

It seems like TFS is dealing with the fact that there are at least two distinct, and at times temporarily opposed, aspects of being educationally good.

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.

The best first language doesn't exist (2)

BadAnalogyGuy (945258) | about 5 years ago | (#28818459)

You have several tradeoffs and considerations when it comes to learning programming.

Do you want to get on your feet right away? Maybe BASIC, VB, or Pascal is the best choice.
Do you want to really learn about the computer? Probably ASM, but C may be a useful alternative.
Do you want to learn about different ways to think about programming? By all means, stick with LISP and its children.

There is no best language to learn programming. It all depends on what you want to really learn.

I find the insistence on sticking with Scheme to be a bit naive. These days we are either dealing with systems with tons of memory which makes using languages like Java much more productive than Scheme. And on the other end of the spectrum, we are dealing with small devices with limited stack space which simply couldn't handle the amount of recursion that Scheme requires. It's an interesting teaching language like Pascal used to be. But technology has left it behind as a viable implementation language for any real world software.

"Not engineering"? (1)

John Hasler (414242) | about 5 years ago | (#28818467)

> 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:"Not engineering"? (0)

Anonymous Coward | about 5 years ago | (#28818549)

Computer Science majors never learn what an engineering discipline is, so they tend to assume the application of a science to product development isn't engineering. It is.

Re:"Not engineering"? (1)

moon3 (1530265) | about 5 years ago | (#28818629)

Chinese iFone is engineering, Apple iPhone is craftsmanship.

Alice (1)

Hiro2k (264020) | about 5 years ago | (#28818485)

http://www.alice.org/ [alice.org]

I've seen a few places that teach students alice in order for them to become familiar with looping and conditional constructs before they move to something else. I think with all the visual stuff going on it would appeal more to younger programmers.

Re:Alice (1)

BadAnalogyGuy (945258) | about 5 years ago | (#28818579)

I think the problem with this is that it doesn't dispel the "magicness" of programming. It creates a reliance on visual tools that perform the magic behind the scenes.

Compare Visual Studio 6 to Visual Studio 2005. The newer version hides so many features from the user and performs so many little things that it creates a total dependence on the IDE to do anything. From the creation of a project to the compilation settings, the IDE controls it all in VS2005. In the older version, everything was more or less a wrapper around command line tools. Once you could see through the tools, everything about VS6 was very clear and straightforward.

A programmer learning on VS6 would understand what they were doing much better than one who learned on VS2005. Though the latter may be more productive due to the crutches of the IDE, the lack of deep understanding means that he is also less flexible when the environment changes.

So a programming language like Alice seems to be the antithesis of what a learning environment should be. It may be amazing and fun to use, but the student is not brought close enough to see the innards working, and thus I don't think they can actually learn very much from it. IMO.

Assembly (5, Interesting)

MpVpRb (1423381) | about 5 years ago | (#28818497)

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 (0, Offtopic)

Lallander (968402) | about 5 years ago | (#28818525)

I have no points but could someone please mod this guy up? ^^^^

Re:Assembly (0, Insightful)

Anonymous Coward | about 5 years ago | (#28818595)

Starting with assembly language? You're a fucking moron.

Re:Assembly (0)

Anonymous Coward | about 5 years ago | (#28818679)

Really? And why is that? I'm guessing you've never done Assembly.

Re:Assembly (1)

Smidge207 (1278042) | about 5 years ago | (#28818597)

Then learn COBOL, it bends everything to its will.

Re:Assembly (1)

SirLurksAlot (1169039) | about 5 years ago | (#28818753)

That is essentially the order that I picked up my repertoire, but I'd also add in COBOL (to learn to respect your elders), some kind of .NET language (because in a business environment you're bound to run into it), and PHP/Perl. I have to disagree with your assessment of Java being the ruler of the web; in the enterprise web, maybe. Smaller than enterprise (which the vast majority of sites are) I'd have to say PHP and PERL, with Ruby gunning hard for the position now.

Hacketyhack (0)

Anonymous Coward | about 5 years ago | (#28818499)

http://hacketyhack.net/

Designed to introduce kids to programming using the ruby language, currently being transformed but should be back soon.

Ocaml, definitely! (0)

Anonymous Coward | about 5 years ago | (#28818501)

Ocaml has an imperative part which is as simple as pascal, but without types, which are inferred. The people I know that started with ocaml in experimental university courses have a mental attitude to clean programming that I've not seen elsewhere.

noop nope (1)

mindbrane (1548037) | about 5 years ago | (#28818505)

Admittedly I'm a noop but I've put in 20yrs on PCs and studied most of the structure of PC operating systems and most of the key languages. While I still think BlueJ is an outstanding introduction to the concepts of programming I believe learning the CLI is the best introduction to progamming because it forces the student to interact with the OS while introducing the basic statements of all programming languages. Programming languages tend to either be to low level and demanding an abstruse use of logic or high level while trying to explain how to implement abstruse rules of logic in a way said to be more tractable to 'common sense'. But the CLI uses nearly all the basic concepts and interacts directly with the OS and acts on files. It instructs in the fundamentals of programming languages while adding the benefit of displaying how an OS is structured and functions. I'm probably way off on this but it worked for me, remember I'm a noop, unworthy of being flamed and deserving of at best contemptuous neglect. :)

From an HCI perspective (3, Informative)

williamhb (758070) | about 5 years ago | (#28818511)

In my opinion, two issues compound each other. The first is that because functional programming is seen as very pure and simple, there is a myth that Scheme programs do not need much documentation. The second is that Scheme functions do not declare return or argument types. This means that in order to read someone else's code, if structures of any complexity are used, you can have to manually walk the full call depth of each function, possibly many calls deep, just to know what kind of structure it returns in the end. That makes it painful to work with someone else's code, compounding the other well-known problem with computer science education: in the course, you're usually writing your own code from scrach; in the real world you usually have to deal with code your colleagues (or even third party projects) have written.

take a look at alice.org (4, Interesting)

kulakovich (580584) | about 5 years ago | (#28818519)

http://www.alice.org/index.php?page=what_is_alice/what_is_alice [alice.org]

"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

10 PRINT "HELLO WORLD" (0, Redundant)

Nimey (114278) | about 5 years ago | (#28818521)

20 GOTO 10

Re:10 PRINT "HELLO WORLD" (0)

Anonymous Coward | about 5 years ago | (#28818547)

That was my first program too! I wrote it in 4th grade. The only difference is that the Simpsons had just started their run, so mine said "EAT MY SHORTS."

Re:10 PRINT "HELLO WORLD" (0)

Anonymous Coward | about 5 years ago | (#28818555)

OMG!!! That was my favorite program to type when I would go to computer stores

Re:10 PRINT "HELLO WORLD" (1)

SpinyNorman (33776) | about 5 years ago | (#28818769)

100% agree - nothing better than just jumping in and doing it, getting some immediate feedback, to foster some excitement and interest.

Next you change it to a for loop rather than an infinite loop, and whaddya know, you're programming...

Re:10 PRINT "HELLO WORLD" (1)

SpinyNorman (33776) | about 5 years ago | (#28818817)

It's worth pointing out too what "BASIC" stands for (which corresponds to what it was designed for) - Beginner's All-purpose Symbolic Instruction Code

How many other languages are actually designed for beginners and teaching as opposed to being meant as tools of the trade for professionals?

Re:10 PRINT "HELLO WORLD" (1)

funkatron (912521) | about 5 years ago | (#28818809)

One of my early programs (admittedly in Java) was outputting "Hello world" on port 80 with the correct headers. What's the point in saying hello world to yourself?

Advice from "Epigrams in Programming" (1)

line-bundle (235965) | about 5 years ago | (#28818531)

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" (3, Insightful)

SpinyNorman (33776) | about 5 years ago | (#28818713)

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 (4, Interesting)

proslack (797189) | about 5 years ago | (#28818539)

My first year as a CS major I took "symbolic logic" to supplement to required Pascal, Fortran, and Assembly Language courses. After all that, I always thought of the symbolic logic class as the "Latin of programming". Personally, I think any language which is free and gives quick results would be suitable for beginners...Python, for example.

PHP (3, Interesting)

Phrogman (80473) | about 5 years ago | (#28818541)

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 (1)

Eudial (590661) | about 5 years ago | (#28818693)

Web programming is a bit of a dead end in my book.

It largely hides how fast your program is (which is why so many web applications are inefficient messes) and it's very distant from application programming (which makes inevitable the leap to application programming very large.)

Re:PHP (4, Insightful)

jjohnson (62583) | about 5 years ago | (#28818695)

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:PHP (3, Insightful)

kamatsu (969795) | about 5 years ago | (#28818725)

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 (2, Interesting)

bitemykarma (1515895) | about 5 years ago | (#28818543)

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 BASIC interpreter that actually was running as a batch job on an IBM 360 mainframe.

Start simple? (2, Insightful)

SpinyNorman (33776) | about 5 years ago | (#28818581)

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!

Lisp/Scheme != latin of programming (0)

Anonymous Coward | about 5 years ago | (#28818603)

Considering taxonomy and etymology of most western languages, that is one of the worst analogies I've ever seen. The analogy would imply that, from Lisp, you gain something else, when in fact Lisp itself is built in C and C was built with assembly (at least originally). Lisp couldn't even be the English of the programming world since its neither widely used nor accepted for *most* real world application... I think the best analogy is that Lisp is the Romanian of the programming world... based off of something important but not widely spoken or understood.

Re:Lisp/Scheme != latin of programming (1)

kamatsu (969795) | about 5 years ago | (#28818733)

Er, Lisp was not originally built with C.

Obvious answer (5, Funny)

ceoyoyo (59147) | about 5 years ago | (#28818651)

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 (2)

Teckla (630646) | about 5 years ago | (#28818655)

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. :-)

Logo all the way! (0)

Anonymous Coward | about 5 years ago | (#28818657)

FD 50
RIGHT 90
FD 50
RIGHT 90
FD 50
RIGHT 90
FD 50

There are a number of good and free logo interpreters around. I like FMSLogo (http://fmslogo.sourceforge.net/)

Quit knocking the hacker ethic... (5, Insightful)

tjstork (137384) | about 5 years ago | (#28818667)

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.

Teach him C (2, Interesting)

jrothwell97 (968062) | about 5 years ago | (#28818669)

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.

Now for a different approach... (1)

Samuel Dravis (964810) | about 5 years ago | (#28818677)

Instead of lots of /opinions/ on the matter, how about someone do a study to find out which language actually does turn out the highest quality programmer. That's the only way this question will ever get settled.

anything ... (1)

petes_PoV (912422) | about 5 years ago | (#28818685)

... that doesn't need an IDE, require objects or lots of definitions and has a printable form will do fine.

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 lost.

scratch (1)

JavaTHut (9877) | about 5 years ago | (#28818687)

http://scratch.mit.edu [mit.edu] designed explicitly for this

It's the book, not the language! (1)

TrollHammer (1604811) | about 5 years ago | (#28818691)

There is no good answer, I am afraid. It depends a lot on the combination of language plus books plus your "teacher" (if there is anyone teaching you). The language is only one part of the learning process, and not the most importante one, IMHO.

I think that the reason for Scheme [wikipedia.org] plus SICP to be quite popular in the States' universities is that SICP is such a good book. For instance, in Spain, the most popular "learning languages" are C/C++/Java and Pascal. (the first language I was taught was Modula2 [wikipedia.org] ); however, the books that are used in the Spanish universities are horrific. Does that mean than Scheme is a better language for learning how to program? No, it only means that the sources for in Spanish for learning how to program with C or Pascal are much worse.

At the end of the day, the combination of teacher plus book is much more important than the language itself.

Objective-C of course (1)

dingen (958134) | about 5 years ago | (#28818717)

So he can program stuff for his iPhone and impress his friends. Impressing your friends is (in my opinion) the best motivator for learning something difficult.

JavaScript/HTML (3, Interesting)

KrackerJax (83403) | about 5 years ago | (#28818721)

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.

There can be only one (2, Funny)

rolando2424 (1096299) | about 5 years ago | (#28818727)

COBOL

Re:There can be only one (0)

Anonymous Coward | about 5 years ago | (#28818803)

COBOL and System/370 JCL. And use two hands to carry that box of punch cards to the computing center!

Learn two concurrently (1)

The Solitaire (1119147) | about 5 years ago | (#28818755)

Having been in the situation of starting to program when I was about 15, I can say that there is almost certainly no 'perfect' language to start aspiring programmers off on. Indeed, I'm still kicking some of the bad habits I learnt from my first language (PHP), and I now do this professionally.

I'd say the best option is probably to try and learn/teach two languages side-by-side - preferably two that have completely different approaches to programming. The first should be something that allows one to easily learn the fundamental Computer-Science stuff - functions, lists, trees and recursion - and languages like Lisp, Scheme or Haskell - by their nature - lend themselves well, although C can also serve at a pinch.
The second should be some sort of practical/pragmatic programming language, that one can learn how actual everyday programming works in. I'd honestly stay away from Java or C for this - C is scary for actually *doing* stuff when you first start to program, and Java is overly complex. Run with something like Ruby or Python, which give you a good grounding in Object Orientation, and allow a newbie to actually accomplish something. You could also use PHP if the kid's into the Web, as a lot are these days (though make sure you still teach them the OO way of doing things, as opposed to purely procedural.

Once you've got those down, you can happily jump into languages like C/C++ and Java, and start making more than just the toys that all newbies make.

BASIC, Python, C (1)

Zobeid (314469) | about 5 years ago | (#28818781)

I had to laugh at the suggestion of Scheme. . . It's absurd for a whole long list of reasons. But then, I've never been a fan of the ivory tower "comp sci" approach to programming. Furthermore, scheme is NOT the "Latin" of computer languages. That distinction should go to C. (Then Objective C, C++, C#, Java, Vala and the rest of their ilk are the Romance Languages.)

A beginner's language shouldn't be too funky. Scheme is a list-processing language (a variant of LISP, in fact) which makes it fundamentally different from almost every other programming language that you're ever going to use for any practical purpose. As another example, I'd rule out Forth for similar reasons. A beginner should learn a procedural language, which means something from the (very large) family of BASIC/Pascal/C and their many descendents, et cetera.

A beginners language ought to have an editor and IDE that's easy to learn -- preferably buit-in, or installed with the language. Trying to learn with a generic text editor and a command line sucks. An easy API to do some interesting things with (more interesting than outputting ASCII text) is also a big plus. It shouldn't be GUI-oriented, though. That's just a big can of worms that a beginner doesn't need to open up yet.

A beginner's language shouldn't be OOP -- or at least, shouldn't push OOP in the programmer's face, the way Java does. If the OOP features are sort of hidden and won't bother anybody who doesn't want to mess with them, that's OK. But I can't state this strongly enough -- you shouldn't have to grasp the whole OOP concept (which doesn't come easily to many people) in order to start learning to program. It can and should come later. (Structured programming, on the other hand, should be there from day one.)

Despite all the hating on BASIC, it used to be pretty good at what it was designed for -- introducing beginners to programming. I'm excluding the early "sphaghetti code" versions of BASIC here, and I'm also sort of reluctantly excuding the newer GUI-OOP oriented versions of BASIC. BASIC has mutated a bit too much from its original mission.

However, I have very fond memories of GFA Basic on the old Atari ST -- it offered structured flow control (no line numbers) almost like Pascal, as well as a very friendly editor/IDE and inbuilt API -- but no OOP features. It met every one of the criteria that I outlined above, and it was great for learning. It was also a great stepping-stone to C, which was the next logical step in those days. It's just too bad, I don't see anything much like GFA Basic out there today.

I might suggest (as the author of TFA did) Python as the closest counterpart today. It's designed to be easy to learn (like BASIC was), it has OOP features but you can ignore them, and it appears that some pretty good IDEs and APIs (non-GUI!) are available for beginners to play around with. It's a bit of nuisance that you have to locate and install Python, then locate and install your IDE, then locate and install your chosen API. . . And the APIs like SDL and Pygame are more complicated to learn, I think, than doing graphics in GFA Basic ever was. . . But from what I can see, it's just about the closest modern equivalent.

Basic is easy, but C is awesome... (0)

Anonymous Coward | about 5 years ago | (#28818783)

I started with QuickBasic in middleschool, and in highschool I did VB, Pascal, Python, Java, and even some Touring. But it wasn't till I did C in College that a lot of the major concepts sunk in. I really believe C is a great place to start after that experience.

Depends (0)

Anonymous Coward | about 5 years ago | (#28818787)

If your goal is to get them going, then a very high level language is a good choice, but if you want them to understand how computers work and how high level languages do the magic then assembly is the best starting point. After all, it's what computers execute, even when the programmer writes LISP, Javascript or C code. It is a steep learning curve and a virtual processor is an advisable learning environment to keep the frustration level acceptable, but once you know what the processor does, high level language concepts are much easier to understand.

You might as well just... (0)

Anonymous Coward | about 5 years ago | (#28818789)

Download Game Maker 7. :D

Comparisons of languages for CS-1 courses (1)

david.emery (127135) | about 5 years ago | (#28818805)

John McCormick (http://www.cs.uni.edu/~mccormic/) has published several papers comparing Ada to other languages and documenting his successes using Ada in undergraduate programming classes. So there are some published studies, and McCormick's results are pretty impressive for first-year programming classes.

Some of the advantages include: * unforgiving syntax - preventing confusions like "=" and "=="; * compile-time type checking; * easy to bring in support components ("packages" in Ada) to provide complex operations (such as I/O formatting) that otherwise would get in the way of the problem at hand; * a concurrency model that is easy to reason about (OK, maybe not for a beginner programmer, but still a huge advantage as we look at a multi-core future...); * a pretty large collection of reusable components; * an integrated exception handling model, so behavior when a runtime problem is detected is a lot easier to understand (particularly with stack traces).

Java has some of these same benefits, particularly the ability to bring in existing packages, but Java is handicapped by its C syntax which makes it easy for beginners to make mistakes, and the type model (particularly weakly-typed scalars) doesn't provide as much compile-time diagnosis.

A big part of Ada's success is the amount of things that the compiler can check for you. It's a lot easier to find and work off compiler errors (even more so when the compiler provides good error messages) than it is to try to debug a program at runtime.

dave

p.s. I really believe learning to read code, and having a language that is easy to read, is really important. I learned more about programming by reading, taking apart and modifying the old "Star Trek" BASIC program (in the mid 70s) than I did in my introductory programming classes.

Python (1)

DoctorPepper (92269) | about 5 years ago | (#28818811)

One of my friends asked me to help his younger brother become acquainted with programming, so I downloaded several "free" language installers (all for Windows), their documentation (as available) and tutorials, burned them all onto a CD and gave it to him. I advised him to install all of them (Python, Perl, Ruby, Java), and play around for a while to see which one(s) interested him the most.

After a few weeks of playing around, reading the tutorials and such, he decided that Python was the language he felt the most comfortable with, and I then bought him the "Learning Python" O'Reilly book, to help him get more of the nuances of the language. I was also available to help him with any questions he might have had, during this learning phase.

Fast forward a couple of years. Said younger brother has now graduated from high school, is going to college part-time, working on a Computer Science degree, and has a full-time job with a software company in the area. He works mainly in Python and Objective-C (for iPhone and iPod Touch development), but is also learning Java, so he can work with the Android SDK.

Is Python the best language to learn programming with? I can't answer that, but I can say it worked wonders in this instance.

Give them something fun to do (1)

lawpoop (604919) | about 5 years ago | (#28818819)

Don't sorry about "ruining" them with a "bad" programming language. If they stick with it at all, they are going to develop all kinds of crazy ideas and bad habits, which they will discard, one by one, if they go on to become good programmers.

Face it, even if you give them the best language and environment possible, most kids are going to get bored with programming, just like piano lessons, karate class, painting, etc. Programming seems cool, and they know it powers video games, but they really *don't* care about variables and functions and scope and types and classes -- and they won't unless they actually decide they want to become programmers.

Give them something fun and rewarding, where they get to play Stairway early on. RealBasic seems to be a good compromise of power, ease of use, user-friendliness, etc. If they want to stick with it, then they will be motivated themselves to learn LISP, python, c, to understand the concepts *behind* what makes the video games work.

Scheme to first year CS students (3, Insightful)

Omnifarious (11933) | about 5 years ago | (#28818821)

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. :-)

C# (1)

rfernand79 (643913) | about 5 years ago | (#28818831)

C# is a modern, multi-paradigm, feature-rich and evolving language. It can be most intriguing for a young programmer because you can play at various levels of abstraction (from unsafe all the way up to LINQ) and express computation in various ways (you may do a Lambda expression for one thing and a method for another). And you can use it as a scripting language, as well. Young programmers running Windows can always get Visual Studio for free via DreamSpark. Young programmers running anything else can get MonoDevelop. There really is no excuse to skip this incredibly productive language. The plus side? migrating from C# to other paradigms should be simple. And the C# user community is just as friendly as any other free language's (minus the "RTFM, N00b!" replies.)

All of them (1)

nexttech (1289308) | about 5 years ago | (#28818837)

Start with a simple language to learn the basics (Loops, variables ect.) Then let them explore. If they are truly interested in programming a new programmer will move to what interests them. I started with Basic went through the academics of Pascal. But I truly learned the most when I taught myself Forth and Smalltalk. Anyone interested in programming will find their own way.
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...