Live data from Hacker News

John Resig: JavaScript as a First Language

ejohn.org

111–120 of 228 posts

Re: John Resig: JavaScript as a First Language

#111
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)?

Java seems extremely mutilated compared to other languages, why would it seem like a good choice? There are only few concepts you could teach with Java.

Re: John Resig: JavaScript as a First Language

#112
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)?

I would prefer to err on the side of not using OOP at all for the first year or so. The problems it solves have better solutions if you're not using a terrible language. They also seem extremely contrived when you introduce them long before the students have any chance of producing a program with those problems, so the students frequently end up using OOP all the time when it's not really called for.

Re: John Resig: JavaScript as a First Language

#114

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 (…

I don't understand the (anti) hype about type coercion and the '==' operator. I get a faintly cargo-culty vibe from people when they talk about '===' vs '==', since the examples are usually very strange things that I never see in production. I'm not an expert in JavaScript but I've written a fair amount and a couple largish programs and I've never been bitten by a type-coercion bug involving '=='. The weird subtle bu…

In 15 years of coding javascript I've never had a significant problem with == vs ===. If anything using === got me into more trouble than using ==, but it really depends on coding style and making other mistakes that would cause a problem down the line with ===. If your coding style doesn't lead you into those mistakes you'll never see them, but other might. It's still not a good reason to abandon javascript and go to coffeescript.

Re: John Resig: JavaScript as a First Language

#115

Earlier quoted context omitted.

And made the mistake of making whitespace significant thereby driving off people in droves.

It's 2011. We love significant whitespace now, get on with the times...

No, "we" really do not love significant whitespace.

Re: John Resig: JavaScript as a First Language

#116
Io will do.

I do not think this would be optimum for new comers even thought i’m a die hard fan of JavaScript. You can teach ‘Io’ language instead of JavaScript which has all kind advantages you have mentioned and which has few set of parser rules that would be easier for new comers.

JavaScript can be a icing on the cake.

Re: John Resig: JavaScript as a First Language

#118
post #89

Earlier quoted context omitted.

Well, I grew up in a day when it was even easier. * Buy home computer (ZX81) * Turn on * 10 Print "Hello world" * run I don't think the instant gratification and ease of use did me any harm.

Of course, the "buy home computer" step was a lot harder back in those days.

More expensive? Sure.

Less common? Definitely.

Harder? Not all that much.

Re: John Resig: JavaScript as a First Language

#120
post #90
post #82

Earlier quoted context omitted.

Java is an extremely confusing language for newcomers. While it's "simple" in comparison to languages like C++ and Haskell, the perceived inconsistencies (do I use == or equals()? length, length(), or size()?) really drive newcomers--and some veterans--up a wall. Throw that in with the insanity of generics, the "everything must be within a class" concept, the mess between objects and primitive types (ints AREN'T Inte…

Java isn't really simple in comparison to Haskell--Java is full of warts and inconsistencies while Haskell is simple, consistent and elegant. 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.

> 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 most excited about is moving the Haskell course out of the spot where it crushed the spirits of potential majors.

Post reply on HN