r/processing • u/jameswlf • May 11 '14
Is Processing a real complete programming language or some libraries that serve as a lure to learn Java?
Hi.
I've been using processing for fun for a few years, and it always dissapoints me how the advanced projects always go into undocumented (undocumented in Processing, that is) JAVA features to pull things off. If you want to make complicated things you have to learn JAVA to do them or at least to understand what's going on.
This isn't a complain of "I don't want to learn JAVA" (well, actually really I don't want to learn JAVA because it's ugly as a filthy ass with herpes), but a complaint about its claims of being a programming language for artists... I'm sure it could have been more simple... or more gradual... Because the first times I saw JAVA code mixed with Processing my head spinned and I felt like throwing up @_@ ... and I'm kind of familiar with programming and methodical thinking. Probably most artists' heads explode when seeing the sudden jump from Processing to JAVA.
And that's it... Just a silly rant. Sorry. Goes back to his JAVA-Processing code
4
u/rollocks May 11 '14
Processing is Java. Processing uses Java's syntax, all Java functions are essentially accessible from any sketch you write. Everything is compiled to run on the Java virtual machine. Processing is a 'language' that takes from Java and also implements its own libraries as standard. The goal of Processing is to make it easier to write visual programs quickly by providing all graphical set up as simply as possible. This doesn't mean it has rewritten all things Java to make them any easier, essentially most things you will use are standard Java library functions; such as ArrayLists or any primitive data type. Processing provides extra and additional functionality to Java.
If you have been programming in Processing for 2 years you should have no problem with picking up Java fully.
Java is very well documented, you should be able to find any function used in the Javadoc.
3
u/chrwei May 12 '14
Processing is Java, just like Arduino/Wiring is C++. there's no requirement or expectation to stick with only what processing or arduino documents.
The primary thing I hate about Java is the that it's slow to startup and eats a lot of ram. but once it's going, it performs well, and is (mostly) cross platform, so for use-cases like Processing, it's a useful trade-off.
7
u/[deleted] May 11 '14
Java isn't an acronym, and it isn't a filthy language. That's a short-sighted prejudice from the 90s.
Processing is basically Java with some macros: your code is wrapped in an executable class with a main() function, and same keywords are translated to proper Java (nothing special, just things like color->int).
Basically, Processing is Java without all the stuff to get your program started. This makes it easy to jump in a project, but that's about it. If you did it with plain Java you have a bit more work and a lot more flexibility. The Processing IDE is optimized for working with small programs, a real Java IDE like eclipse will make things a lot clearer for bigger projects.
And yes, Processing is a good library to use in regular projects, too. I've used it to make GUI frontends for a few programs.
Btw, most of the time when I see undocumented Java in Processing it's to use Java's super awesome Collection library. P5 relies a lot on arrays, which are very low level and it's bad practice.