JavaScript as a first language
John Resig, jQuery creator, RIT alum, and Khan Academy developer, just made this blog post about teaching JavaScript as a first programming language at Khan Academy:
http://ejohn.org/blog/javascript-as-a-first-language/Seems like a pretty interesting idea to me. I'm beginning to find that JavaScript is one of the most important languages one can learn. My only hangup is the fact that knowing JavaScript without knowing HTML really limits you, so you really have to teach both.
Thoughts?
Comments
>"5" + 3
"53"
>"5" - 3
2
Parents: Tell your kids. Don't do Javascript.
I programmed a little bit before college, but my first real classroom experience was in college.
There we used Java. The advantages to Java is that it's relatively platform independent, it's a solid programming language, and it forces some (in my opinion) good practices through its rules. You could potentially jump into the deep end and build some big graphical projects fairly quickly.
That said, the class was still taught specifically for computer science and IT students and in what I would say is an outdated mindset. The vast majority of our grade was based on things like big-O notation and understanding what a hash was. From the perspective of a computer science guy studying computer science - a fair starting point. For the 50% of the class that took the course as an elective because they wanted to know a little bit about programming it was painful and they learned very little that will be practical in their lives.
Javascript as a first language for web-developers absolutely makes sense. Javascript for someone that is going to pursue a masters degree in computer science? Maybe not the best start. Javascript is an awesome tool, but it does some things that I think will confuse or lead to later confusion for developers. Some of my issues...
Different behavior on different platforms (IE web browsers vary in memory management - for example)
Asynchronous behavior (while this is sometimes easier to understand, I think it will confuse some people)
Less Built-in API (than using Java or PHP)
Lack of graphical things (not to say it isn't there, but it's generally not what I do in javascript)
I will also mention again that I think Javascript is awesome, and you "can do almost anything with it". In another thread I was the guy defending it with all the cool things (node.js for example) where you leverage its strengths. It's just not as good of a "babies first tool" as something else might be. If I have to give someone just one tool, I'd pick a knife over a spoon. Or ideally, that Chinese shovel/axe/pliers/thingy.
I don't think the browser implementation differences are all that important if you're using it as a first programming language -- you just teach the standard subset of the language that's browser-agnostic. Again, this reminds me of the old books on BASIC that I used to check out of the library -- they didn't use any platform-specific routines like graphics or sounds or whatnot and limited things to bare-bones, standard BASIC for the most part.