Processing is a language with a simplified syntax and its own IDE, designed to make it easy for novice programmers to get something visual and interactive up and running without a ton of boilerplate.
Processing is built on top of Java. Part of what the Processing IDE does for you is compile your Processing code into Java code, which it then runs. But most Processing developers never interact with that Java code.
Here is a little example of a Processing program (usually called a "sketch"). This is completely valid syntax, runs as-is (without a main method), and displays a circle where the mouse is:
void setup(){
size(500, 500);
}
void draw(){
color backgroundColor = #0000ff;
background(backgroundColor);
color fillColor = color(0, 255, 0);
fill(fillColor);
ellipse(mouseX, mouseY, 20, 20);
}
Despite that, many questions tagged with processing also get tagged with java. This tagging is valid, as there is quite a bit of overlap between the two. Many Processing questions are Java questions in disguise.
However, I've also noticed a tendency for commenters and answerers to miss the processing tag (I understand why, as Processing is not an obvious tag) and treat questions as purely Java questions. Asking to see a main()
function that Processing simply doesn't use. Asking the OP to provide definitions for functions that are internal to Processing. Saying that the syntax is invalid, even though it's perfectly valid Processing syntax.
Here are three examples from just this week:
(Edit: These questions have since been re-opened, which is great. Thanks, meta-effect! But it's worth noting that usually these questions would have stayed closed.)
This question asks about embedding Processing in a
JPanel
. This is a very common Processing question right now. Processing 2 had the ability to embed itself as an AWT component, but Processing 3 removed that ability. You can still do it, but it's not as straightforward as it used to be. So people who upgrade Processing have questions about this. They're pretty specific to Processing, and if you know anything about Processing 3 then you know exactly what this person is asking. But it was closed as being unclear.This question asks about accessing Processing functions from inside a class. Again, the question is pretty clear to anybody who knows about Processing. But it was also closed as being unclear.
This question asks about a
NullPointerException
(NPE) that's happening inside Processing. It was closed as a duplicate of the canonical question on Java NPEs, which I don't think is fair. NPEs are not as straightforward to debug in Processing - the line numbers in the stack trace refer to the compiled Java code, not the Processing code, so it takes a few extra steps. Besides that, this question is asking about an error that's happening internal to Processing.Edit: Here is another one, asking about an NPE internal to Processing. The exception is not caused by the reasons outlined in the canonical NPE question, yet it was closed as a duplicate.
I'm a bit frustrated by the seemingly knee-jerk reactions from Java developers, which aren't always valid with Processing questions. I understand the reaction with Java questions, but I don't think they always apply to Processing questions.
Usually one would think that getting more eyes on a question would increase its chances of being answered. But it seems like I have a better chance of helping people when they don't tag the question with java. This doesn't feel right.
How can I help Java developers understand that sometimes "the Java reaction" doesn't apply to a Processing question?
I guess I'll start linking them to this question, but more often than not the damage has been done before I get there, with questions being closed or deleted before I can comment. Voting to reopen seems to have no effect, as there just aren't very many Processing answerers on this site.
vise versa
, despite syntax similarities. Maybe more appropos, C and C++ have bona fide language overlap, but it is rarely appropriate to tag a question with both languages (and regular respondents in those tags frequently say so).