News for hackers. Stuff that matters.
Re:John Resig: JavaScript as a First Language by bradleyland on Wednesday December 21, 2011 @02:44PM (#3378802)
One might say the same about the English language, yet it is taught in classrooms all across the United States, despite the fact that the U.S. has no codified national language. English is the de facto national language, but nothing more.

So why Javascript as a first language? Probably the best argument is that it has the widest reach of any programming language in use today because Javascript will run in any web browser on any platform. It is the closest thing to a universal programming language you'll find today.

Re:John Resig: JavaScript as a First Language by kevingadd on Wednesday December 21, 2011 @02:48PM (#3378823)
If widest reach is your criteria, Java and C would also be equally good choices. Unless the web browser is special in some particular way that makes it 'more worthy' than other execution environments?
Re:John Resig: JavaScript as a First Language by fiblye on Wednesday December 21, 2011 @05:11PM (#3379377)
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 Integers!), the verbosity (and inconsistency in naming things), and the lazy-ass exceptions that only vaguely sometimes give you a general idea of where things go wrong, and it's horrible for new programmers.

Javascript is relatively strange, but it's much easier for me to teach JS to somebody than Java. I find it much more easy to explain how and why things work in javascript, whereas when someone asks me why something in Java works this way, I respond with an "I have no clue--they just decided it'd be a good idea and I think it's terrible."

Re:John Resig: JavaScript as a First Language by tikhonj on Wednesday December 21, 2011 @05:44PM (#3379460)
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.
Re:John Resig: JavaScript as a First Language by adgar on Wednesday December 21, 2011 @07:01PM (#3379690)
> 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.

Re:John Resig: JavaScript as a First Language by asianexpress on Wednesday December 21, 2011 @10:39PM (#3380253)
Had a similar experience, except we focused on using SML. We went from 15 people down to 3 in the class by the end. I think the tough part is that most of us had zero experience with functional concepts, while the professor couldn't seem to grasp that everything that made complete sense to him, didn't make sense to us.

There's a lot of potential for Khan Academy to make significant impact with this -- I'm not entirely sure JavaScript would be my first choice, but it does present a lower barrier of entry that is ubiquitous and allows people to even mess around straight in their browsers. With JS, you can show people a little bit of both worlds at a time and compare imperative/functional examples (whereas in Haskell, you're stuck with functional, unless you really want to mangle things). It's also a bit more exciting to be able to throw up a little JS creation on the web so that everyone can see, as opposed to writing a program in C and not really being able to show it to people easily without having them run some executables or bringing them to your computer.

One might argue that people who can't make it through Haskell or other "tough languages" shouldn't bother being CS majors -- but we need all kinds of people in the industry and people have many differing interests. There's blue collar work and white collar work even within software engineering.

Re:John Resig: JavaScript as a First Language by TimboMac on Wednesday December 21, 2011 @08:50PM (#3379980)
Funny that http://www.lambdassociates.org/blog/decline.htm should be on the front page at the same time.
Re:John Resig: JavaScript as a First Language by BasDirks on Wednesday December 21, 2011 @09:56PM (#3380151)
What are you doing in CS if Haskell "crushes your spirit"? Go study finance.
Re:John Resig: JavaScript as a First Language by tikhonj on Thursday December 22, 2011 @03:48AM (#3380912)
Funny you should say that--finance is probably the field that uses the most Haskell :)
Re:John Resig: JavaScript as a First Language by adgar on Thursday December 22, 2011 @11:18AM (#3382009)
The people who knew they were going to be CS majors before they got to college didn't have their spirits crushed. When I TA'd the haskell-based course, they comprised about 25-30% of the students in the class.

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 by malandrew on Wednesday December 21, 2011 @07:17PM (#3379739)
Java isn't a language that promotes "play" like Javascript does, because it's been engineered to prevent you from shooting yourself in the foot. Play helps make learning more fun.

C would be a good choice, except for the fact that memory management and pointers are a very important concept early on in the language that you really don't want to bog people down with that are completely new to programming. I remember a blog post by spolsky about how you lose a lot of people on that one concept, especially if it is poorly taught.

Re:John Resig: JavaScript as a First Language by maximusprime on Wednesday December 21, 2011 @02:57PM (#3378869)
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.

Re:John Resig: JavaScript as a First Language by kevingadd on Wednesday December 21, 2011 @03:06PM (#3378904)
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 programmer pays every time they use the comparison operator or the arithmetic operator and they now have to consult their reference text to figure out what the operator is going to do and whether they're using the right operator.

If your goal is to lead someone into a lifetime of programming and help them enjoy it, choosing a language in order to avoid a pesky 15 minute setup cost for a compiler is tremendously short-sighted.

Re:John Resig: JavaScript as a First Language by DrHankPym on Wednesday December 21, 2011 @03:28PM (#3379006)

    > 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 by kenjackson on Wednesday December 21, 2011 @04:04PM (#3379138)
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 just going to use notepad? That will be a horrible experience.

And JS is changing too. None of the languages change so drastically that it's not just something simple to incrementally learn. And I think getting students used to the fact that things change isn't a bad thing. But also let them know that typically backwards compat isn't broken with these changes.

With that said I'm a big fan of JS as a first language. I'd probably spend the first day with them using notepad or vi (or whatever is natively installed on the system) -- and then have them install some nice IDE of my choosing.

Re:John Resig: JavaScript as a First Language by wahnfrieden on Wednesday December 21, 2011 @05:24PM (#3379409)
I'm all for vim, but you're mad if you think first-time coders should pick that up before even writing their first piece of code. Talk about barriers to entry and unintuitive behaviors...

I think the most viable environments for absolute beginners will be online ones that include an REPL and editor, using either JS or something that compiles to JS or to anything else on the backend, so even browser choice is irrelevant. Then you don't have to teach how to load a JS file into a document and so on.

Re:John Resig: JavaScript as a First Language by thenduks on Wednesday December 21, 2011 @09:55PM (#3380150)
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 by freehunter on Wednesday December 21, 2011 @03:29PM (#3379007)
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 by absconditus on Wednesday December 21, 2011 @03:10PM (#3378929)
I struggle with this mindset. It probably makes sense for Khan Academy, but this industry (software development) needs fewer people who refuse to learn anything unless all obstacles are removed and the information is spoon fed.
Re:John Resig: JavaScript as a First Language by Apocryphon on Wednesday December 21, 2011 @03:19PM (#3378968)
I find your statement to be amusing considering a lot of the anti-JS comments on this thread are about how unwieldy it is as a language. Of course, your critique and those complaints are two different things. You are criticizing that people are too coddled about having an accessible environment to program in. The complaints are that JS is too unfriendly and muddled, and so does not coddle beginners enough!
Re:John Resig: JavaScript as a First Language by exDM69 on Wednesday December 21, 2011 @04:57PM (#3379333)
Installing the required tools to use a programming language is a very different kind of challenge than learning the ins and outs of a programming language with lots of gotchas.

When you work as a software engineer, you're expected to be able to install and operate just about any programming environment out there, so you might as well get used to it. Installing any of the big popular programming environments is pretty trivial, Eclipse, Visual studio, Racket scheme, Ubuntu and even the Haskell platform all come with a graphical installer and a comprehensive manual. Learning a new skill is not needed.

Now learning JavaScript wtf's is something entirely different. Stumbling upon one of these issues mentioned in the article while trying to learn to code is very difficult and disheartening.

Re:John Resig: JavaScript as a First Language by stdbrouw on Wednesday December 21, 2011 @07:05PM (#3379700)
Once someone has decided that they absolutely want to learn everything there is to know about programming and have decided that they love it, yes, there's no point in spoon feeding. But so many of us stumble into what later ends up being our career or passion, and so our first encounter with any type of activity is almost always "hey, let's see if this is something for me." As a society, we need more programmers and scientists and mathematicians, so best make sure that we make that first impression a good one.
Re:John Resig: JavaScript as a First Language by maximusprime on Wednesday December 21, 2011 @03:13PM (#3378945)
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.
Re:John Resig: JavaScript as a First Language by kls on Wednesday December 21, 2011 @05:51PM (#3379486)
Right the technical stack has become daunting to the point that many cannot get the feedback so needed early on. Now days you either advanced with the technology, or you spent a significant investment of time to learn the trade with the intent of entering the field. The days of the hobbyist programmer have seen their peek until that changes.
Re:John Resig: JavaScript as a First Language by tmorton on Wednesday December 21, 2011 @05:42PM (#3379458)
Of course, the "buy home computer" step was a lot harder back in those days.
Re:John Resig: JavaScript as a First Language by chc on Wednesday December 21, 2011 @06:58PM (#3379682)
More expensive? Sure.

Less common? Definitely.

Harder? Not all that much.

Re:John Resig: JavaScript as a First Language by maximusprime on Thursday December 22, 2011 @04:59AM (#3381041)
It wasn't. At least in the UK in the 80s, you could go out to any town center, walk into a shop, and buy a "home" computer. They were everywhere.
Re:John Resig: JavaScript as a First Language by anonymoushn on Wednesday December 21, 2011 @06:38PM (#3379624)
That's fine. We can already run lots of better languages in the browser either using interpreters written in JS or cross-compilers targeting JS.
Re:John Resig: JavaScript as a First Language by laconian on Wednesday December 21, 2011 @04:51PM (#3379315)
This is an eminently solvable problem. There are excellent open source IDEs and toolchains available that can be repackaged in any way, shape, or form.

Double click an installer, and boom - everything's set up.

Barrier to entry is a moot point.

Re:John Resig: JavaScript as a First Language by syaz1 on Wednesday December 21, 2011 @09:26PM (#3380066)
Almost everything comes with installer these days, yet some refused to install better, secure browsers since they already have IE by default.

Barrier of entry is a problem.

Re:John Resig: JavaScript as a First Language by blub on Wednesday December 21, 2011 @03:28PM (#3379002)
The fact that something is popular doesn't make it necessarily good, so your best argument is no argument at all. Same as with English - no connection whatsoever to a programming language, it's a bad parallel.
Re:John Resig: JavaScript as a First Language by brudgers on Wednesday December 21, 2011 @04:28PM (#3379234)
I think the argument is more along the lines of "javascript is ubiquitous, therefore learning javascript is likely to be useful (despite drawbacks created by its idiosyncrasies)."