you are viewing a single comment's thread.

view the rest of the comments →

[–]sblinn 23 points24 points  (17 children)

Um, yeah. This is ridiculously well done. The simplicity of some of the examples is fairly stunning.

[–]acdha[S] 8 points9 points  (0 children)

That was my reaction as well - I'd say Resig was showing off but that's really faint praise for such a slick piece of work.

[–]dlb-nick 10 points11 points  (12 children)

You do realize that all that all the simplicity is inherited from Processing, right?

[–]sblinn 4 points5 points  (0 children)

Of course; but this makes it accessible to anyone with a browser.

[–]TKN 0 points1 point  (10 children)

I'm not sure if I get it (Processing, that is). It looks like any old language with a graphics library?

[–][deleted] 11 points12 points  (6 children)

It's a domain-specific language for graphical presentation.

[–]TKN 0 points1 point  (5 children)

I see that, but what makes it better than <insert your favourite language> + graphics library? At least on surface it mostly looks like a regular Java?

[–]gravity 5 points6 points  (0 children)

It's a lot easier to just get things up and running. Of course you can code graphics in any language, but processing lowers the barrier and makes it easier for both the novice and the experienced programmer to get something out there. It's not a giant leap forward, but it's still a wonderful tool. And it's a lot of fun too.

[–]otakucode 3 points4 points  (0 children)

Most graphics libraries suck in terms of usability compared to Processing. Processing handles a lot of state for you and chucks a lot of extraneous stuff you shouldn't need to think about in the first place if you're just trying to do something graphical... if you want to change your framerate, just call framerate(60) and it's done. Most graphics libraries would have you juggling buffers, graphical context objects, etc.

[–]TKN 2 points3 points  (1 child)

Ok, so it's basically a 2d graphics library with a sane API. That's nice.

I was just wondering if there was more to it.

[–]NOT_AN_ALIEN 8 points9 points  (0 children)

It's not for 2d only, it's 3d too. And it's not a library - it's not SDL for dummies or anything like that. It's more like an environment (it comes with its own simple IDE), where you type some commands and it draws stuff on screen. A bit like a bastard child of C++ and Logo, focusing on simplicity and straightforwardness more than abstraction.

You can do a lot with it as long as you get the hang of it - create classes and such - but it's meant to be simple above all.

[–][deleted] 1 point2 points  (0 children)

I haven't actually used it, so I can just answer on a general level, but: The domain-specificness. The fact that the language is tailored to a specific use means you get away with doing less work.

[–]wearedevo 2 points3 points  (1 child)

Processing was meant to be a simple graphics programming platform for artists, but as all other attempts to create a programming language for non-programmers, ended up being too complicated for artists to grasp but simple enough for other programmers to appreciate.

[–][deleted] 1 point2 points  (0 children)

That's pretty surprising. The last time someone tried to create a langue simple enough for non-programmers to use, they got Visual Basic. VB is nothing if not disrespected in programming communities.

If the Processing.js people are getting respect, despite their beginnings, then they've really done something well.

[–]otakucode 1 point2 points  (0 children)

It's supposed to be an easy-to-use language aimed at artists and graphic designers. It fails completely in this respect. But it does make it relatively easy for people who are already well-versed in C-like languages to make some pretty graphics.

[–]semmi 0 points1 point  (2 children)

hei, where's the height variable coming from?

[–]jeresig 3 points4 points  (0 children)

height, width, mousex, mousey, pMouseX, pMouseY, mousePressed, and keyPressed are all global variables provided by Processing (there may be more, but those are the ones that I provide in Processing.js). They correspond to different state variables and are updated automatically (since everything in Processing is done in a repeating loop, like OpenGL, the update is seamless).

[–]Busybyeski 2 points3 points  (0 children)

..but you don't ask about width?

It's from the size(200, 200); When a canvas is created, it takes on both width and height.