News for hackers. Stuff that matters.
Re:You must learn JavaScript by aplusbi on Thursday December 02, 2010 @06:06PM (#1964042)
JavaScript isn't really important for non-web development. I used to program video games for hand held consoles and JavaScript was the last thing on my mind.

Okay, maybe I was working for the unmentioned 1% (and for what it's worth, the company I currently work for uses JavaScript). And really, it's not a bad idea to learn JavaScript - it's pretty ubiquitous and chances are you will work for a company that uses it at some point in your career. But honestly, I'm getting a little sick of all these articles that seem to forget that there is more to programming than web apps.

Edited to remove snarkiness.

Re:You must learn JavaScript by ericflo on Thursday December 02, 2010 @09:57PM (#1964582)
Want to make a bet that we'll see JavaScript used to script a game within the next 5 years? I'd bet money that we will.
Re:You must learn JavaScript by pzxc on Thursday December 02, 2010 @10:50PM (#1964666)
Don't know what you mean by this comment. There already are plenty of games written exclusively in Javascript. I've written a couple myself. Even if you exclude html5/websockets, it's entirely possible to write a server/client game, even a complex one, just with AJAX (Asynchronous JAVASCRIPT And Xml). And that's not even counting the tons of singleplayer games, hell look at the JS1k and JS10k contests, most if not all of the entries were games.

Edit: or was that sarcasm?

Re:You must learn JavaScript by tlrobinson on Friday December 03, 2010 @02:27AM (#1965095)
He's probably talking about embedding a JavaScript engine within a game to script the lower-level (usually C/C++) game engine, a role that is currently often filled by Lua: http://en.wikipedia.org/wiki/Lua_(programming_language)#Vide...

I wouldn't be surprised if this has been done too, but if it has it's not as popular as Lua.

Re:You must learn JavaScript by ericflo on Friday December 03, 2010 @03:21AM (#1965175)
Yep, exactly. I expect that as node.js rises in popularity in general, JavaScript's use as an embedded game scripting language will rise (possibly at the expense of Lua and Python).

Actually now that I write this, I wonder about the possibility of JavaScript game scripting combined with something capability-aware like Caja for hosted game mods. Could be an interesting area to explore.

Re:You must learn JavaScript by pmjordan on Friday December 03, 2010 @05:21AM (#1965351)
There is a robust implementation of JavaScript for the JVM (Rhino), part of which even ships with Java 6, so scripting a Java-based game seems a straightforward step. On .NET, JScript similarly seems to be an almost first-class citizen (though, unlike Rhino, I've never used it).
Re:You must learn JavaScript by luminarious on Friday December 03, 2010 @04:29AM (#1965280)
Unity game engine supports JavaScript alongside Boo and C# http://unity3d.com/unity/engine/programming
Re:You must learn JavaScript by jpa on Friday December 03, 2010 @10:03AM (#1966057)
Heh.. beat me too it. To say JavaScript isn't used in gaming is crazy. Probably 2nd most popular scripting language, after LUA.
Re:You must learn JavaScript by makmanalp on Thursday December 02, 2010 @10:09PM (#1964598)
Put your money where your mouth is! http://www.longbets.org/
Re:You must learn JavaScript by ericflo on Friday December 03, 2010 @03:17AM (#1965169)
"There is a $50 publishing fee for making a prediction."

No thanks, not willing to pay that overhead. I'd put $50 on the bet, though :)

Re:You must learn JavaScript by weego on Friday December 03, 2010 @05:24AM (#1965354)
LUA and ActionScript (for UI work mostly) are well represented in games companies already, I would think JavaScript will get some exposure if someone goes the extra mile to open their UI in the way that Blizzard have done to addon development (LUA).
Re:You must learn JavaScript by wslh on Friday December 03, 2010 @06:43AM (#1965483)
I bet that we'll have a VM (and not JVM) in the browser that can run a lot of supported languages beyond Javascript.
Re:You must learn JavaScript by simonsarris on Friday December 03, 2010 @09:46AM (#1965952)
I am making one, Javascript and Canvas

Aren't there already a lot of Javascript games out there though?

Re:You must learn JavaScript by axod on Friday December 03, 2010 @06:12AM (#1965429)
why 5 years? js isn't exactly new. I remember writing my first browser games in js (tetris and minesweeper) in 1999.
Re:You must learn JavaScript by chipmunkninja on Friday December 03, 2010 @11:21AM (#1966376)
Easy bet. Unity already does.
Re:You must learn JavaScript by kennymeyers on Thursday December 02, 2010 @06:09PM (#1964056)
I agree with you. My audience is primarily web developers, so that's who I write to.
Re:You must learn JavaScript by sigzero on Thursday December 02, 2010 @07:57PM (#1964357)
"It’s my belief that every single programmer should learn JavaScript."

You need to change that sentence then...

Re:You must learn JavaScript by kennymeyers on Thursday December 02, 2010 @08:07PM (#1964374)
Changed. Thank you.
Re:You must learn JavaScript by aplusbi on Thursday December 02, 2010 @06:16PM (#1964074)
Then consider my snarkiness rescinded. Part of the problem with aggregate news sites is that they often remove context.
Re:You must learn JavaScript by mambodog on Thursday December 02, 2010 @10:44PM (#1964657)
If you're writing games with Unity, there's a good chance you'll be using Javascript, as they have implemented Mono/Javascript (with their own extensions) as one of the engine's main languages.

Of course, DOM is utterly irrelevant here, just wanted to point out its use in games.

Re:You must learn JavaScript by kayoone on Friday December 03, 2010 @05:43AM (#1965377)
the very popular Unity3D engine supports JavaScript as a scripting language btw. Many people use that to develop iOS/Android games and even Browser/PC/Mac games.
Re:You must learn JavaScript by DjDarkman on Friday December 03, 2010 @03:28AM (#1965183)
Not important? Look around it had heavy influence on Java, C#, PHP and C++
Re:You must learn JavaScript by aplusbi on Friday December 03, 2010 @05:06PM (#1967618)
Let me clarify: learning JavaScript is not that important for non-web development.
Re:You must learn JavaScript by binaryfinery on Thursday December 02, 2010 @08:00PM (#1964360)
Same here on regular consoles. We did use lua and once UnrealScript and the reduction in iteration time to seconds was worth any loss of speed in the short term (i.e. discover the game, then downcode what you need to later).

However, times have changed. The kind of games i'm interested in are ubiquitous in nature. I want to interact with it on the console, the iPhone, the PC, and on the web. I want to write tools that are cross platform. The browser is the ultimate cross platform.

Re:You must learn JavaScript by aplusbi on Friday December 03, 2010 @11:27AM (#1966405)
Yeah, we actually did use Lua on some of our games. I'm not saying JavaScript is too slow for games, or can't be used for games, just that it wasn't very useful for console development at the time I was doing that. Plenty of games have been written in JavaScript, although almost all of them are web-based games (and I specifically said it's not that useful for non-web development).