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.'"
Assembler (Score:3, Interesting)
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.
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
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
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.
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 BASIC interpreter that actually was running as a batch job on an IBM 360 mainframe.
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.
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:Python?? No...! (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.
For a 15yo?!?!?! (Score:2, Interesting)
Is it me, or is it a silly debate... My first language was some FORTAN and COBOL when I was 10 which quickly progressed to BASIC when I was 11. By the time I was 12 I had LOGO under my belt and the teacher had me teaching the Computer Science labs at School.
By the time your 15, you are past your prime and you might as well pack it in.
"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'.
Re:Alice (Score:2, Interesting)
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.
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.
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.
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:Pascal (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:Python then C/C++ (Score:1, Interesting)
While I agree that at some point, programming is learning to ignore the fluff, it's funny when people dismiss Scheme as the Latin of programming, and then promote Python with argumentation like the above. Python is essentially Scheme with a bunch of fluff (punctuation and OOPiness) added on.
The only conclusion I can draw is that quite a lot of people are unable to function without a dense scaffold of fluff. I much preferred my days working with Scheme because the bare, abstract syntax tree of what I was trying to accomplish was right there staring me in the face. You can make just as many elegant expressions of application abstraction through the use of well-factored procedures and data structures, and equally just as many inelegant hack jobs that are "write only" as the summary accuses. There is nothing about the language which causes this, but rather with the cult of language communities and their teaching habits.
Here's the difference between Python and Scheme in a nutshell, when learning functional programming on generic data structures: "(assoc 'key1 '((key3 a) (key1 b) (key2 c)...))" becomes { "key3" : "a" , "key1" : "b" , "key2" : "c" , ... }["key1"] and both evaluate to "b". Apologies if I haven't used the exact proper Python primitive types for the keywords and values, as all I've learned of Python was from some silly mailing lists.
The Python folks abuse "hash maps" wherever traditional Lisp people abused "association lists". If you have concerns about performance, you could use a hashmap library in Scheme and it would look something like this to apply appropriate idioms and basic types: (hashmap-lookup 'key1 (hashmap '((key3 a) (key1 b) (key2 c)...))).
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:JavaScript/HTML (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 powerful manner than many traditional c-type languages. I'm constantly amazed at how little traditional programmers "get" the power and concepts of Javascript's object-oriented programming, and is a good reason it should stand on its own as a good language to learn on. Flash's ActionScript is very similar, so the transition in that direction would be easy, while the move to more traditional languages could also be made once basic concepts are understood.
I learned programming from Basic on an old C-64 -- by all means a terrible language compared to the standards of C, with many limitations and which can create some bad dependencies -- but it certainly inspired me enough to continue and learn other languages (turing/pascal/C and on) as my programming whims required more functional toolsets.
In a way, I see Javascript as the accessible language of today as Basic was back then, only far more powerful. With that as a starting point, any bright, driven programmer should be able to progress down the line to more raw languages as their interest takes them.
Re:Quit knocking the hacker ethic... (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 "little money", or at least what you consider little money, while men in 3 pc suits, according to your skewed perception, seem to do nothing and make loads and take nice long vacations. When in fact, in alot of CS cases, they have to clean up the confusing messes that many programmers create and make the pallatable for the 99% rest of the population who have to deal with user interfaces designed with some fucked up logic.
The fact is, it has nothing to do with socialism or some society pecking order, or some conspiracy, or being able to do your boss's job. Its your shit attitude and likely awkward personality. You don't think anything is wrong with you, but your boss and his boss and others see you that way, just like I see it in my folks. I assure you that while we manage them, they will never move up from their position until they change, and its likely never, because the problem never lies with them, even as people come in below them and move up past them year after year. Its stupid company policy or my boss is a chimp, or blah blah blah, save it, we don't care. Go get another job if you don't like it.
The other fact is that no matter how clear we make ourselves when we want something built, unless we tell some of our programmers every single fuckin error that is out there, some just dont do it themselves. It is frustrating, and they take the human element out of every program. When programs are written so that even MBAs/PhDs with CS degrees are confused by the logic and user functions of a simple program, that says alot. Instead of putting in error messages with error numbers and creating awkward user interfaces, consider the dumbest person using the software, put yourself in their shoes, and design the thing. Until then, programmers like that will never get respect, deserved or not.
Ok.
Re:Quit knocking the hacker ethic... (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 engineers and turning them into process drones.
GM suffers from disfunctional management, poor marketing (that did nothing to turn-around public opinion on American car quality), and labor relations. Engineering wasn't the problem. (Now design-- that was a problem. Any company that could think something like the Aztek was worth buiding has big, big design problems.)
Great things are built by individuals and the more steps you have in the way of people being individuals, the worse you will get.
Bullshit. All great films, for example, are collaborations. All great buildings are collaborations. All great legislation are collaborations.
The software industry has had a couple instances where a single person has built a great product... the only one I can think of off the top of my head is Napster. But that is the exception, and not the rule.
That said you're kind of on the right track here. The role of a *good* MBA-type is to keep the everyday distractions away from the developers/engineers/whoever so they can get on with their work. That's one of the reasons Microsoft has been so successful. (Another is something else you imply: Microsoft developers *own* the features they are assigned.)
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.
Wow. Tell us how you really feel.
I'd assume the more geeky a person, the *more* bean counting and measuring they'd want, since it removes a lot of the guesswork currently done in business. (Especially in certain industries, like marketing.) Without the measurement part, how do you know your code answers the need? How do you know it's easy to use? (Of course, considering your general attitude, I'm sure you don't give a shit how easy-to-use it is.) How do you know bugs are getting addressed in a timely manner?
Without a project manager, how do you get a project of any decent size done? Do you think Microsoft could have built, say, MS SQL without a single project manager? How would that have even worked?
Also: Where do you work? Do you get promoted, with this attitude of yours? Or have you been stuck in a basement for a dozen years, writing barely-maintainable hard-to-use code at the same payscale you were at when you were hired?
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 hands, and my mind, and I do not want what you have and I don't need you.
Its your shit attitude and likely awkward personality.
Stop.
Careerwise, I have no desire to move up any "ladder" at all. With the internet, who really needs a ladder. If I can write a program that sells or a web site that gets hits,
while men in 3 pc suits, according to your skewed perception, seem to do nothing and make loads and take nice long vacation
First off, I have no problem with the guy in the three piece suit that can actually sell a product or a project. Those people are worth their weight in gold, and they deserve every cent. I mean, take a look at Alan Mullaly. This guy was the CEO of Boeing and his job was to walk into a room, press the flesh, wine and dine do whatever it took to convince some other guys to write him a check for billions of dollars for his jet aircraft, over someone elses. Now he is going around to dealers all over the country trying to convince people to buy his cars over everyone else's. Who care if the guy gets paid 50M a year or even a 100M a year when he is one of the handful of people on the planet that can turnaround and sell hundreds of billions of dollars worth of stuff. That's chump change to pay the guy, and there's not that many like him that he is replacable.
But most MBAs can't sell. So.. the whole supposed gift of customer communication that they have is really so much of a distortion. Either you can bring home the contracts, or, you aren't any better at communicating than the developers who work for you, no matter what you wear.
My advice to you would be to always tell the truth, because I don't think people like you do.
By telling the truth, I mean that, in your communications, you convey an accurate impression of a situation to the stakeholders. Spin is lying. Leaving out something, is lying. Communicating one motivation that makes logical sense while pursuing another is lying.
Like, I just had one guy go and explain to the client in an awfully written email just how much work they did in this little area, very self promotional, but left out the very material fact that all of that work was rather a small and unimportant part of a much larger problem that they had not solved... which I did.
consider the dumbest person using the software, put yourself in their shoes, and design the thing
Stop.
The fact of the matter is, most managers do not care about user interfaces or the users at all. Most people like you see projects and consumers as stepping stones, a mountain of people to be walked up as you go up the ladder. Are there programmers that do not care about user interface? Sure, probably are. But, there's as many managers that drive shortcuts, sweep problems under the table, misrepresent the success of a particular user interface design, hide obvious usability problems, and so on, and then turn around and blame the customer.
But again my long term success is based on myself. If I can write something on the internet that people are interested in purchasing, or reading sufficiently, then that's great and I can achieve an independent life. But if not then, I can still contentedly work on as a senior developer knowing that, I gave life my best shot trying to achieve what I wanted to achieve, and maybe I just wasn't good enough. It's the opportunity that I've been given by God and Country that I'm grateful for, and I don't need or expect anything more.
Comment removed (Score:3, Interesting)
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: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 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 say is not suitable for beginners.
The choices are, essentially:
* BASIC. If you'll forgive the pun, basic, but not actually useless. VB.NET is a useful language that you can pick up with relative ease, and it's reasonably easy to transition to C# later because they share the same standard library. BASIC has been widely criticised for not teaching structured programming techniques and leading to a variety of brain damage, but it isn't clear how well these criticisms apply to modern, structured, object-oriented BASIC implementations.
* Pascal / Object Pascal. Originally designed to teach structured programming techniques. Object Pascal (or, more precisely, "Pascal with Objects" as implemented by Borland in the early 90s) was a breakthrough language for me. Stuff I'd failed to grasp with C++ became much more obvious with the simpler implementation in Pascal. I'd say still useful pedagogically, even if the available systems (i.e. Delphi and a few open-source reimplementations thereof) are a little outdated.
* Smalltalk. An early object-oriented language, whose main developer was highly interested in the possibility of teaching children to program. A lot of people are put off smalltalk by its differences from most other languages (primarily that code is entered in an interactive environment, rather than written in a text editor and then compiled/executed) and strange syntax (although nothing like as strange as LISP). IMO, Smalltalk is the LISP of the object-oriented world and well worth looking at as a first language.
Some other contenders weren't designed or developed as pedagogical languages, but are worth considering anyway:
* Java. As somebody pointed out above, the downside of Java is the high overhead of boilerplate code that's required to do anything. The advantage is that you won't be constrained in what you can achieve by the environment... Java is pretty-much open ended, and almost everything you need to learn can be learned in it.
* Javascript. Don't laugh. Javascript is quite a good language, with support for a lot of neat stuff like closures, and it provides an interesting environment for a beginner to work in.
* Python. Interactive interpreter is a plus. Total lack of programming overhead is also a plus. Significant whitespace is a minus for a beginning programmer, as the tab/space confusion problem can be quite tricky for somebody who doesn't understand it at a low level to manage.
Agreed, 110%, on concepts before language specific (Score:1, Interesting)
"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 ?" - by morcego (260031) on Saturday July 25, @01:59PM (#28820139) Homepage
Agreed, 110%, & I am SURPRISED that your post have not been "modded up" to +5 actually (&, IF I could dispense mod points (can't, as I post as "A/C" here), I would mod you up) for its excellent points!
(Data Structures is the BEST coursework for what you describe imo... & I have gone thru each language tool you noted in academia, & later on the job also - languages don't REALLY matter, they're just syntax - CONCEPTS, however, DO (& the most)... so, I cannot say enough in agreement with you here on that note in particular)
----
"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." - by morcego (260031) on Saturday July 25, @01:59PM (#28820139) Homepage
You "hit the nail right on the head" perfectly here too... &, we sound like we followed the same pattern, because like yourself? I am around the mark you state in terms of languages used over time both academically & professionally - you had good teachers too, because they did make you see the correct way to go about any of this - CONCEPTUALLY!
APK
P.S.=> Good post, mod parent up +5 people... he has it completely right! apk