Live data from Hacker News

John Resig: JavaScript as a First Language

ejohn.org

171–180 of 228 posts

Re: John Resig: JavaScript as a First Language

#171

Earlier quoted context omitted.

> 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. Windo…

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? But won't they need to install an editor anyways? Or are they…

Khan Academy is a training/teaching company. I don't think it's a leap to assume they will be providing online tools to write code with (eg http://c9.io/).

Re: John Resig: JavaScript as a First Language

#172
post #120
post #90

Earlier quoted context omitted.

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…

What are you doing in CS if Haskell "crushes your spirit"? Go study finance.

Re: John Resig: JavaScript as a First Language

#173
post #148

Earlier quoted context omitted.

I spent a lot of time trying to track down bug in a system once (in php) that was caused by this. I don't remember the exact problem but basically it did something like "if(x == 5)" which is true for both 5 and "5" - but later in the code it was important that the value was actually 5 and not "5". But I think the main thing is that for people beginning programming it's better to have less flexibility. In most product…

> but later in the code it was important that the value was actually 5 and not "5". The bug was in that part and not in previous if(5=="5") part. Issues like these appear when Java programmers start to code PHP as if it's Java.

I agree - in fact the problem was solved by removing some unnecessary type-checking code.

The point I was trying to make is that it's easier to learn the basics of types and logic in a strict system. Implicit type conversion and polymorphism can easily result in misunderstandings when you've just started learning to program.

Re: John Resig: JavaScript as a First Language

#174

wat. This is like teaching postscript as a first language. almost literally.

this was downvoted. Let me make the analogy clear. Javascript is sent by a server to a rendering engine (your web browser), usually a part of displaying a page, though of course also as part of interacting with it. Postscript is sent by a (print) server to a rendering engine (in a printer), as part of typseting a page. It is a Turing-complete programming language, but that's no guarantee it won't make your eyes bleed…

Upvote from me. It's a sad day when Kiddiescript is somehow magically elevated to the status of a real programming language.

Re: John Resig: JavaScript as a First Language

#175
I have commented (at length) on this earlier, so don't have much to add. But a further thought did occur to me: JavaScript has "loose typing", that is, one is not taught the difference between say, an int, and a double, or even a char, and the fact that there is no such thing (really) as a string - "strings" are just a lazy shorthand for a char array. Loose typing is not just incorrect - on some level, it is immoral, IMO.

Re: John Resig: JavaScript as a First Language

#176

Earlier quoted context omitted.

Well, I wanted to know what IDE JSLint was an expansion for, so I did some poking around... it's an online tool. Meh #1. Next up I thought I would take a snippet from the linked stackoverflow discussion and see what JSLint made of it: 127.0.0.1.toInt(); And... it complained So I did this: var = function() { 127.0.0.1.toInt(); } And it complained (yes, there's a typo) var foo = function() { 127.0.0.1.toInt(); } And...…

JSLint is readily available at the command line, and is very easy to plug in to your text editor's build system. There is also the somewhat friendlier JSHint as a reasonable alternative: http://www.jshint.com/

By "readily available at the command line" - have you forgotten that the context of this discussion is for a language to use for a first year programming course?

A not insignificant portion of the people taking those courses will not be command line savvy.

Also, I think that the fascination some programmers have for tools that are cumbersome and difficult to use is unhealthy.

The tool should not itself be the problem.

The tool should be a force multiplier that lets you solve other problems more easily.

Re: John Resig: JavaScript as a First Language

#177

Earlier quoted context omitted.

No, we don't. Kids who don't know better might think it's cool; it isn't.

Yeah. Because only kids use and love Python and like the significant whitespace, right? And Haskell with it's significant whitespace --yeah, that's another language for "kids who don't know better"... Anyway --you're a Smalltalk guy. How do you get to talk about weird syntax people don't like? Do many people like interleaving-argument selectors?

You're mistaken if you don't think a shit ton of people dislike Python exactly because of significant white space as well as it being the source of a great many bugs.

As for Smalltalk, yes, they do like them, since faking them by passing literal hashes is a common pattern.

Re: John Resig: JavaScript as a First Language

#178

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...

Speak for yourself. I can tolerate Python's whitespace standards, but I - for one - damn sure don't "love" anything about whitespace being significant.

Re: John Resig: JavaScript as a First Language

#179
One thing that I have not seen covered that is worth mentioning, is that JavaScript for the most part embraces an event based development model. While it is not unique to JavaScript it certainly is heavily reinforced by JavaScript and JavaScript developers. In other languages it can be fairly underrepresented, that being said, it is worth learning JavaScript due to the fact that it helps developers think of execution as events. One can go their whole life in other language and not deal with events, with JavaScript you will be hard pressed to get to intermediate tutorials without fairly good coverage of events and event syndication.

Re: John Resig: JavaScript as a First Language

#180

Earlier quoted context omitted.

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

Yeah, because it totally didn't work for Python... :3

Touting what is arguably the most hated single feature of a particular programming language as a clear success? Uh...ok.
Post reply on HN