Live data from Hacker News

John Resig: JavaScript as a First Language

ejohn.org

51–60 of 228 posts

Re: John Resig: JavaScript as a First Language

#51

Earlier quoted context omitted.

Everyone already has a browser, which includes a profiler, debugger, REPL etc. Not everyone has a c compiler or JDK, or wants the hassle of having to set them up just to start learning.

The claim that everyone has a profiler, debugger and REPL is blatantly false. Only a subset of commonly available desktop browsers include those features, and out of those, only recent versions do. Mobile web browsers don't include any development or debugging tools. The cost of installing Visual Studio or Eclipse is pretty small considering that you only have to do it once. Compare that with the cost a newbie progra…

    > Mobile web browsers don't include any development or
      debugging tools.
LOL. Great point. /sarcasm

    > The cost of installing Visual Studio or Eclipse is
      pretty small considering that you only have to do it
      once.
Boom. That's all it takes to create a barrier of entry. Not everyone has permissions to install whatever they want on the computer they're using.

Then you get into issues with multiple operating systems. Windows does it one way and Linux and OSX does it another way. Also, the tools you've mentioned are always changing. Will it be the same in a year or two?

And for what? So you don't confuse an extra set of comparison operators? Javascript is not that bad.

Re: John Resig: JavaScript as a First Language

#52

Earlier quoted context omitted.

Everyone already has a browser, which includes a profiler, debugger, REPL etc. Not everyone has a c compiler or JDK, or wants the hassle of having to set them up just to start learning.

The claim that everyone has a profiler, debugger and REPL is blatantly false. Only a subset of commonly available desktop browsers include those features, and out of those, only recent versions do. Mobile web browsers don't include any development or debugging tools. The cost of installing Visual Studio or Eclipse is pretty small considering that you only have to do it once. Compare that with the cost a newbie progra…

I would find it hard to believe that even a significant minority of users who would have any remote or even fleeting interest in programming anything would have a mobile web browser as their only choice. You'd be hard pressed to find someone who has a smartphone or tablet but not a computer.

Re: John Resig: JavaScript as a First Language

#53

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

Whatever, Javascript is the easiest language to get started on. No installing a complicated IDE. No configuring a server. Nothing is required except for a browser! If anything, it's the best language for such purposes: getting started.

I don't think Javascript's availability in the browser should be a major driving concern. Browser-based REPLs and editors are getting better and better. Two examples: http://repl.it/ and http://cloud9ide.com/.

Re: John Resig: JavaScript as a First Language

#54
I think it'd be more apt to choose something like Racket. It has all the desirable characteristics the author finds attractive in Javascript. It is an integrated environment and includes libraries and extensions for teaching basic programming. Unlike Javascript it isn't married to the browser (and by extension, the DOM) and doesn't suffer from a variety of syntactical discrepancies. It even comes with a free book for teaching the fundamentals of computer programming and computation.

http://docs.racket-lang.org/quick/

Update: All of the desire-able characteristics except for being a resume-search keyword with a high hit frequency. IMO, learning how to program and getting a job are orthogonal.

Re: John Resig: JavaScript as a First Language

#55
I once considered teaching JavaScript as a first language, but the absence of synchronous user input made me reconsider.

For example, there is no way to do this in JavaScript,

> var line = read_line();

Of course you could use the prompt() function, but that only works in the browser, and it's an ugly hack.

Re: John Resig: JavaScript as a First Language

#57

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

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 the bunch depending on what your goals were.

Prolog had some real strengths. The combination of accessibility for some simple applications with the power and conceptual depth of the logic paradigm tended to put more or less smart people with no previous experience on the same footing with those with some experience.

But JavaScript seemed to be the best of the bunch in terms of balancing accessibility, speed from which students could get to doing something with everyday practical use, and available depth.

And despite the fact that those of us who were teaching were just learning and coming to grips with some of the "bad parts" ourselves (because how many people really knew JavaScript in the 1990s, right?), everybody got stuff done anyway.

Re: John Resig: JavaScript as a First Language

#58
post #4

tl;dr - they picked JS due to its "ubiquity, desirability in the larger workforce, lack of prior installation requirements, and ability to create something that's easy to share with friends" I find that explanation disturbing. Why not start from a language that teaches the basics of the common programming paradigms, such as OOP (Java) or FP (Scheme)?

Ability to create something you can share (or that you can other wise readily "put to use") is important. If you lose your audience because they don't get satisfaction early enough, well, they are gone. While programmers certainly want to weigh in on the issue (obviously), the experience of teachers and psychologists would suggest that keeping the carrot close is immensely valuable to getting someone to learn something.

Re: John Resig: JavaScript as a First Language

#59

For the interested (and with the caveat that I definitely would not suggest it for the Khan Academy's purposes), CoffeeScript does try to address all of the issues that John raises in his post. Type Coercion: There is no `==` in CoffeeScript. You usually write `if x is y` in order to be particularly clear, but if you're in the mode of most other scripting languages, and you write `if x == y`, it will compile to `if (…

As matter of fact, while I was reading the post the first that came to my mind was how much the recommendations reminded me of the CoffeeScript introductory page...
Post reply on HN