We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have some friends who are programmers, and every time we talk, they start telling me, that I should invest more time into learning some serious language (C sharp, or some other alternative), rather than write my programs in Processing which is just a "wrapper of Java".
Their main point is that C#, for instance, is much faster, than Processing. And, as long as, Processing is not even fully Java, it is even slower, than Java.
Now, I am not a programmer, so I don't know much about the "speed" of different languages. Could someone clarify the issue for me. Is Processing really very "slow"? Does it really matter if I run it on my PC, which has more computing power, than, say a tablet.
Answers
[citation needed]
both java and c# compile down to intermediate code that runs on a virtual machine. i doubt you'd notice much difference in speed between the two. but you won't be running c# on linux or a mac without a lot of hoop-jumping though.
(if you'd've said c++ then that would be a different matter as that produces native code that doesn't use a virtual machine. and will generally be faster. but how much depends on so many different things.)
and processing won't be any slower than java. it's not really a wrapper, it's a library, to make doing graphical things a lot easier.
get more interesting friends 8)
It is not a wrapper for java. It's a dialect as they like to call it. It takes things away like having to declare things public / private / protected. All you can do in java can be done in processing.
I can also program in other languages like c++ and objective c. And yes they are a lot faster, but if you do things wrong they are slow. I really hate with those languages that you have to declare really a lot. There is the header and the implementation etc. In processing you can have 1 line of code and there is an ellipse on your screen!
I think processing is perfect if you have to learn programming. There is so much for you to learn that can also be applied to other languages. C++ is quite similar to java, almost every programming language is quite similar to each to a certain degree.
I really recommend this book: http://mitpress.mit.edu/books/processing-1 I think it's one of the best books I have readed, and I have readed from different languages. The cool thing about it is that you also learn to program in a visual way, which is way more fun then what most programming books have to offer.
Once you get familiar with processing you will notice that your more often start to read javadocs. Using code for java etc. And one day you probably start learning another language as well. And that will go really quick if you have some experience. And I think for simple things or testing you will still use processing.
I had to program a pathfinder for example for a application in objective-c. It had to work in venice. But there was no data available about the nodes of how the streets connects. What I did is I took a vector image of the streets and processed that image to get my data in a text format. I think I could not have done it faster then anything other then processing.
I want to add one more thing. Lately I see it as a challenge to make things fast. And yeah, processing is slower then open frameworks for example. But often there are good ways to speed up things. I made this once:
It draws 10.000 rectangles with the average color of the image. For that I made a class that stores the average in a smart way (Integral image it's called). Often there are solutions like that, and this is really good for expanding knowledge.
Processing does support shaders now, those can be blindingly fast by comparison
I used Processing to make fractals several times in the past and a few times for very high resolution displays. One on of those displays I made a fractal that took 45 seconds to draw a single image. When I rewrote it using a shader it took less than a second to create the same image
Thank you for your answers, I am not sure I will be able to convince my friends of anything, but that is ok)
I will definitely get the book.
The first thing to say is that Processing is not slower than Java because Processing simply takes what the user types in and behind the scenes converts it to valid Java syntax and hands it over to the Java compiler.
The second thing to say is that Java is fast because the JIT compiler generates machine code which is then further optimised at runtime by the JVM. See here
Making generalised comparisons between languages is useless as they all have their own strengths and weaknesses.
More notes:
Processing.js (PJS), p5.js, OpenFrameworks.cc, etc.