4 ms·
It's with all of this in mind that my recommended language for teaching beginners is now Javascript. I know, I know, it's quirky and sometimes outright weird, b
by cageface 12y ago
It's with all of this in mind that my recommended language for teaching beginners is now Javascript. I know, I know, it's quirky and sometimes outright weird, but overall it's decent and modern enough.
Javascript is a flawed, quirky language, but with the upcoming ES6 and ES7 standards it's going to be a much, much better. I'd call it a tossup comparing it to Python or Ruby. I wouldn't have recommended JS to a beginner a few years ago either but that's where the momentum is now and, as the author says, the ease with which a newbie can get something interactive up on screen trumps smaller concerns. For a little more rigor you can use something like Typescript.
- gobengo 12y agoWhat's pretty funny is that the new features in ES6 and ES7 makes a lot of the patterns/mishaps/X-parts from the last 15 years pretty irrelevant or less-obviously-'the way'. Examples: * "Class" syntax * Comprehensions * Modules * `let` scoping * Generators It's a whole new ball game. I think a lot (over 50%) of JavaScript devs 5 years from now will still be using <= ES5, but only because they've so settled in their ways over the last 10 years.
- saraid216 12y ago> I think a lot (over 50%) of JavaScript devs 5 years from now will still be using <= ES5, but only because they've so settled in their ways over the last 10 years. 5 years from now, there will still be people whose customers require IE6 support, too. We're still working on that.
- pjmlp 12y agoThe customer I am on, still uses IE 8!
- wwweston 12y ago> I think a lot (over 50%) of JavaScript devs 5 years from now will still be using <= ES5, but only because they've so settled in their ways over the last 10 years. Funny, I'd make the opposite prediction... the JavaScript devs I've known have been among the most curious and open-minded developers about different ways of doing things, interested in experimenting with different idioms made available by the flexibility of the fundamental language, and quick to adopt them they found them useful (possibly too quick). They're people who figured out how to get many of the benefits of the language features you've listed above starting with the language features that were available years ago. Which kindof makes sense: everybody else was too busy complaining about function scope instead of block scope or how they couldn't get their heads around Prototypes instead of Classes or having to reason about this scope or truthy/falsey values or whichever difference/wart scared them off to bother learning to use the tools at hand. No, my bet would be that ES6 adoption will take up a lot quicker than, say, Python 3. (and most of the lagging will probably happen around frameworks with imported paradigms -- Angular 1.x, I'm looking at you in particular -- and other aging codebases).
- pekk 12y agoI hope you at least wait until those standards are thoroughly supported "in the wild" because the wild provides the entire point of choosing Javascript. Even then, the argument that ES6+ will make everything better ignores that those standards layer more stuff on top of a lot of bad old stuff that isn't going away. And the community status quo is bad documentation, messy APIs and things breaking all the time. If I did not HAVE to use this stuff I would happily choose to avoid the frustration. There is no competition to Javascript for programming browsers, but why should programming education always center on programming browsers? For education in particular, there are a number of languages designed for education and Javascript (even ES6) has never been one of them. No accounting for taste, I guess.
- seanp2k2 12y agoProgramming education doesn't have to center on browsers, but it's very likely that someone interested in programming as a career in 2015 will have to make programs which interact with browsers in some way. So, while class chicken inherits from Animal and can override Animal's speak() method, that's not quite as fun as having .chicken.animal::after put chicken memes all over your homework. Visual Basic was also pretty awesome for this, and I'm sad to see that give way to e.g. Java, which has probably turned many people off initially to how fun and rewarding programming can be. TL;DR public static void main is not as fun as making more internet.
- rtpg 12y ago+1 on the interactivity aspect. Not having to go through a bunch of compiler configuration (C/C++ land) to get a basic GUI up and running is a huge plus. And HTML is a lot easier to understand for people with no experience than a bunch of tkInter classes.
- fat0wl 12y agoi kindof believe all languages should have some ability to run with a browser-based GUI... why bother with all the hair-brained implementations (Swing, Qt, etc.) when we could just have a "desktop mode" (altered security) version of Chrome pop up to provide GUI. it wouldnt even have to follow same rules as browser really (navigation could be via buttons only, no back/refresh), just be based on html & perhaps js to allow a bit of advanced nav logic (though hopefully not enough to start polluting app logic) i believe chrome apps may have some steps toward this, though not sure... at 1 point i considered trying to make a browser-based GUI that does all local RPC communication to a c++ app, but i feel like you know.... there should be a nice standard way of doing this out there
- martian 12y agoI think this is easier than you think. About 8 years ago I was working on a big project in Qt that was two parts -- one part a 3d rendering engine, one part an interactive web view. Having the two interoperate was surprisingly straightforward, and we could do all kinds of HTML/CSS layouts and use JavaScript hooks to call to the Qt classes. I can't imagine it's regressed much since then, though I'll admit it's been a while since I touched it. PhoneGap provides this kind of experience for mobile. The issue always ends up being performance -- running the JS runtimes in sandboxed webviews is always* slower than native code.
- seanp2k2 12y agoChrome apps are already the desktop mode :) There's also stuff like Chromium Embedded Framework[1] which Atom used to use[2]. AppJS[3] sounds the most similar to what it sounds like you want, though. I've never tried it, but it seems like it'd work well enough (Chromium-based). 1. https://code.google.com/p/chromiumembedded/ https://code.google.com/p/chromiumembedded/ 2. http://blog.atom.io/2014/05/06/atom-is-now-open-source.html http://blog.atom.io/2014/05/06/atom-is-now-open-source.html 3. http://appjs.com http://appjs.com
- Alex3917 12y agoI'll be the first to admit that ES6 is nicer than Python in terms of the language itself. But I feel like it's still going to take years of heavy lifting to get the same level of high quality libraries, web frameworks, learning resources, etc. And it's hard for me to see js replacing Python as the obvious choice for beginners until that happens. It might be more fun to code in than Python, which is probably at least in part why there is more js code being written on github, but the larger ecosystem still seems like kind of a mess.
- ianbicking 12y agoIs rigor even that important? Is a flawed and quirky language really a problem when you are learning? I'd expect that keeping the learner's momentum going is more important – if they keep producing they will be able to engage with the crap, or make their own new kinds of crap. Quantity over quality, you know? With that in mind, stuff like developer tools is more important... and maybe community (which is eclectic for Javascript – there's lots of material out there about Javascript, but a lot of it is crap material).
- moron4hire 12y agoWe can have good, rigorous semantics and simple syntax in the same language. Python is, indeed, a good example. Ruby as well. I would even start to say Scheme is a very rigorous language that is quite easy to learn--if you first haven't been tainted by curly-bracket languages and second lived in a world in which there were a Scheme implementation with as many and as complete of a selection of libraries as Python. A flawed, quirky language is a problem when learning, because it increases the number of things that have to be learned. But yes, your other points are correct. Tooling is far more important.
- yoklov 12y ago> ... a Scheme implementation with as many and as complete of a selection of libraries as Python. It's not quite the same size, but the Racket standard library is fairly close in size to pythons. It also has better GUI support, IIRC. It's selection of other libraries isn't quite as broad either, but it's decently sized, and you can use some things written for other implementations (well, mainly ones written in pure scheme).
- moron4hire 12y agoI had used Racket for my personal projects for well into a year. It was a lot of fun, so it definitely filled a good niche for me at the time, but I eventually gave it up as I started to want to be more productive and start finishing projects, rather than just writing any ol' random code. It is definitely the most complete Scheme available, which I believe is why they gave up the PLT Scheme name, to disassociate from the "bare bones" assumption of Scheme. And yes, it's GUI support is relatively better than Python's. But it's not objectively good. It tends to have mostly bare-minimum implementations of libraries. For example, the work done for connecting to databases is basically nothing more than a DB connection. Web development is basically no more than HTTP request parsing. There's no Django or Rails or even Express for Racket.