Processing Homepage: Processing.org
Processing API: Extended Language (API) \ Processing.org
Processing on Wikipedia: Processing (programming language) - Wikipedia, the free encyclopedia
Processing Monsters: Processing monsters (a collection of open source Processing sketches that display monsters)
Open Processing: OpenProcessing - Share Your Sketches! (a collection of open source Processing sketches that do other cool stuff)
The game I made in Processing: Escape from Monster City
Full disclosure- this started to feel like an advertisement, so I just want to say that I’m not affiliated with Processing at all. I just started playing with it, and I’m really excited about how it can be used to not only introduce new programmers to Java, but for experienced users to take Java to the next level.
I participated in Ludum Dare last weekend, and I took that as an opportunity to learn Processing, which is “an open source programming language and environment for people who want to create images, animations, and interactions” built on top of Java.
I’m extremely impressed by what Processing allows you to do in such a short amount of time. Out of the box, you have a 60 fps rendering loop, easy access to 3D primitives, and cool lighting effects, as well as image handling, camera manipulation, input processing, and a ton of other stuff I haven’t gotten into yet- all done in the object oriented style of Java. It seems like a perfect tool for a novice programmer who wants to play around with cool visuals without worrying about Swing, event listeners, threading, the inner workings of Java deployment, etc.
Your first Processing sketch:
Since Processing is built on Java (every Processing sketch is a PApplet, which extends Applet), I feel like it could be an ideal “stepping stool” to introduce new programmers to the language. We’ve seen so many people frustrated with the basics, or even the not-so-basics. I still have trouble setting up a reliable high-fps game loop, and I also have trouble thinking about how they’re doing the 3D, lighting, and camera effects. Processing abstracts that kind of stuff away, leaving you free to focus on the cool, fun stuff.
And it’s not hard to get started on that cool, fun stuff. The tutorials are just as good, if not better than, the Java tutorials, and the Processing API lists all of the methods that are available to you. The Processing development environment comes with a slew of examples that you can easily open, run, and play with to see what happens. Processing also makes it easy to output an applet, as well as OS-specific executables. Also, the Processing community is really cool- almost everything is open source, and tons of people share their Processing sketches for other people to use as an example.
A 3D example:
That will satisfy most novice programmers without frustrating them too much, at least for a while. But then when they want to do something more complicated- embed a Processing program in a GUI with buttons, or use a third party library, or deploy their program using Java webstart or jnlp, for example (none of which is hard, but requires Java knowledge)- that’s when we (as Java educators and supporters) step in. And by that time, the novice programmers have probably been using Processing long enough to understand the process of looking at examples, reading through the API, and trying things out- which makes it easier to teach them Java.
A camera example:
All of that being said, I do have a few complaints. Processing hides the stuff that might scare away new programmers from Java, but that’s not always a good thing- it’s important for a programmer to understand the annoying little things, and although it’s sometimes frustrating, Java does force you to learn them. Stuff mostly “just works” in Processing, but what happens when it doesn’t? By hiding things like compiling, deployment, classpath, etc, Processing leaves the novice user in the dark about what’s going on behind the scenes. Also, Processing is (currently) based on Java 1.4, so don’t expect to use enums, annotations, enhanced for loops, generics, etc.
Also, Processing breaks quite a few rules that the Java programmer in me cringes at- “don’t mix business logic with rendering code” is a pretty basic golden rule, and Processing throws it out the window right away. Processing also allows you to do your drawing at any time- in the rendering loop, in an event handler (er, in the methods that Processing uses to hide event handlers), in other methods- all without a Graphics Object. You also have access to things like mouseX and mouseY without writing any listener code. I think these things might cause confusion and bad practices when people make the switch from Processing to Java.
A collision example:
Still, I’m super excited to dive into the world of Processing. Looking at the Processing API reminds me of when I first got started learning Java, how my friends and I would come home after high school and start playing around with notepad, the command line, and the API, just to see what we could do. And Processing isn’t just for beginners- with a combined knowledge of Java and Processing, you can do some really awesome stuff.
One thing I’m most excited to try out is Processing’s Android support. From the Processing wiki: “The primary goal of this project is to make it foolishly easy to create Android apps using the Processing API”. With Java steadily losing ground to flash when it comes to visuals and games, that could really turn the tide in the near future.
So, does anybody else have any experience with Processing? I really recommend trying it out, whether you have never written a line of code before or you have made a million dollars developing indie games in Java. I’d love to see what other people are doing and compare results, so feel free to drop me a PM or start a thread with Processing in the title. This post is already long enough, so I won’t bother with any tutorials (the Processing tutorials and examples are better than anything I could come up with anyway), but I’d love to answer any questions you might have- mostly because answering Java questions is how I learned the most about Java, so answering Processing questions will help me learn Processing!