Is the p5.js mode the right one to use?

edited February 2018 in Questions about Modes

I'm new to this entiiiiire Processing thing, and after reading a bit, I'm quite confused - I'd like to code in Javascript and have my stuff run inside a browser - is the "p5.js" mode inside Processing 3.3.6 the right thing to use? Or should I use processing.js? What's the difference between em?

Thanks.

Answers

  • Sounds like P5.js is right for you.

    Shameless self-promotion: here is a guide explaining all the different Processing versions.

    Normally my recommendation is this:

    • If you're just starting out with programming, use Processing.
    • If you've encountered Processing and JavaScript before, and you're starting a new project, then use P5.js.
    • If you already have a Processing sketch and you want to deploy it to a webpage, use Processing.js.

    So if you're just starting out, I'd recommend using Processing just because it makes it harder to shoot yourself in the foot. But if you've dabbled with JavaScript before, then I'd recommend P5.js. But really it's up to you and your preferences more than anything.

  • Hey, thanks for the reply.

    What if I've ONLY encountered Javascript before, and not Processing?

  • Like I said, it sounds like P5.js is right for you. But the best thing you can do is try them all out and see which one you like the best. Write a simple hello world program and see what works for you.

  • When you run Processing, it runs first in java mode by default. You need to install the p5.js mode AND then switch to p5.js mode before you write any code. Before you switch modes, make sure you save all your work. When you run a sketch in p5.js mode, it will launch it in a browser for you. If you want to see the folder layout of your sketch, then in the processing Window press Ctrl+k.

    You do not need the Processing IDE to run your sketch btw. You can use openprocessing, sketchpad.cc, thrimble from Mozilla, etc.

    One small side note. Processing.js allows you to run java code in a browser. What it does is it converts your java into js but you pay a price. This conversion is very limited. You are not allowed to use external libraries and you need to keep in mind the p.js project doesn't seem to have much support anymore. It still work and there is even a p.js mode that you can install in the Processing PDE. However, this mode can only be installed manually as it is not available in the Contribution Manager. I guess by now you have read Kevin's notes on the subject...

    Kf

Sign In or Register to comment.