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.
Ruby on Rails is not exactly just a programming languaje, but a language and a framework...
.NET is to VB or C# right? RIGHT?!
Kinda like
I sense a war regarding this topic... (The article, I mean)
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
I find that to be pretty easy, and fun to do as well, especially when writing simpl extensions for Firefox, etc. Not only that, but Javascript is very useful for use with webpages as well.
hellboy1975 http://www.foutheye.net
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
Although, lord knows we don't need any more web developers, but...
If they kids have access to notepad and some type of free webhosting then they can always work on a web page regardless of having to have a compiler. Once they understand how syntax works (like closing your tags!) then they can move up to more complicated programs that make you hunt down errors after you compile.
Although some people would debate getting the inner workings down pat first is more important (like hello world programs in C), I'd debate that web page development brings instant gratification to the person making the page fairly quickly and from there you can expand on advanced topics such as Java and PHP programming.
The kids that are more visual oriented will drift towards the more graphic parts of the web development like Flash while those who find themselves interesting in the gut coding towards C++.
And maybe you can teach them Photoshop skills and how to not make a fugly web page while you are at it...
"I am the king of the Romans, and am superior to rules of grammar!"
-Sigismund, Holy Roman Emperor (1368-1437)
whyfor there is Python.
You might be thinking of Pascal, which was designed as an introduction to structured programming.
Spot on about Python being an extremely solid choice, though.
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!
Go with Python. It's quick, easy, and clean. It encourages decent syntax, and is portable to anything. Furthermore, as it's interpreted, you get the instant gratification of being able to run the program once you've saved it and set the permissions--no waiting on a compiler. Also, studens can take their work home with them, as it's portable and free both as in freedom and as in beer.
Also, the GUI bindings aren't that hard to use and most are equally portable.
Haec merda tauri est. Ceterum censeo Carthaginem esse delendam.
It might actually be good to start the students on the path to learning Cocoa. With X-code and interface builder a large number of fairly powerful applications can be constructed with very minimal coding, but the students will have the option to code 'till their heart's content.
Interface builder would allow students to even go as far as building a fully functional web browser without having to touch any code, and since it is free you wouldn't have to invest much into your startup.
I suppose that the only drawback would be that the student's applications would run only on Mac, but the last time I visited a high school there were plenty of Macs available to work on.
Those who know, do not speak. Those who speak, do not know. ~Lao Tzu
Think about your audience. A few of these kids will really want to learn programming, but most are just wanting something cool that shows quick results. I think PHP would be a great idea. It's quick, easy, & a very forgiving language. Plus they get to develop programs that will have real-life value that they can continue to modify & use after the assignment is turned in.
Sure you could try something like Pascal that better teaches programming, but that's just going to make your enrollment decline more quickly.
Pascal.
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.
If the kids don't know anything about programming, and are interested in math, Scheme (or Lisp) might be the best language to teach them. The can learn some really interesting concepts.
But, that's probably too academic, in which case I recommend Jython. It'll be really useful as a scripting language, and will allow you to have a follow up course on Java in which you slowly replace a large Jython program with Java code and then extend it even farther.
i know it doesnt sound like a good idea but i began on Qbasic.
it provided a very basic introduction to loops, variables, randoms and triggers.
i know its not particularly practical but for starting with its the pick for me.
For a second lets consider whats most important in your first programming exercise. can you make the language say "hello world"
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
I learned programming using Borland's Turbo Pascal (yes, Windows, not free as in speech (ZOMG)) and it certainly helped me learn some programming basics. I've moved on to learning C++ now and the Pascal background made it much easier.
By summer it was all gone...now shesmovedon. --
My first 'real' language I learned was C++, but what led me to it was GameMaker (www.gamemaker.nl). It's a program designed to make games, but once learned you can create really quick apps (much like VB's RAD principle). GM is OOP-based, teaches a lot of things like GUI creation and making the back-end, and leads well into higher languages. It follows C-style syntax, but it lacks power, compilation speed, and flexibility..thus people will want to progress to different and better languages :)
It's meant to be an easy game creation tool, and it does its job well.
Death by snoo-snoo!
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 did my programming in HS with TurboPascal, in a "Computer Math" class.
It was just me and a few honor-role students (lets just say I got bored easily, so I sluffed off.. I have no problems being a B student). None of them really had any aptitude for programming, but the language itself worked well for them because of the syntax. We wrote simple games, stuff to do our math homework and difficult calculations, and the like. I ended up writing a printing program for printing out our source code.
Great part about Pascal in general is that it is a great precursor to C, or C++.
However, if you are going to insist on them having a language that they'll be able to use in a professional (or semi-professional) environment, you've got another vote for Python here. Perl is also good, but it'll be more difficult to learn.
"Better to be vulgar than non-existent" -Bev Henson
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'd need a really good argument to not use Java. A decent Java developer is harder to find than a C++ or even a C# guy. Tools like Eclipse are free and there is a lot of free online documentation. And it's easier to build a quick GUI in Java than C++.
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.
I think we will have a bit more good programmers if they start to learn programming with Python: concentrate on the algorithms not on irrelevant details.
There's a hidden treasure in Python 3.x: __prepare__()
I was thinking about this (from the perspective of what I would do to educate a promising youth with no programming experience who seemed to have a the right mind for it) same sort of topic a while back, and here's what came of it:
First, kill Visual Basic - that's just plain bad.
Also note that you'd need some good emulators or some old-school hardware for some of this (although you might be able to build/find new DOS-era hardware based on Intel's 386EX chip, I think they still make it for little embedded systems, anyways..)
I would start a programming-illiterate person off in plain old BASIC (like, the kind you did in old MS-DOS, or the Apple ][, etc). No Visual anything, no windows, nothing complicated.
Start with "Hello World" and move up from there to the kinds of simplistic text-based applications and games one used to see source code for in 3-2-1 Contact
In parallel, teach them very basic electronics - the kind you'd learn from those old Radio Shack 423in1 electronics kits. Battery, LED, resistor, switch. Move from there to very basic digital logic using TTL or CMOS chips to teach them about the binary system and binary logic, finish it off around the level of making neat little circuits with the logic chips and a 555 timer or something. (They could of course branch out on their own beyond that).
Around the time both of the above are going well, introduce them to PEEK and POKE in BASIC, tell them more about the hardware in the system, show them how to directly manipulate video memory via PEEK/POKE to the mapped video-ram addresses, etc. This transitory phase will go quickly.
Next you step them right on down to early x86 (no more than simple '286 instructions are neccesary, screw protected mode and all that jazz for now) assembly, with a text editor and MASM/TASM. BASIC is no longer useful. Let them learn all over again to write those same little console games/apps in assembler. Get some good books on the subject for reference guides.
Once their assembly code starts getting a little unwieldy and difficult to debug due to complexity, introduce them to better ways to manage their code than BASIC-style linear programming. Show them to organize their assembler code into little libraries of subroutines with standardized calling interfaces, etc. Once they're comfortable, and they're ready to start making even more complex software, but the complexity of doing it all in ASM is slowing them down (But they are using some good functional-style technique)...
Switch them over to C. Show them how C is like platform-neutral assembler that's easier to write and maintain. You might well wean them off of DOS and head straight to Linux for the C part. Stick again to text-console software, no crazy graphics libraries or anything. As they're getting used to C and getting used to the Unix shell in general, touch on unix shellscripting - and later as their C starts getting decent show them perl.
After that, they're pretty much good to go in any language with Google and/or the O'reilly section of their local bookstore at their side.
I think part of the natural advantage programmers of my era have (~30 years old now) is that we grew through a lot of these stages naturally as they evolved around us in popular geek culture (if that's not an oxymoron). More recent guys are in some ways crippled by not having the benefit of going through these stages sans modern amenities and languages.
11*43+456^2
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.
Seriously.
... learning to program isn't about learning to program -something- in particular.
AT-Robots or some other assembly-like language to teach them how to program with registers, conditional jumps, interrupts, and all that. They'll later realize they hate goto from this. But mostly it's really stinkin' fun, and they'll hardly realize they're programming. Instead they'll be thinking about the problem they're solving, trying to beat each other in competition.
Then a language like C, to learn about functions, loops of various sorts, pointers, maybe even function pointers. This is when it gets boring.
Then a few other languages to learn about OO, dynamic typing, etc.
They really should be exposed to both interpreted and compiled languages, strongly typed and otherwise, with and without OO,
I would object to teaching them specifically "Ruby on Rails" -- that's like teaching someone how to hammer together a bird-house, as opposed to teaching them to be a carpenter. Also make sure they know the difference between a language and a library, if you can make that distinction.
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.
Teach 'em Perl. Teach loops, pattern matching, and `exec` statements. These can be kept very english-like. The more adventurous students can explore either more advanced or esoteric Perl (to show them some Martian Perl, show some "Perl Minigolf" examples).
Perl is a quick and dirty way to automate anything. Running programs on a recurring basis, testing file structure and existence, querying SQL databases, accessing internet resources. Nearly any job involving running a computer program could be made easier using Perl. Perl is also cross-platform, unlike VB or Cocoa.
The thing I like most about teaching Perl is that you can start with a three line useful, working program. Then modify it to solve different problems, each time introducing a new concept or command.
Please make useful examples. None of those $car_object->turn_left() abstractions.
Everyone is entitled to his own opinions, but not his own facts.
If you teach VB, PHP, Perl, Ruby, Python, Java then your students will spend most of their time gluing together other people's library code. This is boring, uninformative, and gives a false and anticlimactic sense of early achievement. Yes, five minutes in VB will glue together a working text editor. And you learn nothing in so doing. Similarly PHP for a website.
Good languages to start programming have a simple core library that does basic IO and data manip, and nothing else. The best are probably Scheme or C, depending if your focus is academic or technical.
I'll echo the "Python" recommendations, tempered by the fact that a Rails-like framework may be a good idea. On the other hand, it may involve learning too many things at once; I've been web developing for just shy of ten years now and it's hard for me to feel how hard this stuff is. But take Javascript, HTML, Ruby, the Rails framework, and a couple of things tossed in for good measure, and it may prove a bit much. (Or not. I happily defer to anyone who has actually tried to teach programming starting people from scratch from Rails. But I think I'd start with a tech that is made out of less acronym soup.)
But what I really wanted to comment on was:
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.
Bwa? Check your terminology. Ruby, Python, Perl, and the like are the highest level languages there are for general use at the moment. They can hardly fail to lead well into themselves.
(PHP is deliberately not in that list. I would not start them there. PHP requires immense discipline to use properly and there's little gain to be had for that discipline. I'd say it's the closest candidate for a modern heir to the "You can't teach a Basic programmer how to program" meme from Dykstra; in some sense it's not a "bad language" but it definately teaches a lot of very bad habits, with a community that enables this behavior. Your students should not end up on Bugtraq with their school project.)
In fact, you'll be jumping those kids ahead of a lot of Old Farts (TM) who still look down on those languages for a host of misguided reasons and insist on using C, not because it's the best choice for some good reason (like a cross-platform library, for which it is still King), but because they honestly think it's the best choice.
Your danger is that if the kids are ever presented with C, they'll wonder why the hell anyone does things in such a baroque fashion and they'll refuse to be placed into that sort of bondage. Me, I consider that progress, but YMMV.
I suffered an introductory course in programming in VB while studying physics at university and despised it. Later I was fortunate enough to come across SICP and the SICP videos when I decided I needed to learn programming in earnest but if I'd been stuck with something like C++ or BASIC or Java, I suspect I'd still have found programming a tedious and unrewarding distraction from real maths and science and never really understood its potential. Now I actually like and respect it and there are good resources available for high school level stuff:
a ls/
http://www.teach-scheme.org/
http://home.adelphi.edu/sbloch/class/hs/testimoni
Apparently Scheme/Lisp appeals even to 'liberal arts' types and though I'm not one of those myself it certainly rapidly transformed my attitude to and understanding of computing and I can see why it might make better and more enthusiastic programmers of students whatever their abilities and preferences.
do you want lots of programmers or develop fewer, but better programmers. someone suggested assembly. yes, that's good, but go back one further to machine code, if its possible. i learned programming using those microprocessor kits with hex keyboards, displays, etc. you get a real sense of what's happening inside the CPU and how addressing and data transfer take place. this approach builds a deep foundation. i know people writing C/C++ that don't completely get stacks, interrupts, etc.. as for high level language, how about something completely different like logo and forth. it is a good way to illustrate the unimportance of a specific language.
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
PHP is great for high school kids:
1. It's an "instant gratification" language that makes it easy to get results.
2. You can do a lot of web based projects which teens should find interesting.
Yes, PHP has a lot of problems. It's very undisciplined. However, I think it's a good choice for a class where probably 80% of the kids won't ever program again.
Well, that all depends on what environment the person intends on working in. I know most here would rather die than work in a Windows centered environment, but you know? They exist in large numbers, not everyone is "down" on Windows, and in that case, Windows centered languages such as VB, C#, and maybe C++ (down the line, maybe) is the direction to go. As far as PHP, I like it, any language offers opportunities for crappy code, and that's as far as I'm going.
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
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./
Your post has got to be a troll, yes? The world does not need more "web developers".
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
Straight C. They're gonna have to learn it sometime, it's useful, and they'll learn about how the computer works. Unless people don't think knowing something as low-level as pointers or a sort algorithm is important. Then go ahead and teach Java with its libraries for everything and garbage collection and slow-and-fatness.
-Splat
Java's too verbose, C/C++ is too close to the hardware, and we probably shouldn't go that low for a fist language. PHP is too domain specific (and kinda cluncky). Ideally, your students would get a bit of exposure to several languages, so they can see some differences (typeing, etc)
"A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
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
Can't beat that for excitement, just make a bot competition out of it or something. You can even download the unreal engine 2 runtime for free from http://udn.epicgames.com/. UnrealScript will teach basic programming and OO design, and stuff like 'latent' functions make controller logic a lot simpler.
Also, you could easily integrate it with an art programme to teach that side of it.
Hear me out...
My first programming language was assembly language and it was really helpful in learning all other programming languages.
Whether it was programming BASIC, C, C++, COBOL, Delphi/Pascal/Modula2, Perl, Python, Ruby, Scheme or XBase, I always benefitted from having learned assembly first.
Some languages such as Ruby or Python obviously don't necessarily benefit as much from having learned assembly first. But still...
Hey, it's what got me interested in programming. It's interactive so it gives instant results. It can teach the basics of algorithmic thinking without burdening the beginner with all the necessary quirks that go with "normal" programming languages. If they find they actually have a talent and interest in programming, a more conventional language can be used for a 102 course.
I've actually thought a lot about this question since my wife took a Java 101 class a few years ago. The following are comments she made while she was doing her homework:
- What the heck does "public static void main" mean?
- What's all this import stuff about?
- What's the point of this try/catch stuff?
- Why do I have to recompile the whole thing when I just changed one letter?
- These error messages don't make sense and it's hard to tell where they occurred.
- I know what all the commands do individually, but I really wanted to learn more about how they work together.
- I spend so much time dealing with the compiler and stuff, that I haven't been able to really learn about programming.
- What's the point of floats, doubles, and ints? Why don't they just call it a number and leave it at that?
What I got out of her comments was that the programming language was getting in the way of learning programming. While most of her questions seem pretty basic to an experienced programmer, they were still outside the scope of her class. The teacher didn't have time and the students didn't have the background to understand the answers.In my opinion, the best languages for introduction to programming are loosely-typed scripting languages. Let the students get the basics of programming down first, then concepts like type, storage, classes, packages, error handling, compiling, etc. can be added later.
This space intentionally left blank.
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
Yeah these are kind of crazy, but...
I always thought Inform would be a cool learning language. It introduces the concepts of objects in a very easy-to-grasp way. It's really easy to throw together a working game.
Also what about something like DarkBASIC? I haven't used it at all, so I have no idea if the syntax is intelligible (or if it teaches good programming practice). Think about how students would respond to something like this, though...
GAMES!
SYS 64738 NO CARRIER
PHP and Ruby on Rails (RoR) are both excellent choices because:
Ruby is very elegant (pure OO, powerful but simple, clean syntax). As many have noted, RoR is not a programming language per se but rather a Web application development framework that uses Ruby together with a lot of neat stuff (like Object Relational Mapping) that works "out-of-the-box" without configuration (if you follow design conventions). You could start your students with Ruby and then later in the term introduce RoR. Nice.
PHP is a good choice if you're not too worried about stressing pure OO (although you CAN do OO in PHP), but want to show how quickly and easily great stuff can be done on the Web. There are tons of libraries available for your students to dig in to as well.
Good luck. Glad to see you're moving away from VB!
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.
What you need to do (and this is hard!) is to find out why students are turning away, and try to address those issues.
Python is great for this. It's object oriented, interpreted, has amazing documentation and tutorials readily available, and forces the developer to learn good indentation practices at the start.
This is what I started with, and found it very easy to from there learn Java, C, and C++.
If you like what I've said here, and want to read more, go to http://www.krillrblog.com
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.
I think Tcl is a great beginner's language because it balances a shallow learning curve with a quite a lot of power. (More than most expect before they've tried it.) Although I hardly ever program, I've dabbled in C, C++, Java, VisualBasic, and Python, but Tcl was the only language that I felt at home with. I was writing useful programs (GUI programs, even) within 2 hours of discovering its existance.
A lot of OSS folks are put off by it's blindingly simple syntax:
[command] [arguments]
But this shouldn't be an issue in a beginning programmer's class, because your aim is to teach programming, not the subtle nuances of a particular C-sytle syntax. Once they understand basic programming concepts, then show them how other programs do it. Another huge bonus is that Tcl has a very helpful and friendly community behind it. Try sending your students to comp.lang.c or some of the other communities on the net and they'll probably be discouraged from programming ever again.
IMHO, Python is the best lauguage for such.
I teach programming and I use the book How to Design Programs and the Dr Scheme environment. I accomplish so much using these materials. Can't recommend them highly enough.
www.purebasic.com
Seriously. I know it seems like an odd mix. But C is the OS language. And in learning C, you learn how computers work. You can't escape it. The stack, the memory model, etc.
OTOH, any complex program may want a GC, a decent development environment, robust libraries, debuggers, etc. If you evolve a system from C, you'll just end up with Smalltalk, or something that still trying to be like Smalltalk Java. Smalltalk is a great language for getting out of the way, and letting programers worry about their problems, not all the arcane details of how it's implemented. A know a number of schools have run successful projects using Squeak and other Smalltalk flavors to educate from primary through college ages.
One man's pink plane is another man's blue plane.
unit testing should be taught AS SOON AS POSSIBLE in my opinion
Amen to that! Experience with test-driven development is now my number-one criterion for hiring programmers.
Back in ye olden dayes, unit testing was hard, so nobody learned it. Today, there's no excuse. As a bonus, test-driven development is much more fun, so students are much more likely to enjoy the process.
But wait! More happy students -> more programmers -> more job competition -> lower wages for us. Teach those high schoolers assembler or C or something.
I think C is a really good choice. It has a minimal number of keywords and exposes the architecture of the computer very well so the focus is on the machine, and how the structure of the code relates to the hardware.
Java, Python. Scheme et al provide a lot of additional useful abstractions, but are most obviously uselful in systems much larger than what the students will be developing and may be too high level for a high-school setting.
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
I agree with the idea that programming is a problem-solving tool and a way of thinking. Students need to be taught to organize their system of problem solving to achieve objectives through scientific thinking.
I strongly suggest teaching 4 languages at once: Teach assembly to teach how the system works using structured problems, allow them to figure out how to solve the same problem sets in C (because it's closely associated with asssembly), then allow them to solve the same problem set in a structured language like Pascal or Modula 4, then let them solve the same problem set in a real Object-Oriented language like Smalltalk or Ruby.
The problem set should consist of common everyday tasks first. Like basic arithmetic, drawing shapes moving shapes across the screen, mazes, text, string, and file mainipulation (including sorting),building an interface, building accessories to the interface (like buttons and static controls) then building dynamic interfaces like forms, drop-down boxes, and whatever.
Concentrate on the multiple ways of organizing the task for a solution (like decision tables and flowcharts for assembly, pseudocode and entity diagrams for structured programming, Use Case and UML for OOP) and you will keep them challenged for a good two semester's work.
Any idiot can learn the syntax to a language in about 2 -3 weeks (the University of Oregon at eugene used to have students learn a different language every week!), but that won't make them good programmers.
Mike
"The mind works quicker than you think!"
Don't teach them a language at all. Teach via example and experience. Toss them a program in, say, Python that does something simple. Like, loops and prints 99 bottles of beer on the wall or something. Go over it quickly in class using a projector. Show them how this chunk does this, that chunk does that, etc. side-by-side with the output. Then, give them a program in C that does the same thing and go through the same procedure explaining in general terms how this does that, etc. Better yet would be to have both samples up on the screen with different projectors at the same time so students can be comparing in their heads and see the complete playing field the whole time.
:-) (And the rockstars can be given special side projects once they are identified - perhaps such as writing a portable game, using GUI code, 3D, etc.)
Then tell them to build a specific comparable program (something that loops and prints, but with a different twist someplace) and tell them to write it in both C and Python. Don't give them any starting code - just leave the sample code visible on the projectors and they can look up and refer back to that on their own. See what happens.
Actually, I'd be terribly interested to know if anyone has experienced this or tried it with their own students as, to me, it seems like a terribly cool way to teach how to think programming and not just how to do it. Kids that age aren't stupid - they've seen some algebra, they know what variables are (more or less), as well as functions. Just toss them in and let them map what they know or are learning in other classes onto this new medium.
Oh, and always remember you can't make a student care no matter how hard you try. Don't try to simplify or dumb it down just so every single student manages to complete the coursework. Let the ones who don't care suffer for it, dammit.
Hexy - a strategy game for iPhone/iPod Touch
http://www.gustavus.edu/+max/concrete-abstractions .html
C++ is probably the most popular way to teach programming in universities and colleges. In order to give the students a good foundation, something to point them in the RIGHT direction, and a smoother transition to most higher education schools, I believe that C++ is the correct move.
http://poignantguide.net/dwemthy/
"Seriously. I know it seems like an odd mix. But C is the OS language. And in learning C, you learn how computers work. You can't escape it. The stack, the memory model, etc."
n load_dolphin_smalltalk.html
FORTH.
"A know a number of schools have run successful projects using Squeak and other Smalltalk flavors to educate from primary through college ages."
[Get key from here]
http://www.bitwisemag.com/copy/other/download/dow
[Get Dolphin XP Value Edition (DVE) from here]
http://www.object-arts.com/Downloads5.htm
Enjoy!
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
First off, Ruby on Rails is an excellent solution for publishing a database as a series of web pages, but it is not where you want to start teaching - that is a tool for a particular solution.
Ruby itself, on the other hand, is an excellent language to start with. So is Python. I don't think you could go wrong with either choice - better yet, teach boath over the course of a semester, solving the same excercises in either language. This will go a long way towards teaching the 'abstract skills' of programming, rather than the mechanics of any one language.
Java would work too, except teaching with Java immediately puts you at a disadvantage - just to get a class that can run, you have to deal with concepts like classes, access (the public keyword) , the static keyword, arrays (the args[] passed to main), etc. That is a lot of theory before you can get 'hello world' off the ground. Of course you can skip all that at first, but that givesx the students a suspicious feeling. Trust me, I've tried.
FAITH [FAST ADVANCE IDEAL TECHNICAL and HANDY] Language by Nanosoft Systems, created by Ali Sohani (Company's President, CEO, and Chief Software Architect).
I think FAITH is the only language which is just made and applicable for this purpose. This interpreter based language is developed in cross-platform development language Java, so it also makes it plat-form independent and according to same hierarchy all the programs built in this language possess the nature of platform independence. This language is open source and posses 100+ Commands and 200+ Statements; all are cordially developed for solely serving this purpose that every student get easy understanding of the system and language, and things related to particular language even logic building, and understandings of syntax.
The language is basically the successor to "Command Pro" the easy graphically rich, command based interface language designed, programmed and produced by the same company. FAITH was there move towards open source development.
I hope if one get easily the copy of FAITH because the company has still not distributed their product commercially world wide, I have encountered it in Exhibitions and requested a copy from their website after submitting my all details, so I think that this is the only language which can help novice programmers to gain fast, advance, idea, technical and handy knowledge about language.
or did he just describe a standard IDE, and give it as the main reason to use a language?
In the class I learned, we learned C, which is a pretty good starting language. It makes you pay attention to safety, and has good performance, so that when you are doing something in the Real World (tm), you won't bugger it up by trusting what's already been done.
However, C is tough, and not as useful as it once was. I'm looking at SML right now (Moscow ML), and it's pretty cool. I'd want to learn it, in comparison to Java, in which I have no interest.
Many people I know didn't really blossom as programmers until they were engrossed in real world programming problems. I've always suspected that this blossoming can happen earlier if students are introduced to languages that allow them to do complicated useful things more easily: perl, php, etc.
However, there is some merit to this notion of teaching some programming fundamentals that these loosely typed script languages are ill suited to address.
The kinds of things that are taught in an intro programming classs first tend to be things like variable usage, loop syntax, if-then-else, switch/case, and procedures/functions. For the purpose of teaching these concepts, most languages are comparable. Admitedly, there are going to be distinct differences with things like declarations and typing, but this is perhaps not so important at an early stage.
The kinds of things taught in a second level programming course tend to be things like OO design, pointers, recursion, and the like. For this kind of stuff it can be more useful to have a language like C++ or Java.
So maybe the answer is to teach intro to programming in a scripted language (1st semester) and then advanced programming with a more traditional language (2nd semester). The intro course could be pitched as a generally accessible class while the second term could be pitched as a more in depth study of programming.
From a different perspective, if you assume that rudimentary programming skills are going to become more necessary in the workplace, then it makes sense to teach light weight programming languages in the intro courses because these are the languages that the broadest audience can use and the intro courses are the only place you can hope to hit that broad audience.
php is a higher-level language than C. As a comp-sci instructor, you should know that. And VB teaches even worse habits than php.
If maintaining student interest is your big problem, then you're not going to help it by changing languages. Visual Basic isn't the greatest language, but you can write some interesting programs in it -- interesting enough to attract somebody who's motivated to learn programming. If your class has a rep as boring, you're not going to fix it by changing the language you use. You need to look at your curriculum and teaching style. And maybe asking students what kind of software they want to learn to write.
They don't need OO off the bat, and most other (popular) languages use the C syntax.
You don't get a Maserati or even and Audi for your first car; you get a corolla.
By having to watch your pointers and malloc()'s, you also learn about how the machine works; I've seen too many Java programmers start 15 copies of their apps with 1G stack sizes and wonder why they get IO errors; they JUST DON'T GET how a computer works.
In C, you can accomplish things alot more quickly than assembler, but you are not so insulated from the machine that you lose touch.
MORE PEOPLE SHOULD KNOW C
Perl makes for a great language to pick up and program with. You can do cool things in just a few lines and use those same basic skills to create everything from GUI Windows applications to full interactive web sites to batch server based data processing applications.
.net's VMs.
Perl is an elegant language that will let you do something useful in just a few lines. It has an object model which is bolted over some simple standard programming constructs so it's reasonably easy to flow from standard linear functional programming to OO programming.
If you use Perl though, please, don't treat it like a scripting language like most people do. Read the perl style guide and follow it's recommendations. Use strict for all but tiny programs and use constants and find some libraries of interest to kids that would be fun to learn like Image::Magick, WIN32::Gui and LWP::UserAgent and introduce them to them.
And as far as exciting languages go, I'm most excited about Perl 6. I've been reading a lot of the work that's gone into the language design and it seems like they are building a really great clean language which will be running on top of a cool new VM that promises to solve a lot of the problems seen with java and
Barring that.. I might go with C. Working with it isn't as hard as it used to be and you are low enough to see the mechanisms behind how computers do all the stuff they do.
set softtabstop=4 shiftwidth=4 expandtab nocp worlddomination
1, Teach operating systems principles.
2. C programming
3. C++ or Java or Perl or PHP or Ruby
Slashdot = Sarcasm
You have to learn Perl as your second language, so that you realize how much easier Perl is than your first language.
All coding in Perl and PHP amounts to "load module A, load module B, use builtin feature C, use A with B". It may be a sensible way for busy people to bodge together a five-minute application, but it doesn't teach you to comprehend the skill of programming.
Quicksort may be dry, but if you've never tried to code it then the library function quicksort() is just a magic black box. When all library functions are black boxes, then you're stranded outside the language looking in - a mere "power user", not a "programmer".
How about BasicJ? http://sourceforge.net/projects/basicj
Java.
:)
Not to brag, but take a look at the things I've written in Java:
- Java Desktop: 1500 lines.
- Solar System Simulator: 2000 lines.
- Backpropagation Neural Net: 130 lines.
And that's just the beginning!
Point being.. it's so easy to dig in with Java *and* get something just like those crazy guys, those C hackers get (check out the Lucene search engine before you dis Java's performance).
I learned C in college. Bleh! Java would have made so many things so much clearer and given me a real way forward.
Ah well. At least you can learn from past mistakes!
It depends. I think schools should emphasize the academic-like concept of free software, and there I would suggest Python. It teaches good coding, both in design and in style.
If the class is viewed as more vocational, then I'd suggest Java. I love the language (although I still have some problems with Sun's VM on some platforms) and it is quite widely used in business. I just wish it were open source. (Although you might want to look at Fedora Core 4, which comes with Eclipse compiled natively and set up to develop Java code using gcj, a native compiler for Java and, yes, free software! The only issue there is that the APIs for Java are "variably" implemented (some are up to current Java, some, like the Swing GUI API, are not implemented at all)
First, as someone else pointed out, teach programming not a programming language.
However, I must say I've had very good experiences with Python as a teaching language. The code my fellow students churn out is invariably of much higher quality than what they've been able to do in for instance Java.
It seems that Python's design philosophy, which is meant to improve code readability &c., really works.
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
And because it's everywhere, javascript.
"...we should just trust our president in every decision that he makes and we should just support that." B.Spears 2003
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/
Easy: Lua
- easy to learn
- teaches good programming practice
- has powerful advanced features
- has lots of free documentation
- works on a variety of platforms
- is fun and satisfying to use
It's a shame there isn't a language designed from the ground up to have all thatI can see your problem. High school kids are not computer science students so you need something simple. You want to teach them something useful that will help (and motivate) them to possibly consider taking a bachelor/master in an IT related field.
I was about to recommend Java. But I think that might be too abstract for high school kids. You'd probably end up scaring most of them with it (and I am a Java programmer). The nice thing about VB was that it is simple, gets results quickly and that there used to be a market for VB programmers. This market (and the market for fat clients) is disappearing rapidly.
So you need a replacement that is easy to learn for not particularly talented high school students, gets results fast and has some reasonable demand in the job market. That excludes legacy stuff like pascal, delphi, vb; obscure scripting languages such as perl, ruby.
Php is popular but is a bit the C++ of scripting languages: you can do lots with it and you'll likely shoot yourself in the foot. In other words it's not the ideal language for teaching. So I point you to similar languages like jsp and asp.net. You can do similar stuff with those technologies. In the case of jsps there is java behind it and lots of useful taglibs to do difficult stuff. You get results quick; web pages are something every high school kid understands. There's definately market demand for jsp programmers. Asp has similar advantages and may be a logical successor to your VB based course. Tools might be a final consideration. Microsoft can be expensive but they are known to make deals with educational institutions. Java/jsp tools are available for free but come with requirements that might exceed what you have in the school computer rooms.
Jilles
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.
(I've taught Perl as an introductory programming language. Seriously. What can I say; bioinformatics is a macho subject)
In high school I took a class in BASIC, and then C++. And my first year of college I took an ANSI C class. But it wasn't until I took a class on logic design, and then a class in assembly that I understood what was actually going on. If you want to teach students what is actually behind a program, show them what is happens on a logic level...and how those loops and interrupts actually work.
A good book for beginners in logic design(and the overall idea behind semiconductors and circuits) is bebop to the boolean boogie
And once assembly is introduced, you can use an emulator like emu8086 to let them watch the program as it runs.
You could of course take a top-down approach, and teach them php/perl/vb. But I've always felt that if you work from the bottom up, not only will they appreciate the fact that higher level languages are so much easier, but they're understand what is going on behind the scenes.
You should choose depending on what you eventually want to achieve.
For example: If your school wants to 'produce' software engineers, get them on Lisp as soon as possible (using SICP as instruction book), and do not worry too much about dropout rate.
If your school wants to give its students a feeling for what programming entails, get them onto something to which they relate, for instance MS Word macros, or possibly MS Access (end year project: write something that produces a list of all MP3s/addresses in you address book on your PC that are not backed up on the PC of your friend)
I learned Smalltalk in acadaemia, and I am now a professional Java developer. I am very grateful that I was able to learn OO via a pure language. I deal with Java developers every day, who either learned Java first or worked in a procedural language previously, and all they do is write procedural Java. By all means, teach C, Assembly or some other close-to-the-bone language to teach the fundimentals of computers (I learned Pascal and C before learning Smalltalk), but don't let them get paid for coding until they have programmed in a pure OO language.
What luck for rulers that men do not think. - Adolf Hitler
I'm not exactly sure why this is "dubious". In any case, I have to take issue with the rest of this.
Java is an open language, an open spec, and is NOT the product of "one company" in the generic sense that you imply. Notice I didn't say "Open Source", but neither did you. Open Source is a very different and specific thing, and that's not what I'm talking about.
If I were to offer another example in such a general stance , I could say that PHP is mainly the product of Zend. Of course, this isn't correct unless qualified for basis, which is all I'm asking for here.
Just my two cents...
Greg T.
I think it's just you. Sorry.
Maybe you should go back and read the sentences about "Java". ;-)
Seriously, his implications are clearly directed at Java and Eclipse being a powerful combination to "explore the basic practices of OOP".Greg T.
It matters if you want people to learn OOP or functional programming. Actionscript 2.0 (Macromedia Flash scripting language) is very good to learn OOP and a joy to work with. It has only the most important OOP features and strong typing. The movieclip is a strange thing to a developer, but at the same time a joy. People have in no time graphics, sound and lot of other stuff. The effect is that newbe's can quickly have their program working. This makes them more enthousiastic to learn more. One might say, why not Java? Well Java is a extremely large and complex language. I think it's just better to keep it a little more simpler. I think the complexity of Java is really underestimated. I think it even maybe more complex than C++. Newbe's may drown in it. Functional programming can best be learned with a pure functional language, such as Haskell. The language is very strict and learns you good coding habits.
Java a good language for the beginner? I really do not understand this statement - because the one thing that really hits beginners hard, is syntax.
At Glasgow University (Scotland), the first and second years of the programming course(s) are only in ADA95. Why? Because ADA95 has all the programming features a beginner needs, in clear english. A beginner should not be taught a language, at the end of a computing course they should be able to quickly learn and program any another language. Take the following example:
with ADA.TEXT_IO;
use ADA.TEXT_IO;
procedure PrintHelloWorld is
begin
put_line("Hello World!");
end PrintHelloWorld;
or
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
What is easier? From the ada source you know that this code is defining some sort of procedure of actions - the first thing you are taught in programming - it is telling the computer to perform a series of steps. The with and use easily make you see you are taking input and output and using them. And I have serious issues as to saying ada is unstructured, as it is one of the most typesafe-enforcing bugger on this earth, and has all the usual data structures - even pointers and packages.
All i can assume from your post that you are some sort of OO fanboy. OO is not everything, it certainly is not the answer to world poverty, and if every graduate came out of university not knowing non-oo concepts the industry would be in a very grave position indeed.
I work in an academic department where our principal teaching language has (for the previous 5 years) been Java. This has all been very well, but some of us have felt that the pace doesn't stretch the most able nough and takes too long to actually do anything useful. This is not actaully as criticism of Java itself, because I think it has a lot to recommend it and is relatively well designed.
As a result we are thinking about how this should change (not this year, but next). The important thing is to teach the concepts of programming first, so understanding variables, loops and conditions is, I think, paramount.
The issue of OO is more thorny. Many useful scripting tasks are, for example, written proceduarally, but larger applications usually beenfit from OO technques, tools and analysis. For that reason, I'd probably leave objects for a little while and get them writing smaller things that do useful stuff. Scripting is good for this because they can see the results of processing text fairly easily. I've discovered that over time, many students who have learned with Java have been almost unable to think in any other terms than OO if they don't get exposure to other technqiues quite quickly. Currently, we have a language paradigm module running in the final year of our programmes but I'm not sure if this is perhaps too late to be really useful.
Having said all of that, I would probably think about introducing programming via a language like Python. It's fairly clean in syntax, can run procedurally then have objects built on top as neccesary, encourages good style and is portable. Perl is a great language but definitely not for novices. The very strength of the language is the thing that might throw beginners: there are numerous ways to do one thing, and that might lead to confusion.
I remember reading some of Eric S Raymond's work that says that to hack well, you should know several different languages. If I recall he mentions Java, C, Perl, Lisp (for later) and touches I think on Python. As I talked around earlier, useful though Perl and C are, I wouldn't recommend them as first languages to learn with. I'd also recommend a shell language like bash or ksh for later too.
A collegaue of mine would probably also suggest you consider a language like Oberon or another of the Modula / Pascal family, because that is what they were principally designed for. They've fallen out of fashion now, but don't let fashion put you off.
It's not you: I'm just this horrifically socially awkward with everybody.
SmallTalk could be a good option.
Squeak is a SmallTalk implementation: http://www.squeak.org/
http://www.squeakland.org/ has a whole load of resources for teachers and students.
Then I'd go hardcore for a while and teach them C so that they learn about all the ugly low level stuff, compilers, and why pointers are dangerous. You might want to take a moment to talk about Assembler here (the gcc compiler has a nice option to show assembler code). Even if they never hack the Linux kernel, C-like syntax is used all over the place (see Objective C or C++ or C#). It is sort of like Latin -- difficult, not used that much, but very valuable as background knowledge.
Then you might want to try something exotic or at least completely differnt. Many people recommend Lisp, claiming it give you Zen-like insight; but Haskell or such probably should be nice, too.
I would not recommend PHP nor Ruby on Rails, for the same reason I wouldn't recommend learning to program in J2EE. The problem is that programming in that environment will teach the students odd habits and ways of solving problems that are not used in desktop application enivornments.
/environment. However, I don't think that learning to program in functional or declarative is very helpful for beginners.
Students will not learn about MVC, event handling, and will get into the habit of treating everything as a request-response loop. It can be quite hard to later try to write an event-driven desktop application.
The web application environment is seriously limited and there's isn't very much to do about it as things are now. Spring for J2EE has made things better, but it's still not good. Perhaps Flash and emerging trends like AJAX will push things to the next level, but until then programming for the desktop will teach you so much more.
Even though J2EE and Ruby on Rails are both OO environments, there isn't very much OO to the development, in my opinion. The frameworks are OO and you use objects, but the actions you write are procedural, everything takes place in an execute-method and you are instructed not to use instance variables... the model is quite OO, but writing POJOs won't teach you very much, and writing data access code is not helpful for a beginner. The views are not OO in any way.
Of course I'm assuming that we're talking about learning to program in an object-oriented language
Java is a good language to know, but as someone once said about the problems of using it as teaching language:
"There are four problems with teaching Java as a first language: 'public, static, void, main'."
The point being that you have to explain quite a lot about object oriented programming before you can even start to explain the easy parts, or say to the students "ignore this for now, I will explain later", which never works, it only confuses them.
I agree that Python or Ruby are better choices for beginners, who can then learn public, static, void, private, protected, abstract, final and other advanced OO concepts in Java quite quickly, as soon as they have learned for, while, if, classes, methods and objects.
First, not php, not even php5. It's not a nice, general programming language, even if you can use it for cron scripts (ugh).
I'd recommend going with a language with a good interpreter, such as squak, python or ruby. The choice should be based on what kind of project you want to focus on; for web development, go with ruby on rails. For games go with squeak or python. For system programming go with python.
If you want to be hardcore, and teach about the (now almost-redundant, even-if-sun-kept-it-for-java) write-compile-test loop, I'd choose pasacal, with free pascal 2.0. Then you can even teach som assembly. For me pascal syntax is more intuitive than c, it's about as fast, and it doesn't teach you any *really* bad habits.
The only problem with Squak, is that the platform is so advanced, it's likely to instill a false trust in the human race, and programmers and system developers in general, that will be crushed the first time they try to write a cross-platform program in anything else.
Oh, and for some nice rad development, you could always go with objective-c and gnustep.
"a decline in the number of students that want to take our entry level-programming course in Visual Basic."
Thank God! at least it seems there's still hope for mankind...
"the idea of having the introduction course be in PHP"
wouldn't be much better than VB, except it's free.
"or Ruby on Rails;"
isn't a language, but a framework. But Ruby is indeed an excelent language for both teaching and work.
"but are not convinced that they lead well into higher level languages."
sorry? say again?! You won't find many "higher level languages" out there that outbest Ruby or Python... let alone C descendents like Java...
still, my personal recomendation would be Scheme, a Lisp dialect that many north-american Universities teach. It features:
* ease of syntax ( almost none at all )
* a compact standard library ( R5RS ) perfect for teaching how to think algorithmically rather than being trained at a whole framework to pump out web pages.
* high level programming at its best with a very flexible and expressive language
Of course, if you are just willing to prepare them for "real life", just go the easy way with java and craploads of libraries to cope with such a poor language. And don't forget a huge bloated IDE to cope with the loads of redundancy such a poor language and its loads of libraries generate.
I don't feel like it...
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.
This was exactly what happened when I started at the Technical University of Denmark in 97. During the first semester we were taught a great deal of programming, all in Standard-ML, which being a functional language really set the scores even for people with and without previous programming experience. This was certainly good, but failed miserably when the rest of the courses expected that you already knew some other languages, but none of these were being taught. So everything was back to a state where those who knew some language were a lot better off.
At this point I think they dropped the SML in favor of teaching Java in the initial courses and sticking with that through the entire education (unless you decide to learn another language yourself). I really don't think this is the best way, since I believe understanding the concepts of programming is easier when you try applying it to different languages.
I'm not sure that teaching a functional language is a good call for a studen't first exposure to programming. While they're nice from a theoretical point of view, it dosen't seem that teaching a language that's fundamentally different from most of the big languages out there does them much good in the future. DrScheme (sticking to its functional part) is a good language to learn functional programming in, but not to learn the basicis of programming in general.
Give them a nice procedural or OO-centered language, so that they can get the overall feel of programming, and can try things at home. Once they're interested, then take them into things like functional programming.
As for language choices, start them with something like C++ (get the idea of compiling in there, but avoid the more complex bits of it), then a simple assembly language, then a functional one.
Cue The Sun...
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.
...you get your obfuscation for free!
someone speak python here?
<lucky> HHHHHSSSSSHSSS
<lucky> SSSSS
<Sonium> the programming language
|| Geshem ||
For introductory programming, Inform is an excellent choice, for several reasons:
...) share this property, and in any case it's best for students to learn multiple languages anyway, the more the better, to gain exposure to different paradigms.
1. The Inform Designer's Manual is an absolute masterpiece, easily the best
computer language manual I have ever encountered.
2. The designed problem domain of the language is one that immediately
captures pretty much every student's imagination. Your students will
flock to you with questions about how to accomplish this or that.
3. The OO model of the language is excellent, very practical, and overall
a very good introduction to object-oriented programming. And it's such
a nice fit for the problem domain that the students will immediately
understand the usefulness of the paradigm.
4. The language is naturally pretty easy to read, even for people who
don't know it very well. Things are well-named (especially using
the standard library), so that it is fairly obvious what they do.
Many people have taught themselves this language just by looking
at example code, without reading the manual until they had already
written quite a bit of code themselves.
5. The standard library is an important part of the system, so the
student will be introduced immediately to the concept of standard
libraries, much more readily than using e.g. Visual Basic.
6. It's a good compromise between high-level and low-level and indeed
really has both -- a quite high-level OO paradigm and yet also the
ability to do some fairly low-level things if need be. Fairly large
programs can be written without actually using the low-level stuff
(except indirectly, through the standard library's high-level
interface to it), but it is easy to introduce specific programming
problems that will require one of the low-level features to be used
if that is desired.
7. The Inform Designer's Manual is so excellent, this point really
cannot be overstated.
No, it's not a general-purpose programming language, and your students will have to go on to learn other languages. But most of the languages used as first languages for teaching (BASIC, Pascal,
Cut that out, or I will ship you to Norilsk in a box.
This is an introductory course for high school students. I'm picturing a bunch of kids who don't want to take wood shop. They probably can't even name a programming language. The kids who are truly interested in programming are probably already running the computer lab.
PHP introduces the basics of programming without alot of the overhead that other languages require. It can easily interface with DBs, can be executed from the command line, has hooks into all sorts of interesting libs, and it is freely available outside of the classroom. Furthermore, there are a plethora of projects that use PHP, providing source code examples.
Kids in an introductory course want results, not theory or complexity. If they are interested, they will learn the theory and take on the more complex languages. Keep It Simple, Stupid!!!
Smalltalk using the Squeak. Smalltalk is an easy langauge to lean, lot's of cool examples and a blast to program in.
Although I hate to admit it, JavaScript is a great language with which to begin. I hate to say it because a basic knowledge of HTML is required, and because debugging JavaScript (even after all these years) is a pain in the A**.
What IS rewarding about JavaScript is that you need relatively littel knowledge to see something tangible. Also the tangibles are enough to encourage a student to learn. Try doing image tricks - (i.e. Changing images onmouseover, etc..
I learned to code on C++ and I thank my professors for it. It was like learning to drive a stick-shift first, and then driving the automatic-shift is an afterthought.
Whichever language you choose, just remember that they're only kids, and pushing them too hard too early will push them away forever. Coding is one of those things that people love or hate.
-Jobo
The advantage of Ruby is that it's extremely consistent, without a lot of the special cases of (say) Java or Python.
Specifically, there are two scoping rules, all variables are references, everything is an object, it's true OO, it has lambdas, all the loops and other structural elements end with "end", there's no problem with tabs vs spaces.
I'm fairly new to Ruby (few thousand lines written), but I find it has an effortlessness about it that I've never experienced in a programming language before.
I'd also throw in some Scheme, just to get people used to the ideas of functional programming, program as data, and recursion. However, Ruby is better at doing useful things that might interest people (e.g. CGI, graphical toys, handy command-line utilities, etc.) sad to say.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
My contenders for good "starting" language would be:
:)
1. CommonLisp with CLOS:
Advantage: Simple, Gets to the core of what programming is, OO concepts, much less room for errors
Disadvantage: Somewhat obscure, "fun" games harder to create
2. SmallTalk
Advantage: Powerful and well-structured language, has influenced a generation of languages (Objective C, Java, C#, etc.), kind of the Latin of modern languages
Disadvantage: Somewhat obscure, student will be spoiled for all other lesser languages
3. C++
Advantage: Very common in industry, contains rudimentary OO structure, can program "fun" games and such
Disadvantage: Will have to re-learn some OO for Java and other better OO languages, syntax can be nightmareish.
4. Objective C++
Advantage: Solid OO foundation, can program fun stuff especially on Macintoshes, on Macintosh can use visual layout and design
Disadvantage: Syntax is fairly obscure compared to other modern languages, supported best on Macintosh which you might not have
E pluribus unum
When I first started, the first language we started with was turing. To be honest, I don't have much experience with some of the languages being described here, so maybe the other suggestions have the same features, but turing has some really good features for new programmers.
Firstly, there aren't a lot of include libraries, you can start writing the code without having to worry about things like missing things that should be linked. Starting out, I think students should be more worried about learning how to structure programs than where to find the functions they are looking for. Giving students a bunch of code they don't understand to put at the top of their program just makes it seem harder than it really is. Secondly, it's a very english based language. Instead of brackets you get actual words that say things like "end if". When you're just starting, I think this is a bonus because it's more intuitive.
Also, although the graphics are REALLY rudimentary, you only have to put in ONE line to access the ability to draw graphics on the screen. None of the craziness of some of the other programs where you have to set up windows and drawing areas etc etc to just put a line on the screen. They're not beautiful for sure, but it really lets advanced students do a little bit more, and pictures are always more exciting than console program that just spit out text.
Additionally, turing does have OO support, so if you're looking to teach OO concepts, you have access to them.
I don't know much about python, haven't done much with it, although it seems like it might be a fairly good place to start as well. I'd stay away from VB and PHP (and I guess Perl too for that matter). VB can make you a wicked looking program, but it's very unstructured. It might be easy to learn, but you probably want students to learn a languge that is a bit more structured, or they might have trouble later. VB doesn't require things like variable declarations and doens't really require you to stick to strict types and might be confusing when you try to move to a stricter language. I'd stay away from stuff like PHP because it's real use and power is with web stuff. To use PHP for web based stuff, you need some knowledge of HTML. Using PHP to write HTML can be a real pain in the a$$. It's a nightmare of brackets and quote marks and it requires you to have a knowledge of 2 sets of languages/tags and to actually keep the difference clear in your mind. Differentiating between these can be very difficult for beginning students.
Ok, done my rant...look into turing though. Although it's not as powerful as some of the other languages, I think for teaching what you're looking for is a language that makes it easy to get started, with simple syntax, but common code structures.
...no two people are not on fire.
"The Inform Designer's Manual is so excellent"
Indeed. perhaps because the author is a poet as well? and is really enthusiastic about IF...
another very nice language to introduce beginners some aspects of programming is the macro language used in the popular freeware raytracer POV-Ray to describe scenes. and, likewise to Inform, beginners are actually delighted to learn the language, since the results are very satisfactory...
I don't feel like it...
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.
It absolutely rocks - I would definitely look into it. It inspired me to continue on learning programming. When I started Python, I had already taken a course in C. I learned Python completely online, without books, which was inspirational. Here is the tutorialstarted with. Python is not difficult to learn, though it is a serious language that can do some heavy lifting. You can read about Python's "real world" uses on the python.org site - for example both Google and Industrial Light and Magic use it. I started it in sort of an offhand way, not really thinking much would come of it, and felt I really had some serious work down within a year, without trying very hard. After that I moved on to Perl and now I'm learning Java. I can't recommend it more highly.
Tcl is easy to learn, quick to bring up interesting applications, e.g.
http://wiki.tcl.tk/references/8337!
and scales from small to large applications, databases, webservers, etc.
When I was in high school the programming class we had was in pascal on a mac. This forced us to learn graphics. Actually, the first half was pascal on IBM PCs, just to learn the basics. But then moved to mac. He did this because at the time macs were much easier for graphics programming, and schools can get them at good prices :)
Our assignment was to make a game. I made a breakout type game. That was the cool part, made it interesting.
Today something like php might be interesting. I bet many high schoolers can get their hands on web server space (even maybe space on a school server) and create a website. This might be more interesting and able to hold their attention more as it gives a purpose to programming rather than just learning how to program.
I would teach them something they will be able to use in college. Most schools are going to start with C, C++, java or possibly lisp. So, while you ideally you will be teaching the language as only an implementation of concepts common to all programming languages - you will be giving them some syntax that can be used at college, which is hopefully the next stop for most of your students.
;)
If you teach the basic concepts well, students should be able to select and learn the best language for the task at hand.
The jobs trend seems to be towards portable/web-based applications and java is dominant in both of these areas. Then again, with the rate of outsourcing, you may be better off dropping programming languages all together and offering a class in project management
Consider the Io language:
"Io is small prototype-based programming language. The ideas in Io are mostly inspired by Smalltalk (all values are objects), Self, NewtonScript and Act1 (prototype-based differential inheritance, actors and futures for concurrency), LISP (code is a runtime inspectable/modifiable tree) and Lua (small, embeddable)."
Example of Io-code:
http://iolanguage.com/about/samplecode/
My personal experience is that it's extremely easy to write, transparent and very introspective.
ASM or COBOL on an old IBM mainframe bought off Ebay for a couple hundred bucks, coding business reporting apps.
That'll make them just love software development...
I'd start with Java, using Head First Java from O'Reilly. It has the cross-platform advantage, as well as being fairly simple to use, and if you're using a development environment like Netbeans, you have the advantages of drag and drop guis. One of the biggest hurdles, I think, for people to get over is not seeing anything working. With Java, it's fairly simple to get a program that does something concrete and visible. It also has the advantage of being "real world" in that lots of people are using it.
That's gotta fit into your schema somewhere
I'm also more familiar with Python than Ruby, but I've been meaning to get into Ruby because I perceive it as being more elegant than Ruby. It seems to me that amongst scripting languages there's a clear spectrum from evolved to designed.
So Python is certainly better than PHP, but I think students might have an easier time learning something that's more elegant and uniform. Obviously Assembly and Scheme are great, but I think they're an awfully hard sell for anyone who isn't planning on getting a CompSci degree.
It depends, if your students will be doing a wide variety of different projects, then Java is probably a good choice, however, if they will be concentrating on one main project, then choose the best language for that specific project.
.sigs are for losers
Depending on how long the student has to learn these things in, I would recommend the following things in the following order.
1/2 Year of Pascal...yes you heard me Pascal...its out dated, however it is great language to teach students about modularization, the importance of Subroutines and Functions and how to wrap their heads around Procedural program execution.
PHP/Javascript/XHTML/SQL programming...builds on the lessons learned in Pascal teaches interface design and event driven programming as well as basic classes and methods without requiring totally wrapping their heads around OO concepts. Also makes for a great intoduction into code libraries. SQL is just an added bonus as to do anything usful with the rest of these "languages" your going to need to talk to databases. SQL brings a good understanding of data structure and handling as well.
C Programming, takes the already learned concepts and moves them to a higher level. Students now have to start thinking about how to use the lanagauge to do things that were provided for them previously. However previous exposure to proper coding technique as well as to what IS possible and C like syntax will well prepare them for the leap to "real" programming.
C++ and/or C# and/or Java
C type Syntax and OO Closes the loop...
Power Corrupts,Absolute Power Corrupts Absolutely, leaving one person(group)in charge is absolutely corrupt.
I'd echo the previous recommendations for Python. As has been said before, you can use it for OO, but also use it as a scripting language as well. The syntax of Python makes it very clear and relatively easy to read. I think its a v good all-purpose programming language.
In my opinion I'd avoid C as I don't think its a good use of time, teaching students how to allocate their own memory. They'll waste time getting bogged down in that when they could be learning more fundamental skills. Also I think Java may well be just a bit too difficult to pick up for beginners, but of course it depends on how long the course is and what level you expect to take them to.
Hell is looking through someone else's perl code!
You've clearly gotten a lot of feedback so I hope you'll get to this reply at some point!
Functional programming languages have been mentioned. There biggest advantage is that they offer an elegant approach to programming, that can have a lot of aesthetic and intellectual appeal to students. But the most exciting example of such languages, Haskell (http://www.haskell.org/), does not seem to have been mentioned. The website has a lot of useful information about the language, and I know that some people at Yale have been using it for high school instruction, with promising results.
Walid.
It's perfect for Highschool students. What other language has Poignant Guide?
What other language has songs which recommend it?
Check out these torrents.
No, my friend, you won't find these kinds of fun things for Python. The Python people have forgotten their humorous roots and now take themselves very seriously.
The College Board AP test is in java. Saying that the class is an AP class might make more people think it's worth their time. Most colleges also give you credit for AP scores. An AP test at $90 is actually a bargain when compared to the normal cost of 3-4 college credits.
A guy walks into a bar... well, I forgot the joke, but the punchline is that he's an alcoholic.
Java as noted is a good choice. If your pupils are anything like mine you might also want to pick up a copy of Developing Games in Java by Brackeen et al which is fun, easy to follow, and full of entertaining examples.
If you are looking for a future CS undergrads, either use the current AP-test language or a language that naturally leads into it.
If you are looking for future web-designers, then run a web-design class and include at least one web-design language.
Have you thought about surveying your students and asking what THEY want out of such a course?
I assume you have pretty much free reign over what is taught. If you don't, then your district or state curriculumn committee may limit your choices.
Oh, finally:
More important than any computer language is the ability to speak and write effectively in a business context. Make sure your students know this. Consider making presentations and written reports part of the course, and grade them on their grammar and presentation.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
A good start might be hand-written HTML with some Dynamic HTML or other JavaScript starting about mid-year. HTML gives them an introduction to the basic ideas of programming, like commands in text, syntax, nesting, comments, and the write-(no compile)-run cycle before they get to the real thing. They should use the W3C Validator from the start, to teach the concepts of well-formed code in a very forgiving environment. Then move on to JavaScript to teach them all the usual constructs.
Another good choice (mentioned elsewhere) would be some other kind of scripting environment. If your school has the cash, Flash would do the trick. Or a scripting language attached to a game engine. Something with immediate results. Kids just aren't as thrilled with Hello, World! as they used to be.
In either case, they end up with something they can show off. Nice way to get them interested in programming without scaring them off, and still teach them the basic techniques. And hopefully they'll end up in my classes, because handing out all those A+s would make me look good.
long live VB
Basically C++ would be the best bet in my mind. Granted it's potentially the worst language to use, but it's best to start on a moderate difficulty language then a worthless language.
While VB is a good language to start with at times, the Basic part of the language makes it ultra simple. I know it's a well built language which can go the distance and graphically if done right it can be beautiful but it makes people shy away from it, I have a semester of it and it's great for quick and dirty interfaces but I find when I need a solid system I would need much more training and it doesn't have the applicability that that C++ does.
PHP on the other hand is more server oriented then front end. Personally I deplore doing webpages but that's me, but I don't think PHP or emerging technologies should be "first languages"
I personally started my life as a programmer when I was around 8 and my mom and I typed in programs for basic that would take 3-4 hours to type in and be fun but wouldn't do much, and I messed with the variables, and bitched when the failed. However this was when I was 8 and had no skills. I did some work with qbasic, but my first true language was C++ And I've used it since as a primary language.
I've used Java (good if you have a good teacher, better if you know WHY it's different/better then C++), Prolog (almost useless unless doing logic based systems, your not) Lisp (see prolog) Assembly (yeah that's a beginner language for masochists)
Basically my advice is if you want something anyone can learn and use well Visual Basic. If you want something to teach a true programmer but anyone can try to learn, use C++. If you want to show a second language to compare to these two, Java is great for that. If you want something with less functionality, well look around there's a reason why these languages have risen to the top, and that's because ease of use or functionality if not both.
Fortran, Cobol and other older languages are outdated but could work for beginners.
I think the most important thing is that you have a teacher who while might know a few thing are willing to let the students learn a lot, my Highschool C++ classes was teached by a moderate user (not even a programmer) but the kids in the class had a great time with the language, me and another were the "masters" and we constantly learned off each other as well as helped other students, I constantly refined my code to show off a couple cool tricks we could do. It was great and that's why I think it was better then all my more structured classes in college.
I suggest the following: Java. Teaches C-like syntax, but with objects, is platform-independant, so you can show them how to use Macs, X86, etc. and intorduce the idea of cross-platform development. Plus using Swing, you can share the pain of UI design up front. After Java, they can move up to C, if they are interested, or go whole-hog into Assembler. My $.02.
Give them a challenge. Something that will interest them and let them know if Comp Sci is something they want to continue studying it in university. Try C out.
MOUNT TAPE U1439 ON B3, NO RING
I say get them started on sql. This will help them
by introducing them to programmatic logic in small easily digested bits. I'd start them off with a semester course of just sql in an interactive shell
like sqlplus or the mysql tool. Maybe move them up to sql scripts run from the shell in the first semester. In the second semester I'd start them off
by taking their sql from the first half of the year and tieing it into a high level programming language like python or java. End that second semester with some basic data visualization like showing some data from query in some sort of plot. Based on their abilities you would supply more or less of the code and have them fill in key details.
I would say it depends on the students background and where you see them going.
A friend of mine wanted to learn to program, but with her background in Math, Haskell or Ocaml made more sense than the usually imperitive languages people suggest. Really, that would be a strength of Ocaml: you can learn functional programming, imperitive programming, and object-oriented.
It also allows you to undertake all sorts of data structures without being tripped up by the specifics (which is a good thing or a bad thing, depending on what you want them to learn).
If it is a truely introductory class with the intention of getting the students interested in programming, low overhead is essential. Ocaml works to a degree there, but I'd be inclinded to lean toward Python like everyone else.
I suppose the real question is whether you (and they) want to make them into people who understand the nature of programming or into good programmers.
For the second option, exposure to more than one language at more than one level of abstraction would be my suggestion, along with a trying out languages with different typing systems. For the first, low barrier of entry.
Oh, and either way, REPL (read-eval-print-loop, as in a language with an interactive environment for testing) is a must.
I totally agree. I pity the poor saps who have to have their first programming language be Java. IIRC, in Basic, it was... um... 10 Print "Hello World" Actually, I don't think the line number was required by the time I got to CS in highschool. Basic programming is about basic concepts and algorithms, not production class code!
Ada
I agree with the suggestion of Python, but because you can write simple scripts in it at first without much clutter more than anything else.
IMHO, the fact that a language is object oriented should be a negative factor when assessing programming languages for beginners, and it should be more negative the more necessary the OO becomes. Beginners to programming should be learning concepts like data, functions and simple control statements at first. Then they should learn about more advanced concepts like indirection, abstract data types, etc. When that's all under their belt, then they can use OO, advanced module systems, yada yada.
Introducing window dressing like OO features any earlier is a recipe for producing crappy programmers. Far too many academic institutions that should know better have kindly demonstrated this for us in the past few years, by adopting possibly the most inappropriate teaching language in history as their default choice.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
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.
Programmers should know how computers work and today's breed often knows less about what goes on inside of object systems than they should. Send them to class to write one in assembly.
This is my sig.
- There's a lot of conceptual baggage. Examples: "You need a class to hold main", "you need a special operator new" (as opposed to a class method), "Classes aren't objects" (why not?), some variables aren't objects (they're ints and friends), etc.
- Java requires type declarations, including exceptions declarations. This means that the type system has to be introduced very early, and understanding of exceptions has to be introduced early.
- Java needs compiling, and thus gets a slower development cycle. There's (as far as I know) no Java shell where you can play with Java interactively. And even if there is, Java is generally so verbose I think that would be practically useless.
- Java is single model. There's only object-oriented code. Yet, beginners' code should usually be linear (do this, do that), then introduce conditions, and then (probably) introduce procedures/functions for organising code, then build methods on top of the basic concept of procedures. In Java, that's all wrapped up in extra conceptual baggage, as Java forces you to declare classes everywhere.
- You want to work with containers (collections)? You have to mess about with types and typecasts.
- Java is VERBOSE, making it hard to read. As an experiment, I converted a Java 2 Collection example to Ruby. The example contained 518 bytes of variables names, comments, and constant string data. To this, Ruby added 273 bytes of "overhead", landing at 791 bytes. Java had 972 bytes overhead, landing at 1490. In other words, excluding the parts that had to be there, the Java code was 3.5 times larger than the ruby code - in other words, 3.5 times as much clutter.
- Java isn't too hot at doing the things that is simplest to do real stuff with quickly: Text processing and systems administration.
"Runnable on any platform" is irrelevant for a beginner. It's also only true for restricted values of 'true'."Enterprise level" is irrelevant for a beginner, and nobody should (in my opinion) be doing enterprise programming before they know at least four or five languages.
Note that I believe Java to be a very good choice for large scale development. I just think it's inappropriate for beginners.
Eivind.
Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
Excellent reply, and you have brought up a few issues I didnt think of;
;)). I've learned a good bit from your reply, and you obviously know your stuff!
;)
The second problem is that Ada is both strongly-typed AND allows generics. That mix doesn't work well. Either have something that is strongly-typed and enforce that decision, OR use weak-typing and strong constructional rules. Mix-and-match leads to programs that are hard to read and harder to debug.
The third problem with Ada is the ability to override in ways that are transparent to the coder. A * operation may or may not do what you expect - and you have no way of knowing by looking at the source. It depends on what could override the operator.
These two things have definately brought back the horror of ada to me. I was one of the students who stood firmly against it until all the lecturerers claimed what I recited in my reply. It sounded good to me; but i have not finished my course - and so not as experienced (and no doubt easily swayed
p.s. Sorry forthe fanboy remark!
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.
I like Python for its clean and simple, while still somewhat string, syntax. The OO is a bit clumsy, however.
Java has good OO concepts, and a widely spread and known syntax.
Perhaps Jython, the Python interpreter running inside a JVM, would be a good combination for leveraging the best of the two environments?
all major languages share the same if-then-else-switch-function syntax. it is basic programming logic that should be taught. the problem with so-called 'high level' c#, c, and java is that they rely on primitive memory + i/o minutiae that detract from basic programming logic. vb is 4 verbose retards (learn 2 use {} instead of begin + end people!).
the best language to teach is javascript. every browser uses it and the basic programming logic can easily be transferred to other (more primitive) languages like c#, c, + java.
cheers, IJH, M.D., Ph.D.
"If a woman shall testify, her testimony shall be given half the weight of a man's."
--Q'uran
I didn't find basic particularly rewarding.
Fortran didn't do it for me either.
I found that once I got in to Turbo Pascal I could get it to do useful things. I built a circuit board to connect to the parallel port on a 486 PC and had a go at writing code which would maniupulate the I/O . You could watch LEDs change state according to the I/O port states.
That was a nice way to learn some simple structured programming. Even simple stuff to make things happen on the VDU was rewarding.
Caveat - I don't program, though I am interested in learning more about Turbo Pascal, C, OPL and Python.
As for ".net" and "VB", they seem completely useless to me but then I'm not an MS Window's fan.
My hyperlinks aren't worth the paper they're printed on.
I'd suggest not using any graphical development environment at first. The first thing I learned was VB and I found I was learning the application more that I was learnign how to program. So for very simple early programs ( that aren't likely to be more than a couple of hundred lines anyway) I'd say stick with a text editor and the command line.
You are so boring that when I see you my feet go to sleep.
The point is that RealBasic has a nice mature evolved interface where a kid can drag a button to the window, write a bit of code, and BAM they have a working application.
Shouldn't the purpose of taking a programming class be to learn to program not drag and drop? Only once a person can program should they then use an IDE, be it language specific or general purpose.
FalconShould there be a Law?
Add my vote for Python. It's free, full featured enough to teach all but the most complex aspects of programming, it has a syntax that everyone - even non programmers - can understand, it is cross platform, has good documentation, did I mention it's free? Its ideal
Hey, no worries. I've even been accused of voluntarily going out into daylight! (Hey, it was necessary to get to the scifi convention. :)
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
To learn it simply:
just memorize the 'public static void main' but, its the same every time, it will be explained later. The class is the program. Its not truely correct, but it works.
Strings and normal math is already integrated, its dirt simple to use (it looks like math equations like in a math book, its not hard (except for math.pow and such, but thats not that relevant))
Also, there is nothing wrong with it being verbose, its easy to read, though it takes a long time to do so.
Since when does a beginner programmer do system administration? They want something that can be powerful, and have the ability to take them far beyond simple 'beginner' languages that are often used (Pascal, Turing, VB6) because those are ass crap.
Compiling a small java program takes about 1 second, compiling is irelevant, and there are good free IDE's (such as JCreator or Eclipse) that are very good, and make it graphically oriented. They even have templates for new simple java programs.
Java is very english-like. Beginners write small programs, that dont need many resources anyways, so all arguments against size of overhead and such is really not that important.
Plus, Java is the only language to be used for the AP courses that US universities offer. That is a real tangible bonus to learning Java. Java is taught as a first year bginners programming course in university. Java is not hard to learn.
I would NOT touch C++ at the novice level - way too much packed into it. Java is lighter and more modular, which is a better design practice. Teach by example, not just by examples.
When I first learned C/C++ C was a preq of C++. Concurrently with C++ students could take Advanced C. For Adv C we used K&R's The C Programming Language. While I liked the book I wish there had been problem solving questions in it. Especially now a days I need to be able to practice and be able to look up a solution if and when I have a problem. Of course it doesn't matter so much when taking a class but I've had the same problem in other languages and not all professors or teachers can or will readily help students.
FalconShould there be a Law?
it's REALLY simple.. from there we moved onto C++.
not flaming, note author's question regarding to FIRST language...
here's some I DON'T recommend: Java, Prolog, or Scheme
"Persistence is annoying success." - ghee22 11:28:1999 - 10:53:PM
Take this with a grain of salt...
At my HS (which IMHO, has a superb program), the intro CS class uses Netlogo, Dr. Scheme, and Python. There's also an intro programming class which uses Python. (The CS is mandatory & 1 term, the programming is elective and 2 term (full year))
After the intro, the AP class is in Java (College Board gives the exam..no other option) and subsequent classes are in C or Java.
The Scheme unit in the intro was difficult, but it pays off in its coverage of recursion, which makes covering trees and state-based searching easier in the AP class.
And no, doing some silly FPS scripting language is not going to help with actual programming (The other way around is quite possible, however) unlike someone said earlier. Quite possibly the most engaging thing in HS CompSci classes are the (relatively) free-rein programming projects, especially once said students have the resources to create (simplistic) games--entertaining projects make for deeper exploration of what an environment is capable of.
Add another vote for python. Python makes the simple things simple, and the hard things possible. Here is your hello world program in python: print 'hello world' Doesn't get much simpler than that. But you want to do strings, lists, arrays, dictionaries, objects, and whatnot? Python's got 'em, and they're easy. And since the object model is pretty similar to C++ and Java it's easy to pick them up later if needed. These days I'm writing a lot of my app code in python, and then optimizing that if needed, and as a last resort dropping into C++ for more speed. I agree with other posters that assembly and C are great to learn at some point, but I disagree they should be taught in a first course. A first course should be about making some things happen, getting to see that they can make computers do their bidding, and learning some fundamental concepts like preconditions, postconditions, etc. Throw some graphics in there (pygame or one of the turtle graphics libraries maybe) and you've got some fun stuff.
First get an Apple II and in a single class period, give a demonstration of writing and testing a modest program in assembly language. This will be their history lesson. Explain to them how every lesson after this will demonstrate the progress which has been made in the 30 years of popular microcomputing. Emphasize how the majority of these changes are the result of two companies: Microsoft and Intel. [I know. But hear me out!]
Then for the remainder of the semester, teach them what the process of developing a modest Windows Application in Assembly language really looks like.
They will learn to profoundly despise segment registers, interrupts, GUI's, mice, registries, and anything related to the abyssmal hardware/software combination we refer to as "Wintel."
They will be properly convinced from this look under the hood, that today's status quo of computing really is evil and must be overcome. They will understand that as a whole, it is not progress at all.
This is the most important lesson they could learn about modern computers. After which, they'll go out into the world with a vengeance, determined to make a difference - and some of them actually might!
On the last day of class, impress upon the students that the 25-year old Apple II which you demonstrated is still far beyond the skill level of the average computer users of today.
I couldn't disagree more strongly with the parent post. This sort of approach is exactly why so many schools now produce CS grads who can't program for ****.
Firstly, you assume all students want to do back-end web work. Personally, I can't imagine anything more dull, other maybe than writing trivial front-ends for databases all day.
Secondly, you speak as if teaching OO from the start is a good thing. Again, nothing is further from the truth. OO is only one approach, and it's one that has a lot of theoretical and sometimes practical flaws. If you teach a beginner concepts like functions, control structures, expressions and variables, then they will soon pick up the ideas behind OO if they study it. If you teach a beginner that everything is an object, then bad OO is all they will ever know until they learn that you lied. Languages like Java and Ruby are the worst offenders in this respect.
Thirdly, the idea of introducing a complex, specialised framework like Rails midway through a first term course is shocking. There is no way that anyone at that stage has even grokked the basics of programming properly in a simple language yet. Turning the course into a user guide for your favourite toys is doing them a gross disservice. As the saying goes: give a man a fish, and he'll eat for a day; teach a man to fish, and he'll eat for a lifetime.
Overall, I honestly can't imagine a worse approach than the one you're advocating. You place unnecessary specifics ahead of generalities, funky toys ahead of solid basics, and les fads du jour ahead of transferrable skills. It's perfectly possible to have a long and distinguished programming career while never using any of Ruby, Rails, OO, and web programming, yet these are the first things you think beginners should learn? That's no way to teach programming.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I'm sure this has appeared before on Slashdot, but after reading your post I couldn't resist:
Niklaus Wirth, the inventor of Pascal, used to tell this joke on himself: Europeans usually pronounce his name properly, "Nick-louse Veert", while Americans invariably mangle it to ""Nickles Worth". Which is to say, Europeans reference him by name, and Americans by value.
-ccm
Too much Law; not enough Order.
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.
I'd recommend ocaml before scheme. Despite a few syntax oddities, the code tends to be a lot more readable than scheme.
The intuitiveness of Java and the expressive power of Fortran.
If you're actually capable of teaching programming well to high school kids, please teach math instead. You'll almost certainly be far more competent than most math teachers, and you'll do the kids far more good. If they need programming and have any aptitude for it they'll pick it up for themselves the way most of us did. But if they don't get taught math by someone who understands it they'll never look at it again.
Let us face it: Script languages are not worth teaching to unexperienced students. As they only detect few programming errors during compile time, students are frustrated by being exposed to debugging before having understood anything.
IMHO Pascal (or even better Modula-2) and the ML flavors (SML, OCaml) are great in teaching people how to program in a clean way. Especially ML compilers detect as nearly as much errors as a plain compiler may ever be able to find. Also ML and Pascal are well designed languages offering plenty of orthogonality and thus are easy to learn.
Smalltalk. Once you can structure your solution to a problem, translating it to some otherwise brain-crippling procedural language is less harmful to self and solution.
Since when does a beginner programmer do systems administration?
Since Unix machines got common among hobbyists.
They want something that can be powerful, and have the ability to take them far beyond simple 'beginner' languages that are often used (Pascal, Turing, VB6) because those are ass crap.
Beginners are not qualified to evaluate how to learn best. I last programmed Pascal in 1991, and Turbo Pascal as of then had some teaching advantages compared to Java (no need for exception declarations, avoid the == vs = problem that's common for beginners, can do objects but isn't forced to). VB6 has the advantage that it's quite good for doing quick integration tasks and getting stuff done - which is what you seem to consider important above. The language itself is crap, so I wouldn't choose it to teach with, though. I have no opinion of Turing - I've never worked with it.
I've taken money for programming in Java, VB6, Pascal, C, C++, Perl, Ruby, and various assembler languages, which makes me feel at least somewhat qualified about those ;)
Compiling a small java program takes about 1 second, compiling is irelevant, and there are good free IDE's (such as JCreator or Eclipse) that are very good, and make it graphically oriented. They even have templates for new simple java programs.
I said interactive use. You know, like a shell where you write code and have it executed at once? As in Smalltalk or Ruby or Lisp or Scheme or sh?
Java is very english-like.
Excuse me? First of all, this sounds like a halucination (Java has a C-like grammar, with operation reordering compared to english and symbols instead of keywords for a lot of structure), second, it's not at all relevant. We tried out that with Cobol, and it didn't make learning any easier.
Beginners write small programs, that dont need many resources anyways, so all arguments against size of overhead and such is really not that important.
Except when I'm doing embedded systems programming or games, I (almost) don't care about overhead anyway. I care about the stuff that Java has added to support programming-in-the-large - such as static type declarations, declarations of exception signatures, the difference between integral and object data types (done for performance), etc.
Plus, Java is the only language to be used for the AP courses that US universities offer.
Yeah, that's a tangiable downside. It means that they end up learning one instead of several languages. All programmers should know at least 4-5 languages, to get more ways of thinking about problems.
Eivind.
Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
A little late to post, but consider the Squeak SmallTalk as a great teaching environment. I'd also second any notion to consider Python and/or Ruby. Ot better yet, teach them all. Good Luck.
Game Maker is actually a programming environment. It is free as in beer (or milk if it is for kids) unless you want the extras. It is used by Prof.dr. M.H. Overmars of Universiteit Utrecht as the basis of course on game design. The students think they are learning how to make games but what they are actually learning is event driven programming. It might be more fun to learn to program in this environment, especially for kids, and not just for boys. My kids are right now quite addicted to GameMaker. Even 5 years old Jonatan can design a bit with the help of 11 years old Daniel. Daniel is just making games most of the time this summer, and learning programming on the way (last year he learned Logo, and also VB at school, but Game Maker is much more fun...).
It is aslo a useful cure for GOTO, and has an add-on object module. The language is also available for free from different sources.
OS/2 - because choice is a terrible thing to waste.
If the request to change the Daylight Savings Time succeeds then the opportunity for the students to gain meaningful summer employment could be met. In addition, it is an easily understood language and reads more like text than a program. High level language concepts hold up well and the language was used by the US military for years and continues to run thousands of business applications worldwide. Supports goto (but rarely mentioned or used), subroutines and period for end of line. Encourages documentation by natural language coding and formatting of variables must be defined in advance of code.
Assembly is the only choice if you want any of these kids to grow up to be real programmers. There is a significant gap between programmers that learned assembly 1st and those that learned high level languages 1st. For decades there were rumors that BASIC or Pascal caused irreversible brain damage and now that seems to apply the latest generations of ivory tower languages.
I don't even think you need don't even need computers at all for much of a decent programming class. My high school had a FORTRAN class and some a few classes on BASIC. With FORTRAN you had to punch the cards and you got one run a day while the BASIC people would tweak things till it worked. With the FORTRAN class you had to think about the problem 1st which is what you want to teach.
All of the best coders I know spent lots of time in assembly very early after they learned to code. Its the only way to fully understand what a machine has to do and that lets you focus on the real costs of that single high level concept down the road.
My Girlfriend recently asked me to show her how to do this "Programming Stuff" I do for living. After some research, I decided to teach her some Python. I am quite suprised how well she has grokked it. She has already started writing a small schedular app(on her own..) Also, you can find some nice training videos here Another on language that I would recommend is Transact SQL. I know DB's aren't that sexy, but it's quite a powerful language in terms that you can do a whole lot in a few lines of code. Besides, anyone who wants to code for a living needs to understand how databases work. Plus SQL strikes a nice balance between procedural and functional programming models..
Anyone ever used Eiffel as a OO language? My Uni was using Eiffel to teach OO concepts and it is very nicely designed for teaching. Testing concepts are strongly enforced by the language itself. Didn't like it at first but became hooked on it.
It is a good thing there are less and less people coming into the programming world. There are really too many people who should not be in it in the first place. If they are not smart enough to learn any programming language and use it then they do not need to be in our field.
It's rather screwed up and good to bash, but if you are able to learn about good government from it, you're half way on your journey to understanding most political systems.
:).
I bash BASIC a lot, but as many posters have said a hell of a lot of us started out using BASIC and those who didn't run for US Congress went on to master a hell of a lot of other languages which our contemporaries never got to grips with.
I think that BASIC is not a bad language to start developing with ( the 'B' does stand for 'Beginners' ), however I'd have to exclude that whole subset of languages which are pre-fixed with 'visual.' I'm quite certain that I'd be another 9-5 moron had I grown up clicking all over the place.
I'd usually suggest the following languages to beginners:
i) Java - If you can start out with Java, you start off with a decent head-start in understanding o.o. and data types.
ii) Perl - If you start with perl, I think that your guys will be off the ground quicker than with most other languages. The degree of delving into O.O., regular expressions or anything else which you add is up to you.
I'd also advocate PASCAL, Python.. or Jython. Or BBC BASIC V
That said, I used to be bias against Java as a learners language, until my techno-phobe sister took a class in it and seemed to understand what she was doing. She now develops in C and Fortran.
Just my 0.02 Euros.
Turing (www.holtsoft.com) was specifically designed to teach programming concepts. It's a very "easy" language and you can do graphics stuff right away which I think can really help bridge the gap for kids. This language is mostly used in Ontario to teach programming. Check it out.
The key to teaching teenagers programming is to give them assignments they'll be interested in. Picking a language that they might actually use in the real world is a close second, and that rules out the 2 languages you've chosen. With the possible exception of Borland Delphi, which seems to be slowly dying.
Python with PyGame is the way to go. All programming concepts can be taught through games. And when they're done with homework, they may actually continue to expand the programs beyond what was assigned. The value of this can not be under estimated.
Of course I am biased. I learned to program because someone told me that was how to make games. That's all it took. I wasn't interested in code or abstractions or anything - until I needed them for some game features. Every programming abstraction has a practical use in some game. Python I just picked up last year, but I really like it so far. PyGame? Looked at it, but haven't used it yet. It's SDL for Python - and I've used SDL with C. PyGame - Great idea for making games.
WTF is this Modula 2 stuff? I've never even known anyone who used it for anything. Really. Honest. And I write software for a living.
The language structure is not a criterium. Neither is the purity of it's object-oriented concepts, or whatever.
I would bet on the language that can make a kid construct a program with visual effects with the least keystrokes and mouse clicks. Please note that I do not want to make any allusion to Visual-Studio family of developer tools, I don't think it's necessarily the best way to start learning programming.
For example, I learned computer programming on Basic on the Apple II computer. I just had to type something like :
GR (to switch to 40x20 graphics mode - damn big pixels !)
COLOR 4 (purple)
PLOT 0,0 TO 10,15 (draw a line from 0,0 to 10,15)
Note that I just had to push the computer switch on and start typing the three commands right away.
I read some comments here from people suggesting Java. Are you joking ? How do you expect to have time to explain your kid that he has to create a class, then he must declare a public static void main(String args[]) function, and next he has to compile his program ; before he runs away and starts playing Nintendo ?
Besides, there is a strong correlation between a person's pretention that Java is the solution for everything and the inverse of the number of languages that person knows well. And that's the same for any other language.
I think the language must be an interpreted one, and that the only way to get someone hooked to programming is to have the possibility to draw things very easily, without having to install additionnal modules that we are only able to understand once we learned all the non-visual features of the language.
It takes a big deal of maturity for appreciating a black and white console, and programs only using this as their output.
... Ruby is. (Rails a web application framework written in/for Ruby.)
I love Ruby, but Ruby (and probably Python) would not make a good first language. Ruby has a lot of features which are great for the productivity (and sanity) of an experienced programmer, but might prevent a beginner from learning everything they need to know. That is, programmers trained using a high level language like Ruby might have a hard time moving back to a lower level language (C or even Java - both still necessary skills).
chown -R us ~you/base
I have taught intro programming classes in VB, C, C++, Java, C# and Pascal. VB is clumsy and it is awkward to say some things. Besides, the .Net version looks too much like C#.
C# and Java are interchangable in this sense. Java wins by portability. But you have to jump a bit into the deep end. I have to explain OO programming almost before discussing variables.
Pascal has too many types.
C and C++ are great languages but it's a bit like teaching intro to wood carving using chainsaws.
I have only looked a little at Python but have a hard time getting by the use of whitespace as syntax.
So I suggest JavaScript (or ECMAScript).
Everybody has the development toolset already on their computer. The console in FireFox is handy for error discovery. Working in a web page is more fun than most IDEs. The basic syntax is the same as C, C++, Java and C# so the skills carry over. Pretty weak on OO programming, though.
Good discussion.
You knew the job was dangerous when you took it. -- Super Chicken
Oh, come on, the obvious choice is clearly the BrainFuck language. I mean, what High School student in their right mind wouoldn't take a course with the F-word in the description? And it's such an easy language, too - it only has 8 commands!
+5 Funny because it's true.
I did have some experiencie with GW-BASIC and then QBASIC when I was a child, and when I started Computer Engineering we were taught Programming Methodology with Modula-2, a complete educational-oriented language very similar to Pascal.
:)
Then, 2nd year we had C, we had Functional Progamming, Logic Programming, Assembler and so on, but I think Modula was a good start. It was easy to learn, you could do fun things, you could switch to Delphi with no pain and start doing things for Windows, it had abstract data types, encapsulation, pointers, and so on. Of course we didn't learn all this on first year, but we could stick with Modula as our programming abilities were improving, and reached a point at which we made concurrent programming with a special version, CC-Modula.
I think I may say I am a good programmer right now because of Modula. Functional programming with "Hope" helped too, and then I met Java and C# and felt in love with automatic GC.
Pascal is very suited for learning to program, but it is not used in real life.
.NET and Java and much, much more powerful. E.g. You can write drivers, operating systems and everything you want with C.
.NET syntax is very similar and easy to learn if you know C++. It's easier for a C++ programmer to learn Java and C#/.Net than visa-versa.
I think the best language for beginners is C.
It is probably the most widely used language in the world, but is still easy to start with since it's very pure and simple. Just think about the classic "hello world". At the same time it is extremely fast compared to
You can find c-compilers for all kinds of processors and operating systems. I stress this: All kinds...
Also, you learn the difference between the heap and the stack, pointers and so on.
When it's time to learn about object-oriented programming, just build on top of C and learn C++. The Java and
These are facts, not just opinions...
I would say the language Boo. It's fun like Python and relatively quick and crossplattform like C# with Mono.
:-)
And, if you ever get a job involving C#, you can write in Boo, and convert to C#. Beautiful!
Boo is the future!
I can only give my opinion from what I've used; being a high school student won't help much here. I've done some basic work with C++ and moved on to AP CompSci, using strictly Java. C++ was very easy to use and program. Might I add that I didn't even work in creating classes but rather implementing several functions in one class. When I used Java, I found myself having to code more strictly, and I wound up using indents to my advantage. At the beginning, though, I found classes and using objects difficult to understand, but I also never studied and rarely listened to the teacher (I don't know how I pulled off a 4 on the AP test) Towards the end, I began to enjoy Java more than C++. But don't forget, it IS just a personal opinion, and I never deeply explored both languages. As for PHP... yeah. I wouldn't recommend it unless you were teaching a web design course. And if you are, then hopefully it's part of a multiple-year program. HTML and CSS would be the first year (obviously)
Best language there is for programming.
Open Source Drum Kit, LPLC deve board - mjhdesigns.com
Back when I learned it was COBOL, FORTRAN and IBM System 360 Assembly. Technology has changed since the 1970's but ther basic concepts have not. I would suggest that you teach the basic concepts and explain to the students that you will use a couple programiing languages to ilistrait the concepts. Students should walk away from the class knowing that learning the syntax of some programming laanguage is NOT llearning to program. This is actually a hrad concept for beginners. But once they learn the designing a program and writting the code are two seporate things they will be better off. So I'd suggest you need a small handfull of languages and show how they differ andhow each is usfull for differnt things
I got my start by drawing shapes in Logo. It was easy to learn basic programming logic without forcing the use of advanced language features. I suppose you could do the same thing in C, but the visual feedback of Logo was more fun. Eventually, I wrote a simple black jack program (drew cards, bets, etc.) all in Logo.
DO NOT USE JAVA! I instructed an intro non-major programming course in Java for college students. It was horrible! IMHO, any language that requires OO is too complicated for beginners.
Lots of languages can be used to teach programming... however I advice C# for the following reasons:
- State of Art Object Oriented Programming Language (especially the vers 2.0 coming out soon)
- It's a standard! This is important.
- Through Mono it is multiplatform
- A kid who grasp C# can start make money very quickly, because company are looking for C#ers.
- It has few keywords so can be learnt as "core" language, but has huge number of libraries... so you can do basically everything.
Make them a favour, go for C#!
TURTLE!
Beep. Turn left. Beep. That's all you really need to know...
I think something similar to php would be a far better choice than anything platform dependant.
I am Bennett Haselton! I am Bennett Haselton!
As a college profesor that has taught Java to beginners.. I suggest Python. Students have a real hard time with
public static void main(String[] args) {
}
they also can't understand why they start out with so much code.. if you try to hide this.. you end up with mickey mouse programs that aren't real world (and they complain about it). Also, the compiler is a pain to deal with. Static typing is also a distraction for the beginner.
Python however requires much less of you initially, but then scales up. And it is easy to move to Java or whatever after you've mastered the basics of programming.
Why are you talking about Java? No one in this thread suggested Java was any good: it's not.
The problem with Python is that even if the primitives are objects, the language is designed as if they were made objects as an afterthought; eg: why do you write abs(-7) instead of (-7).abs?! (If Python were elegant, you wouldn't have global identifiers like abs().)
Yeah, you're right, because Ruby's Perl lineage brings the noise. The problem I always have when programming Python is that I can never guess how to do something in advance: sometimes the library provides a function, sometimes a method; sometimes the identifier is abbreviated, sometimes it's not. In Ruby I'm guessing the up-front learning curve is higher but there is more regularity in methodology.
:(
What I really want is a language with the pureness of Ruby and the clarity of Python. It appears that the more evolved a language is, the more popular it will become, so we'll always be stuck with crud.
In my opinion, the best procedural programming language, by far, for beginners (or anyone else for that matter) is Rexx. http://www.rexxla.org/
No one (except possibly a terrorist that we NEED information from) should be subjected to Perl.
-- Each tock of the Planck clock is a new world and here we are still life. --
Start students with a language that imposes a structure and methodology so that they solidify good coding habits.
Yes, as some people have stated, for practical purposes, a language that teaches good habits doesn't necessarily fit the task well in the real world. Give learning programmers (aka students) a solid foundation built upon solid 1st principles of software development and programming and we'll all see much less of the BSOD and maybe people
I've taught programming and a large portion of students didn't even have fundamental problem solving skills. For example, I gave an exam and included a new function on the test, pretty simple one AND they had open access to the help files. Guess what, NOT ONE OF THEM LOOKED AT THE HELP SYSTEM. They all just complained they'd never seen the function before and this was after putting a statement about freely using the help system at the top of every page of the exam and talking about it the day before the exam.
Guess they all were suffering from hangovers and didn't remember what I'd said and didn't read the exam paper either
With regards to teaching students programming, make it fun, make it practical (yes even with PASCAL for example you can do both) and above all let them experiment and cultivate those who wanna go outside of the curriculum.
Scientia et Potentia