Best Language for Beginner Programmers?
jahardman asks: "I work at a High School that has recently seen a decline in the number of students that want to take our entry level-programming course in Visual Basic. We have been toying with the idea of having the introduction course be in PHP or Ruby on Rails; but are not convinced that they lead well into higher level languages. Does anyone out there have suggestions as to what would be a better language to start students with? Ideally one that might be more 'enticing' as well?"
You could try them out on RealBasic: http://www.realbasic.com/
It's a lot like Visual Basic, except:
1) Portable to MacOS and Linux
2) Easier to just jump in and write apps with
3) Produces apps with no DLL dependencies.
Give it a try, you might find it meets your needs.
Comment of the year
Java might be a good idea. Lots of tools available for free, and isn't domain specific like PHP.
If I'm remembering correctly, Python came out of a language designed for teaching. The very syntax encourages some good programming principles (indentation, etc.), and it's object-oriented. It's a very common language to find on shared web hosting plans. Also, Ruby on Rails isn't a language - it's a framework. The language is Ruby. Ruby would also probably be a good language for students to learn, though it seems less popular right now than Python.
PHP as a _language_ is probably not a great idea, but used in conjunction with web development, it would be great, but don't forget MySQL and/or PostgreSQL. And Perl, though that should come later; students need to learn programming with something with decent syntax before being exposed to something like Perl.
IMO, anyway.
I've been recommending (and teaching) c++ for several years now. Pascal was great, even Java has its good points. The main thing is whatever language is being used to introduce programming use it as an example language for the programming concepts which are being taught.
I don't know about Ruby on Rails, but I strongly agree with you about PHP and VB. I think they both lead poorly to working in other languages.
I would recommend Python, because I'm more familiar with it than Ruby. It has a clear, elegant syntax, and many concepts in it exist in other languages as well.
But, Ruby may be perfectly adequate as well. I know that most concepts that exist in Python that aren't particularly language specific have counterparts in Ruby.
I used to recommend assembly, then scheme, just so all the people who entered thinking they were programmer hotshots because they knew BASIC, VB or C or something would find themselves in deep water and having to learn something new.
But I suspect that's a bit overly hostile. Depends on the environment of course. Still might be a good idea for people going to a hard-to-get-into technical school to knock them down a peg or two and convince them that there's stuff they don't know.
Need a Python, C++, Unix, Linux develop
Python (through the use of forced whitespace) forces them to learn to write more readable code (I remember taking C++ in high-school, the stuff people wrote would make your eyes bleed). The language has everything your students might need for intro programming (for loops, functions, etc). If they want to continue on will Python later (or you want to offer advanced classes later) it has bindings for all sorts of stuff (XML, OpenGL, QT, GTK, and many many other things). It also has all sorts of handy stuff like an interactive interpreter, a "for each" loop, and more. It's object oriented too.
Look into Python. It's easy to use and would make a great stepping stone if they want to later use a language like C/C++/Java. Or (as I said) Python is great in and of its self and they can stick with it.
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
In school kids have objectives that are more short term. Graduating, having fun and being creative are common examples of that. As educators you have more long term objectives for the kids. Preparing them for college or the professional world being prime examples of that. The answer to your question is somewhere in the middle.
If I wanted to interest kids in programming and teach them something useful I would try something like a course in Unreal Tournament editing or some other game that has a well defined scripting language. Yes it is a game but the scripting language is very C like in nature. And let's be honest you should really be focusing on teaching them how to analyze, break down and solve problems progamatically regardless of the language. Teach them that and then let them decide if it is something they want to pursue.
Another great aspect of teaching a course this way is that it shows them both the difficulty and the rewards of programming. It is not easy to create good levels in these games. They have to learn to handle various types of media as well as programming the main logic. As a great bonus they end up with something they all can play with in the end.
Any how, this kind of idea is not for a conservative environment and if you are in that situation then teach them Java and emphasize object oriented development. If your environment is a bit more progressive then I would look at the gaming route.
Q: I am short, useless and provide no value. What am I? A: a sig
scripting language holy wars aside, python WILL teach good programming style, it's clean, easy to learn, multiplatform, and if you want a good real world example of why it's useful --- well, bittorrent comes to mind.
filter: +3. Hey, look! all the trolls went away!
It was designed as an introduction to structured programming.
Python wasn't designed as an educational language. Guido explains its origins in the FAQ.
there's more than one way to do me.
Java is easy to learn, gets programs that do real stuff going rather quickly, and is runable on any platorm, and is enterprise level.
Give DrScheme a look. Nice graphical IDE, libraries, dead simple syntax. Free. Different language levels to cater to the learning process. And pleanty of introductory texts.
Really! Running programs from Eclipse is dead easy (no Makefiles) as is debugging the stacks (to see the how the clockwork ticking). Very visual, method completion, infopop javadoc, convention enforcing wizards and all (GUI too). Taking up Java with Eclipse is a breeze and Java itself has a nicely documented library for anything you want to play with and explore the basic practices of OOP.
Mi domando chi à il mandante di tutte le cazzate che faccio - Altan
Why not teach them C?
(Oooh, I can't wait to watch the modding for this comment.)
C has a standard (a few, actually, C89 and C99 are probably the most important). Its not a difficult language to learn, its supported on almost every platform out there, and for certain tasks, its the only choice. Plus, there are many good support tools for C (gdb, valgrind, gprof, etc). Finally, many, many libraries are written in C -- C often ends up being the 'glue' code to tie another language to a specific library. And don't forget the many, many projects that already exist in C -- if you want to extend any of those projects, you need to understand the language.
I always thought that assembly is not a bad teaching language either. It helps to understand how a processor works.
I would also recommend lisp, but that has already been covered in this thread.
I've found that python works really well as a beginning language. Python (and many other interpreted languages) let you write fully functional programs with very few programming concepts. It's really easy to introduce one concept at a time, focus on it, and then use that to introduce the next.
You can start small by using the interpreter as a calculator, then move the caculations to a script and executing that. After a while you can gradually introduce variables, comments, functions and modules. After that, you could introduce the standard library and show how to print the contents of a file or download a web page. Or you could introduce the OO concepts of classes, encapsulation, polymorphism and inheritance. It's really up to you and how well your students are going.
Advanced students should also be able to create simple GUI or command line interfaces. Python has a great base class for command line programs that takes away most of the tedious parts. It also has some simple and easy database modules if you want to teach relational databases and SQL as well as programming.
But don't forget that the most important thing to do is to teach them how to teach themselves. Show how to look through the standard library for something new, or how to find and install new modules from the net.
When everyone has become comfortable with the language (and if you have the time) you can introduce a similar language for contrast. I've found that people who have experience with a wider variety of languages tend to be able to "grok" programs a bit easier than those who haven't.
Perl. We don't need any more competition! Perl should just about scare the living daylights out of them.
PHP or Ruby on Rails; but are not convinced that they lead well into higher level languages.
Uhm, PHP and Ruby shouldn't be mentioned together like that. Ruby *is* a higher level language compared to PHP.
But that's not really important to a *beginning* programmer. What you really want to do is first teach the basics, then immediatelly teach about "best practices", like keeping code simple and clean, writing *TESTS*.. unit testing should be taught AS SOON AS POSSIBLE in my opinion. Ruby makes it easy and doing it "test first" (write the test first, then write the code) makes it even easier.
If you want to them to understand the basics of functions and programs teach them Scheme. You can do some cool stuff with DrScheme. Then when they get to Ruby (or PHP) they will see how it's a "downgrade".
But yeah you'd probably be better off with a language that gives them room to grow like Ruby, rather than locking them in the little space that PHP offers.
I remember learning to program in BASIC during my very early years. I hated it. I still hate BASIC, it was crap.
:)
I also remember learning Logo when I started at high school. That little turtle that pottered about on the floor was really cool, and it had all of the concepts that a programming language needs.... loops and conditionals! Having a real-world output from the program was a good way to inspire students to learn it - everyone really enjoyed it.
There are some gizmos now called the MicroMouse or somesuch. It's a little PIC powered rover that is similar to the Turtle. You program it up with a simple dialect of C, and download the code into the PIC. The development environment comes with all the libraries to make things like starting motors and reading switches easy from the C code. That might be a good way to teach the basics without boring students that otherwise don't see a use for it
Those that enjoyed it enough went on to study the more advanced stuff in later years of school.
Of course, my days in Logo were back when the BBC 8-bit micro was new and powerful.
I drink to make other people interesting!
That you find a book first. In fact - find Head First Java" IMHO the best book to teach teens about programming. Next arm yourself with a woman of renown to teach object orientation, namely Alice, she will amase you and your teens. Lastly, once they have the basics down after the new year, get them up and running Code Rally and the winner of the Grand Prix gets extra points towards that grade!!
Sera
Slashdot, where armchair scientists get shouted down and armchair theologians get modded up.
Here's my qualifications for choosing Java, then Assembly:
Java:
- Is not too verbose (Hello World is not daunting)
- Any algorithm can be reasonably implemented
- Any structure can be reasonably represented
- No low-level complications like pointers
- Supports modern programming techniques like functional and O-O
- The student can do real-world things in it
- The student can experiment at home for free
Don't forget assembly!!
- Too many new programmers need to do something low-level, or interoperate with another language, and they have no concept how memory is arranged, what source code compiles down into, or even what a compiler does! They don't comprehend that a string isn't an intrinsic thing the CPU recognizes, and that there are hundreds of ways to store and manipulate them. So when they have to learn about memory-thrashing, multithreading, garbage-collection, optimization, etc. they are lost.
This must be taught this very early on, not as an advanced course, so that when they learn other lagnauges and algorithms they can see where it comes from.
Let me start this post by putting on my flame-proof suit. =)
In order of preference:- C++ - but don't move into the advanced features right off the bat. I like string handling better than C though, so it gets the nod for the top slot. But the user would have to learn the compile process. Templates, STL, and OOP can all be added once you have the basics down.
- C - pretty much on par with C++ in the features you would want to introduce to a beginner.
Ones I'm unsure on:- Pascal: I can't comment on this one, but it's supposedly well-suited for teaching.
Ones I wouldn't touch for intro programming because of syntax.These are all fine languages, but they all have specialized syntaxes, and the bridge between that, and their *next* language would be where you do them a disservice by using these ones.
Other poor choices:Perl, which has a reasonably decent syntax, but because of the TIMTOWTDI philosophy, it's actually, IMHO, an ill-suited introductory programming language.
PHP, while similar syntax to C/C++, has the benefit of not having to learn how to compile apps. It's ultimate downfall is it's scoping rules and lack of namespaces. This is stuff an intro programmer should learn about.
Please, it takes kids YEARS to recover from the damage that learning any flavor of BASIC does!
"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."
-- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
Things (specifically BASIC variants) have improved since Dijkstra wrote that, but an underlying fundamental truth remains.
"Whom the gods would destroy, they first teach BASIC."
-- unknown
I think you will be able to attract students to your course by focusing on what you can do in the course and not on what language you get to use. A course on "Building a Blog", "Programming a Robot", or "Building an Online Store" is much more enticing than PHP or Ruby on Rails. When you watch a home remodeling show, they don't advertise it as the show with the coolest miter saws and wrenches. The show isn't about the tools, it is about the end product, a new deck, or new cabinets in your kitchen.
Since you are teaching new programmers, I will suggest languages and frameworks based on how easy they are to start using as opposed to how good they are in the long run.
PHP has excellent documentation. Although its function names can be inconsistent or duplicated (e.g. sizeof, strlen, count), it is fairly easy to follow the code. This would probably be the easiest well development platform to get started on without evaluating different components, since you really don't need to bother with libraries to do MVC for a beginners course. You definitely will want to set up PHP with "xdebug" so that PHP will provide you with a stack trace for your errors. Otherwise, you will only see the line number where the error occured, which is not very useful if the line number is inside a function that gets called in a hundred different places.
Ruby on Rails is a very large frameworks, and you are just throwing names around to suggest this for an intro course. Ruby, the language, and a basic html templating system might be easy to teach, but Rails involves the MVC pattern, object-relational mapping for database access, and an architecture for unit/functional testing. This is NOT good for beginners. The Rails tutorials will also give you a false impression of how easy it is by having you build a bunch of database driven web pages with very little code. After you finish the tutorial, you will still have a lot to learn.
Although I think Ruby is a more powerful language for an experienced developer than PHP is, it has a lot of syntax rules to learn. For example, curly braces {} could contain a block of code or an associative array, and "joe!" means run the joe! function, and "!joe!" is a boolean NOT operator acting on the return value of joe!
My personal favorite programming language is Python. It has a cleaner syntax than PHP or Ruby, although an amazing amount of new Python programmers are burnt by mismatched indentation between tabs and spaces. Python will treat a tab as the same indentation level as 8 spaces, but your text editor may be using a different value. Even though python tells you the line where the syntax error is, the error may be invisible in your editor. If you are interested in Python for web development, Zope involves learning too much infrastructure for beginners. You would be better off with Spyce.
Instead of making your students build things from scratch, they may feel likethey are accomplishing more by customizing an opensource program that alreadyexists. You can find a bazillion PHP web portal projects at http://freshmeat.net./
Don Box had a simular journal post about which language was best to teach his kids to program. I felt that LOGO was the best choice.
I still feel that way. In fact, to learn to program you really should start with simple text-only (like command line) or path-only (like turtle maps) interface stuff. Anything else requires the ability to think in terms of metaphors that are hard for newbies to grasp. It also helps new programmers learn to program in steps (i.e. design) rather than struggle with the grammar or vocabulary (i.e. one big main function).
It is impossible to enjoy idling thoroughly unless one has plenty of work to do.
- Jerome Klapka Jerome
Python is the perfect first language for learning to program. It has a fast learning curve, teaches good programming practises, introduces powerful programming principles quickly and easily, and is fun for the students, allowing them to do real things, including graphics, games, web programming etc. Ron Stephens Python Learning Foundation
When I learned programming, it was painful to get past the strange things I didn't understand in C, C++ and Java's "Hello World" program.
Header files, main(), etc. It was intimidating to me, and I am far from the most intimidated by new concepts person I can imaging.
The reason I like PHP for a programming teaching language:
Lots of people are saying, TEACH THEM C! IT'S GOOD FOR THE LITTLE BLIGHTERS!
But really, as someone who has taught a lot of programming informally, the biggest obstacle is people: a) seeing that programming is useful and b) seeing that programming is something THEY could actually DO.
At the beginning it's SO easy to feel like it's just a whirlwind of details you'll never be able to keep straight. If you can just teach selection (if...else) and iteration (foreach) and get it to stick that problems can be solved this way, yes, even by ordinary humans, then it's really not that hard to graduate people to Java or some such.
At that point you're just adding the concepts of namespaces, data typing, OO as a deeper part of the language....and the syntax and basic concepts are already there and familiar.
I hear people worried about generating bad habits, but I just don't think this is the primary concern when FIRST introducing people to programming.
Slices, dices, eats your lunch.
The best language is the one that the teacher can teach well. If the teacher can't do a good job explaining the language, it doesn't matter how good the language is for programming... there will be a lot of kids in class that will be lost.
http://devster.retrodev.com/sega/basiegaxorz/
It's BASIC, but it compiles to work on SEGA Genesis emulators and, given the right tools, a real SEGA Genesis. Easy to do, but sure to give them a real spark of "wow, holy crap this is cool!"
If you believe in privacy, and believe you have "nothing to hide" at the same time, you're a goddammed idiot
In addition to that there is pygame. A set of Python modules designed for writing games. It's really simple and easy to use. I think even beginner programmers wouldn't have much trouble making simple games. I wrote a breakout clone that's only 147 lines, I was going to use it to teach a programming class too. There is nothing complicated in it at all, just a few loops, if statements, some rectangle geometry and negating numbers. Elementary, really.
I think Python fits the requirement, more so than any other, for a language "that might be more 'enticing' as well."
Win a signed Stephen Carpenter ESP Guitar from the Deftones: http://def-tag.com/?r=0008781
I'm seeing lots of good advice, but a lot of it coming without a few very simple questions. What are you wanting the students to come away with? And what are the students interested in coming away with?
Back in high school, when I was first learning to program, I wanted some level of instant gratification. This is the basis of languages like Logo, where a core set of commands give a visual representation. But we can get similar results today in other domains.
losman mentioned UnrealScript, which I generally like, but still has some drawbacks. First, is the cost of the handful of Unreal licenses and the hardware to run them. It also assume the developers are on Windows (at least until UT2007), which may not be true for students at home. But beyond such technical issues, are you going to handle the distractions/complications of the additional media assets? As a teacher, if you're up to the challenge, you can take advantage of this to drawn in more students and allow students to follow their own interests within the environment. Ideally, students can group around projects where they all contribute based on their interest. Lastly, can you handle the parents (or tax payers in a public school setting) who see violent video games as inherently evil.
Web apps can offer similar instant gratification. The pitfalls here include maintaining a server that allows server side scripts and teaching HTML (and probably basic browser compatibility) along the way. Again, you need to decide whether hooking into additional media is going to be an advantage or distraction in the classroom.
One problem both of these share is the difficulties in tracing the stack. Their unique run contexts can make it hard to debug problems, which can be as frustrating for your students as it is for you trying to help them as project dues date approach.
That said, it is possible to bring the engagement of a game to other development platforms. A small top down arcade game can teach several core concepts, from simple data structures (lists of actors, multi-dimensional arrays of terrain, variables like position and health, event handlers from input or actor collision). Build an outside level editor and you can teach GUI development, file I/O, and string manipulation.
If you go the GUI and graphical route of a game, Java seems like a good match. I believe it works well in classroom scenerios. At the basic level, the virtual achine it free and platform independent. Several good IDEs are available, and I believe there is work on an Eclipse plugin geared toward students. The APIs are stable, self-consistant, and well documented, although exceptionally broad and thus easy for a novice to get lost in without guidance. And if you target applets, students have a simple way to show off their work.
I'm sure C# has basically the same benefits, but I don't know enough to comment on it. Given an MS grant for a Visual Studio lab, I wouldn't rule it out.
Python is also an option, but I would choose wxWindows over tkinter anyday. Being a dynamically typed language, you loose the support of a context sensitive IDE, but you gain the easy access to a shell-like evaluation environment, useful for allowing students to interactively test thier code fragements (actually, integrating Beanshell into a java app is both easy and useful). I've never found a debugging environment for Python I liked, but at least they exist.
Several other scripting languages could be mentioned here, but again I am not familar enough to comment on them.
Other posts have mentioned C, C++, and assembly. While I think they are all critical for a complete CS education, I am not convinced they are ideal for a high school introduction course.
However, if the target audience is more advanced, I would put C on the table before the others, especially if taught in an object oriented way to mimic modern programming practice. This is a great way to show what that C++ compiler or that Java or C# VM are doing on the metal.
Anm
Java might be ok for some people - I think that's what AP Comp Sci classes use. However it has a few drawbacks:
1) It doesn't "scale down" as well as languages like Python, Ruby, Tcl etc... So might not be as well suited for those who aren't as interested/motivated/quick on the uptake.
2) It's kind of dubious, IMO, to be promoting a product of one company.
In any case, that would leave us with the scripting languages, which I think are all worth considering for different reasons, and all have in common a faster, easier development cycle with no need to recompile each time.
Python: clear, easy to read, and very general purpose. Good introduction to OO without beating you over the head with it or forcing you to adapt to it from day 1.
Tcl: because of the interesting introspection that it has and uses for certain common programming tasks, I'm not sure it's the best to start with, but on the other hand, being able to create something *visible* on the screen with a few lines of code is pretty gratifying, especially for a beginner. (Python has Tkinter which is pretty good too, but slightly more complex to start with than regular old Tk).
Ruby also seems like a good, reasonably generic language - I don't know it as well, but from a casual glance, don't like the (willful) resemblance to Perl in terms of the syntax. But I think you could do a lot worse - you'd certainly have some advanced concepts available to teach with it.
If you teach them PHP, you're going to be teaching them web programming, basically. I'd stick to a more general purpose language (you can use PHP for general purpose tasks, but it's still really oriented towards the web).
On the other hand, if you've got bright kids and are willing to explore something interesting, you might try languages like Smalltalk or Scheme, that introduce some really interesting ideas.
http://www.welton.it/davidw/
The idea that learning something can "mutilate" you or decrease your ability to learn other things is crap. I, and most of the good programmers I know personally, learned on BASIC - evil old unrepentant BASIC, full of GOTO and GOSUB. Maybe Dijkstra had trouble teaching "good programming style" to students with a BASIC background because they had experience, and weren't automatically willing to accept someone else's definition of "good". Or maybe he was just kidding.
BASIC was grungy, useful, widely available, and offered a fast edit-run loop - key ingredients in getting a lot of kids hooked on computers.
Please, please. How many times does this have to be rehashed here on Slashdot and the Internet in general, especially when good, detailed information is so easily accessible? The Java "language" is an open specification. How do you think GCJ and other projects are able to do their work? Sun's JRE source code is quite a different story, for example, but that's not what I was referring to.
They accept feedback from other members of the JCP, but all the decisions are made by Sun.
This is incorrect, actually. The final "decisions" are made by the applicable Expert Group for the submitted JSR, which is made up of industry "experts" from many different companies, possibly including Sun, but often not. For a nice breakdown of the entire process, please see here:
http://www.javaworld.com/javaworld/jw-10-1999/jw-Hope that helps.
Greg T.
If you want them to have a clue how computers actually work, show them assembler and/or C.
If you want them to learn the "my data is mine i can easily do what i want with it" attitude, teach them Python, Perl, Ruby or PHP.
If you want them to get "standard" jobs in the industry, teach them Java or C#, with some C++.
In no case would I first show them any form of Basic. Kind of brain-damaging as a first language.
My personal take would be to give them two different classes corresponding to the first two items in my list: ML/Lisp and assembly/C. Make a solid grab at the two extremes and they can always figure out the 'middle' stuff on their own, which is comparatively easier.
"The can learn some really interesting concepts."
Like how to count parens? I spent a lot of time doing:
1 2 3 3 3 3 2 2 3 4 4 3 3 3 2 1
Intron: the portion of DNA which expresses nothing useful.
I would contend that it's much easier to move from functional to procedural than the other way. Witness the teeming masses of procedural programmers that end up saying, "Well I tried looking into some of that functional stuff because it sounded interesting, but it's just too weird. I can't get my head around it." I know some very bright programmers who have a lot of difficulty with the functional style because they're so used to procedural.
In contrast, I think anyone could pick up procedural programming if they had already learned a different type. It's basically just typing out instructions for the computer to perform. And I'm not a functional programmer trying to disparage the procedural method. I've been programming in C++ and Perl for years and only recently started feeling comfortable with Haskell.
I think the biggest disadvantage to teaching functional first is that functional languages usually have more features to offer than procedural languages, so it can be a bit frustrating sometimes moving in that direction.
--
Promoting critical thinking since 1994.
For example you might want the programming course and the calculus course to be mutually supporting.
The rules for differentiation could be coded up in
the programming language. For Common Lisp it might
look like
(defparameter plus '+)
(defparameter times '*)
(defun differentiate (form variable)
(typecase form
(number 0)
(symbol (if (eql form variable) 1 0))
(list (case (first form)
(+ (list plus
(differentiate (second form) variable)
(differentiate (third form) variable)))
(* (list plus
(list times
(differentiate (second form) variable)
(third form))
(list times
(second form)
(differentiate (third form) variable))))))))
(differentiate '(* x x) 'x) => (+ (* 1 X) (* X 1))
But why are those the rules, rather than some other rules? Well it is supposed to agree with
the numerical version
(defun numerically (function argument difference)
(let ((left (funcall function (- argument difference)))
(right (funcall function (+ argument difference))))
(/ (- right left)
(* 2 difference))))
(defun square (x)(* x x))
(numerically (function square) 7 0.001) => 13.998031
And indeed
(defvar x 7)
(eval (differentiate '(* x x) 'x)) => 14
Notice the wider vision: students are taught a programming language to give them a language in which to talk about procedures, including procedures that they are expected to master in other parts of the curriculum.
I base my opinion of Python on this...
When I look at a Python program, it seems pretty obvious what it does. There are very few special-case syntax elements. The program is clear and to the point. When I have examined Ruby programs, it was not nearly so immediately clear how they worked. There seem to be a number of special case syntaxes related to lists, strings and blocks of code used as arguments that render Ruby code much less readable.
Perhaps it is my ignorance of the language. Or maybe Python is closer to other languages I'm used to. But, I was able to pick up and understand a Python program when I was first learning Python much more quickly than I was able to pick up and understand a Ruby program.
That is why I hesitate to recommend Ruby as a beginner's language.
Need a Python, C++, Unix, Linux develop
That was my initial reaction when I first met Python: sacrilege!
In many other block-structured languages it's customary to indent but the {} or begin...end markers are the syntactically significant things. Unfortunately, when humans read the code, it's actually the indentation they use to parse the logic most of the time, as many a new C student has learned via the standard deviously indented if...if...else demonstration.
On reflection, that means having the indentation not be significant, yet using other markers that are, is a bit like putting a banner comment at the top of every function with the function name in it: it's fine if you copy it in properly, but it doesn't really help, and it's a maintenance hazard that can actually harm readability if it's changed incorrectly.
Punctuation in a programming langauge is good, exactly up to the point that it stops increasing readability and/or reducing errors. After that, it's just clutter. So IMHO the question is whether (from some objective, analytical point of view) ignoring whitespace and introducing {} or begin...end markers improves readability or reduces bug count for programmers using the language. I suspect the answer really is a matter of taste: for some programmers it will, and for some it won't.
This is why not everyone agrees on whether syntactic whitespace is a good or a bad thing. There just isn't a single, universal right answer to the question.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I've noticed everyone here is recommending their favorite language, without mentioning why it might be useful for beginning programming. I'd like to address that issue:
In Beginning Programming, you're assuming that the student know absolutely nothing about programming. They should know Algebra (to understand variables), but that's about the extent of Math.
Thus, probably the Right Thing to do is build on the basic Math understanding that your students have, and start to introduce programming concepts from there.
For that reason, I'd start with a Functional Programming language as they tend to be rather obviously Math-derived, and help ease the introduction of programming constructs. I would recommend Scheme, since it is associated with one of the best "Teaching Programming" texts ever, Structure and Interpretation of Computer Programs.
After they've grasped Functional Programming, I'd have them move on to Procedural Programming, starting in Pascal or Modula-2. These two are excellent languages which illustrate the fundamentals of procedural programming, without some of the nastier pitfalls. There are also excellent textbooks available for Pascal (fewer for Modula-2). Later, I'd move them to C to introduce pointers and some of the other hairier features.
Finally, they're ready for Object Oriented Programming, for which I'd use Java - it's widely used, very common for college-level coursework, and there are a large number of supporting utilties and good textbooks useful for teaching aids.
Overall, I'd look at teaching Functional in 1 semester, Procedural in 1 or 2 semesters (depending on the detail and breadth you want), and OO in 1 or 2 semesters.
In all honestly, I love scripting languages like Perl, Python, and Ruby. However, as a teaching tool, they're all too multi-purpose, and it's easy for the student to do something they're not supposed to do (even though it works). For teaching languages, you want ones which pretty much only allow the student to program in the methodology you're teaching. That is, you generally want those languages which are LESS flexible, since your main goal is correctness, not functionality.
-Erik
There are always four sides to every story: your side, their side, the truth, and what really happened.
Specifically designed for teaching programming. Although it's not a 'real' programming language as such, it might be well worth exploring.
:-)
http://gvr.sourceforge.net/
Or PL/I, of course.
If you want them to be able to adapt to any other language available, teach them Scheme.
If you want them to be able to program in their first day, teach them Python.
My question is, "What do you want them to do with the knowledge they gain in your course?" If this is to be an introductory course to progamming and/or computer science, it makes sense for it to be both enjoyable and educational. Start them out with Python and get them into PyGame, they'll be tickled to be writing games in their first course. If/when they want to get into writing web applications, send them off to Cheetah or some other templating language for Python. If/when they want to write GUI applications, send them off to wxPython.
Of course this all fails when they get to college and they are forced to learn Java (C/C++ was so much better to learn), but by the time that rolls around, we hope they have matured enough to understand that learning multiple programming languages is actually good for them.
I think that introducing the beginner to Brainfuck is highly likely to mutilate them (or at least induce them to self-mutilate).
On a more serious note, I think that to most (non geek) people, computer = Interweb so a programming language that has the ability to output html is preferable. This would mean that they can show off their work to friends, which has a powerful re-inforcing effect in itself.
Although I like PHP, it sounds like Python has the edge in that it is more flexible in this regard
Humorous signatures are over-rated.
A concrete grasp of classic logical operations is far and away more important for any programmer, especially beginners. I find that most people I interview for programming work fall into one of two categories: those that can understand binary math and those that don't. IMHO, Java-centric trained folks including those with advanced computer science and engineering degrees by and large have difficulty implementing any bit-level analysis and manipulation. While high-level language proponents argue that this level of programming is unecessary for most applications, the inherent computing overhead introduced by increased abstraction often requires programmers to think about making their apps work on real equipment in the real world. Languages are flavor-of-the-month. Students will study and master any language if it gets them employed. A solid grounding in logic is language-agnostic and actually builds better programmers.
Rails is a Web-site framework built using Ruby, much as Struts is a framework/tool-kit built using Java.
Ruby makes for an outstanding first language. Learning to use Rails (or Nitro or Wee) could serve as a "next step" course for developing Web applications while examing Ruby's meta-programming facilities.
Java is the blue pill
Choose the red pill