Earlier quoted context omitted.
These are all reasons why I've adopted CoffeeScript over JS. Sure, you can accomplish the same exact things in JS, but they are far more natural with CS and with far less typing. Less typing is less chance for mistakes and bugs and makes an easier learning experience. One other line item is the encapsulation of classes in CS. Doing that in CS is natural and easy to explain to a first year programmer. Accomplishing th…
Seeing as how one of the arguments for teaching JavaScript first is that it lets you teach about prototypical inheritance before the students get used to class-based inheritance, the complexity of simulating a class in JavaScript is probably not the best objection to using it instead of CoffeeScript. If you teach them CoffeeScript, then you will teach them class-based inheritance just like everywhere else, and miss o…
John Resig: JavaScript as a First Language
221–228 of 228 posts
Re: John Resig: JavaScript as a First Language
#222Earlier quoted context omitted.
> The reason Haskell is viewed as hard is that it takes basically nothing from languages you already know. If you don't know any languages, it's actually a great starting point. At my undergrad program, Haskell was used for the second CS course after the basic intro course. It was a nightmare and drove people away from the major in droves. They just did a curriculum overhaul and one of the changes the CS faculty are…
What are you doing in CS if Haskell "crushes your spirit"? Go study finance.
The students who were trying out the field but weren't born computer scientists were the ones who were miserable. It was their second course/experience with computer science ever and dealing with Haskell was extremely challenging for them. Being an internet tough guy about it doesn't help them embrace the field, it turns them off more.
Re: John Resig: JavaScript as a First Language
#223Interesting Idea. I know for me the way I learnt programming made me quite flexible and happy. Working the entire scale from functional to OO languages gave me a really good perspective for anything I face. I've learnt all the web stuff I use today completely on my own, but I use the foundation I learnt below. The "classic" academic programming languages I've learnt happened in this order. Basic -> VB -> Pascal (High…
I'm curious: which of the languages you listed do you consider "functional"?
Re: John Resig: JavaScript as a First Language
#224Earlier quoted context omitted.
I suspect Mr. Resig is familiar with the potential gotchas, and maybe even has his reasons for still believing it's still worthwhile. For my own part, as someone who regularly taught high school seniors (and other non-programmers) various programming languages (Pascal, Perl, Prolog, JavaScript, and Java) over a good chunk of the 1990s, I have to say that JavaScript worked out pretty well, possibly even the best of th…
I can see the advantages of JavaScript over Pascal, Perl, Prolog, and Java. Did you ever try Python? What are your thoughts on Logo, Karel, etc.?
I didn't try Python myself until late 2001, and by then, I was already more or less out of education, so I didn't get to try it out on anybody else.
But if I were guessing, I think the language itself would probably work pretty well for most students, possibly somewhat better than JS. Not sure how big the advantage would be, though (like I said, we really didn't struggle with JS's warts much), and I think the broad target for JavaScript's use give it something of an advantage too.
This would vary by domain, though. If I were trying to teach a number-crunching focused class, for example, Python would probably move way up my list.
Re: John Resig: JavaScript as a First Language
#225Earlier quoted context omitted.
Assume you've never programmed before. Would you want to debug a program that has a significant whitespace bug? It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace. Getting stuck and being frustrated hurts motivation a lot. Now curly brackets and syntax may be seen by a person as an irritation or inconvenience compared to whitespace, but I'd say it's better t…
""" It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace.""" Is it? Assuming you use a fixed-width font, any incorrect/inconsistent indentation should stand out like a sore thumb. More so than counting { }s in nested blocks. (Of course, decent editors help with both cases, so I think it's essentially a non-issue.)
Visually they look the same, but finding those problems is a pain.
Re: John Resig: JavaScript as a First Language
#226Earlier quoted context omitted.
Assume you've never programmed before. Would you want to debug a program that has a significant whitespace bug? It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace. Getting stuck and being frustrated hurts motivation a lot. Now curly brackets and syntax may be seen by a person as an irritation or inconvenience compared to whitespace, but I'd say it's better t…
"""Assume you've never programmed before. Would you want to debug a program that has a significant whitespace bug? It's much easier for the average person to spot an unbalanced parenthesis that an incorrectly sized whitespace.""" I'd argue that for a beginner it's equally difficult. And how about this equally difficult to spot classic bug: if (f==x) do_something() and_also_do_this() //oops! a language with significan…
Re: John Resig: JavaScript as a First Language
#227I am so looking forward to a huge army of newly-trained programmers who view prototype-based inheritance as the default and classical inheritance as weird. Similarly, I look forward to a whole set of various modules and libraries to graft prototype-based inheritance onto existing languages like Ruby... cackle
Unfortunately I think that class-based inheritence is more general in concept. That is, people who understand class-based inheritence have a very small leap to get prototypal inheritence. You can pretty much just say, "Inheritence works on the instances/objects, not on the class." Explaining class based inheritence to people who only know prototypal seems trickier. You have to explain the concept of classes and then…
I used to think that, and then I watched a lot of people try. It's harder than you think.
I used a networked server used primarily for MUDs called DGD (Dworkin's Generic Driver) for awhile. The most common MUD libraries for that use prototype-based inheritance. I know mine (based on Skotos) supported multiple prototypes. I think Skotos did as well.
It was interesting - it was pretty easy to explain the prototype-based inheritance to non-programmers. It was much more difficult (usually) to explain it to programmers.
I don't think it's as much "class-based inheritance is good preparation and prototype-based inheritance isn't" as you think.
Re: John Resig: JavaScript as a First Language
#228Seems obvious for me that children motivation can be creating game.
So, in my opinion, an ideal first language should be a sandbox language that have C syntax style without pointer stuff and can easily: - Read keyboard() - DrawPixel() - DrawImage() - PlaySound()
Bonus if there is no install. Bonus if created games can be send by email to friends.