Best programming language for a web design class?
September 10, 2009 5:07 PM   Subscribe

What programming language should I teach my kids? (web dev)

I've got about 20 interesting and enthusiastic highschool kids in a web design class. I'm having a blast teaching them, and so far we've covered some of the basics(html, css, and trappings of JS).

We're going to be on Javascript for a while, but at some point we're going to move on to a little database stuff and I want to be ready.

My own personal background is in PHP, but I've played with ruby and done a decent amount of work in python. I've also read that lua is a good choice, and there are some interesting MVCs in that area(plus Lua's syntax is similar to JS which I like).

Really though, I want to avoid running around in circles. So what programming language should I teach my kids? Lua, python, ruby, php, something else entirely?
posted by satori_movement to Computers & Internet (25 answers total) 8 users marked this as a favorite
 
If you're going to use Ruby use a more lightweight framework like Ramaze instead of Rails.
posted by PenDevil at 5:11 PM on September 10, 2009


Python. It's easy to read and write. It's reasonably close to, but simpler than javascript. And it comes with ton of useful modules. Off the top of my head, I'd recommend web2py - but you may want to have a look at django & possibly Google App Engine (there's got to be some coolness factor to using Google's stuff for kids :-)
posted by aroberge at 5:21 PM on September 10, 2009


Why's (Poignant) Guide to Ruby is a cute, accessible guide to the Ruby language (mirror, because the original is offline) and/or Hackety-Hack (also by Why, not mirrored, that I know of), but both seem to be gone following Why's retreat from the 'net.
posted by Alterscape at 5:27 PM on September 10, 2009


Python and Django. No question.
posted by i_am_a_Jedi at 5:43 PM on September 10, 2009


PHP is ubiqutious and has a massive pool of available applications and code, but can be quite messy and confusing, and many codebases don't exhibit anything close to best practice...

Python or Ruby may actually help promote better programming practices, but they aren't as accessible as PHP in terms of examples, online docs and tutorials, and hosting is not as easy.
posted by sycophant at 5:44 PM on September 10, 2009


There's also GWT, which might be worth a look (it's cool, it makes cross-browser RIAs a lot less headachey). However, it might be a bit too complex for beginnerish high school kids. You'd simultaneously be teaching them a bit about Java (with the ability to leverage what they know about Javascript).
posted by axiom at 5:45 PM on September 10, 2009


Start with HTML/CSS and programming fundamentals, individually. Then you can move on to integrating them. You should cover both server-side and client-side coding at that point.

Any "Web-based programming" is the wrong way to start.
posted by vsync at 5:50 PM on September 10, 2009


This is a bit odd but if you just want databases you could use CouchDB rather than a full server. It's not relational so you wouldn't be able to get into conventional database theory but if you just want storage then it's well capable.

If you really want server-side programming then Python is nice on the eyes, and a framework like Django would get them to think about abstractions.
posted by holloway at 5:57 PM on September 10, 2009


@axiom: GWT is nice software (as is Pyjamas) but I think in this case it wouldn't really build upon the HTML/JS knowledge they've got.
posted by holloway at 5:59 PM on September 10, 2009


As a PHP programmer, I'd recommend against PHP because it lacks an underlying philosophy, and has a million WTF?! edge cases that you'll find difficult to explain to the students other than "that's just the way it is".

Python or Ruby are far better structured, I think, for pedagogical purposes. You can immediately do useful stuff in them on the web, and as they get into it, the underlying theory will be useful to explain why things are like they are. The 'cleanliness' of them would also help, I think. And as you advance, the path to more advanced topics like OOP and functional programming is obvious.
posted by fatbird at 6:08 PM on September 10, 2009 [1 favorite]


Nthing Python. Think Python is a good free book for reference. It'll give them a good sense of programming basics and debugging that they can later apply to loads of other languages.
posted by dayintoday at 6:37 PM on September 10, 2009


Karel! I wish someone would have taught me Karel earlier and not spent time making us write sorting programs in BASIC.

I would think you would benefit more from Karel and some soft programming concepts and a hand holding session through an IDE like Visual Studio would probably go a long way. I would argue that for high school kids that may drop this and pick it up next summer, it would probably be more beneficial to get them acquainted with an IDE they can install on any computer and get running quickly. For better or worse, Microsoft makes it very easy to not only get it working quickly, but to have everything there and just press the green button. Not that getting Eclipse with Spring and mySQL would be a difficult task or any of the other solutions, but from a pedagogical perspective I'm in favor of the solution that will allow them to get going as quickly as possible without having to worry about cruft.
posted by geoff. at 6:44 PM on September 10, 2009 [1 favorite]


Response by poster: Lots of good solid advice here.

I hadn't heard of GWT or Karel. GWT is pretty sweet, but I think java might be a bit much. Karel is neat but I really would prefer to teach my kids a more widely adopted programming language.

I felt similarly about PHP, in terms of it being too complex, and I think people are right in saying that python/ruby is a better option. Of the two, I think python would be better for the class as I find py to be a bit more generally useful than ruby, and its performance is better.

What about lua for web programming? I like lua's speed, extensibility, and the fact that it is often embedded in many applications(wow for example). Of course, I know lua isn't as popular as python or ruby(right now anyways), but I can envision a time in the future when it is more widely adopted.
posted by satori_movement at 7:40 PM on September 10, 2009


Lua is nice but I don't think it'll escape the embedded language niche.
posted by holloway at 7:42 PM on September 10, 2009


On preview: I don't know anything about Lua.

Python. You can run apps using Django for front end templates on Google's App Engine pretty easily. Here is their tutorial.

The other reason I recommend Python is that it has a shell that's quite easy to use. (Just type 'python' at a unix prompt.) Other languages like Java are better for larger programs, but when I prototype something I use Python, and particularly its shell. Your kids will be doing something like prototyping, so this is the language I recommend.
posted by A dead Quaker at 7:46 PM on September 10, 2009


The problem with Lua is that it doesn't have a killer framework to go with it. Ruby has Rails, Python has Django, PHP has Drupal and a couple others... Lua's got nothing.

Imagine the feeling a kid will get when she understands enough Python to start making use of Django (or Ruby and Rails). She'll see what she can do multiplied a hundredfold, and I think nothing excites kids more than making something happen.
posted by fatbird at 7:53 PM on September 10, 2009


I would definitely second Python here, it's a great teaching language, and there are lots of resources for the new programmer learning Python as a first language.

Hackety-Hack (also by Why, not mirrored, that I know of)

http://whymirror.github.com/
posted by me & my monkey at 9:08 PM on September 10, 2009


Lua is nice but it's not a powerhouse in the web space. It's mostly a hit with embedded people which is a radically different world than web development. Python and Ruby are both nice choices. I like Python better but I admit it's just a preference.
posted by chairface at 11:06 PM on September 10, 2009


Best answer: I agree with those saying Python and Django. However, you might also want to consider Groovy with the Grails framework. Groovy is a scripting (almost) superset of Java, that runs on the JVM and can access Java libraries. This means that there is the potential to transition into Java if any of your students are interested in doing that down the road. It's an easy language to learn, heavily influenced by Python and Ruby.

Grails is the MVC framework built with Groovy. You can run Grails apps on Google App Engine if you want.
posted by Who_Am_I at 6:23 AM on September 11, 2009


Response by poster: Oooohh, groovy is a very interesting choice. I hadn't heard of it, but it does seem like a really good compromise.

With regards to lua not being a powerhouse in the web space, has anyone here heard of kepler? Its an MVC written in lua with an integrated web server, or it can be used with apache.

I'm really torn. I want to teach my kids something fun(ruby, groovy, or lua), something super useful(python), but also something likely to still be significant in the future.

Personally, I used to think java's days as a cutting edge language were behind it, but groovy looks like it might stir things up.

I guess I'll do some more research this weekend. Thanks for all the advice so far, I'll keep checking back in case more people have ideas.
posted by satori_movement at 7:30 AM on September 11, 2009


You may also want to have a look at Perl. The Catalyst MVC framework is very very nice, as is the Moose OO system, not to mention the excellent DBIx::Class ORM.

There's a lot of really grotty Perl floating around out there on the web, and the reputation of the language isn't the best here recently, but the tools I mentioned above give Perl a really nice and powerful OO system that's better (IMO) than any other "mainstream" language other there.
posted by genehack at 8:00 AM on September 11, 2009


Karel is neat but I really would prefer to teach my kids a more widely adopted programming language.

Karel is meant as an introduction to OOP principles and the idea of using reusable objects, along with a soft introduction to basic loops. It is meant for an introduction into some higher concepts of programming without getting mired in syntax that might otherwise distract the students. The idea is that the principles taught in Karel can easily be carried over to another programming language (it is basically Java-lite and thus makes it a great introduction into the general program structure of Java/C#).

So Karel has only four initial "instructions," move(), turnleft(), pickupbeeper(), putbeeper(). Ignoring the last two, you notice that karel can't turn right out of the box, and it can't move backwards. You have to extend Karel to do these things. So if you wanted to turn right you'd write something like this:

public class superKarel extends Karel {
public void turnright() {
turnleft();
turnleft();
turnleft();
}
}

And you can see that very simply they've gotten the idea that they have something out there called Karel and they can extend its functionality. You can do all sorts of things, like instead of writing turnleft() three times, put it in a loop, etc. You can learn some really powerful and advanced concepts that I don't think are intuitive and certainly difficult when you're throwing them into a modern language. Here you have a soft introduction to some soft syntax elements (curly brackets, semicolons) without any studio.h junk. The whole thing should take two weeks tops to take advantage of everything it has to offer. Here is the instructor's guide to the book, notice how it is only 46 pages.

I just don't know how much you'd accomplish by introducing a complicated framework like Django to students who don't even know Python, there'd be a lot of hand waving and "accept this," and I don't know how much they'd take away from it. Things that make web frameworks so useful on large projects, like compartmentalization (middleware classes), internationalization, authentication, mapping databases to objects, are only things that really become important on larger projects and are often more work than they are worth to implement on anything smaller. For example, Apress's ASP.NET MVC guide is great but it makes several assumptions, that you already understand OOP, that you understand C# syntax, that you understand and have a familiarity with .NET, and that you have an understanding of Linq. Not to mention things that it introduces like Lambda expressions and expects you to at least pick up on fairly quickly.

I wouldn't expect such things like design patterns to be taught until you're at the college level, and even then towards the later end of a under grad degree. I say this as someone who took a class on programming in high school that used MS Visual Studio 6.0 and tried to do similar ambitious things. We ended up just going through tutorials and examples like monkeys, not understanding how things worked. I didn't understand what was going on, and became frustrated that I didn't *get* what I was doing, and subsequently gave up on computers and programming through high school and college.
posted by geoff. at 8:03 AM on September 11, 2009


Response by poster: Geoff, thanks for your input. I really appreciate your perspective.

I completely agree about the perils of introducing a complicated framework to highschool students, I will heed your warning carefully.

Truthfully though, I don't think its a stretch to try to take on something like python or ruby after having dipped ones feet into javascript. I'm going to use JS to teach them some of the basics, and then when they are clamoring for more server side control, I'll slowly introduce whatever web programming language I decide on. Finally, once they understand the basics of a language, we'll dive into a framework. This will end up being a 2 year class, so I don't think its unrealistic as long as I am patient.

I understand the purpose of languages like karel, but in our environment, one where they've already kind of learned one programming language, I'm not sure how much sense it makes.

I asked this question on another forum, and there the cries for C#+asp were almost unanimous. Honestly though, if I'm going to teach them c#, I might as well teach them java so they can take the ap test.
posted by satori_movement at 9:04 AM on September 11, 2009


You might consider building on their javascript experience by using processing.js to do fun stuff client side, and jaxer to use javascript server side to do dbms stuff.

I happen to be of the opionion that functional programming is the next big thing in programming, so i'll mention:
Phil Wadler's links:
http://groups.inf.ed.ac.uk/links/

Also, Scala, especially with the Lift framework.
posted by at at 5:33 PM on September 11, 2009


I would suggest another dynamic language, recommend python for reasons "A dead quaker" mentioned. It's easy to read and learn, and not too far off from JavaScript.

Ruby is a good second choice (as is Ruby on Rails), but the syntax can be intimidating, and the magic that underlies Ruby is hard to understand for novices.

Scala has a strong academic bent and is really designed to be more of a heavy-duty language for professional developers.

Groovy is like a simplified version of Java, but IMO it's best suited for people who actually use Java. Grails is largely a veneer over much more complicated Java frameworks like Spring and Hibernate.
posted by kenliu at 7:16 PM on September 11, 2009


« Older Vegas, Breakfast, Football... choose three.   |   Photoshop Question: is there a way to get a count... Newer »
This thread is closed to new comments.