Monday 5 June 2017

Processing vs P5.JS vs Processing.py - Which To Choose?

Processing is the programming language designed specifically to make it easy for artists to create algorithmic art.

Yes, I know .. it has a terrible name, that confuses anyone who says "processing" ... but apart from that it is very good. It's used in the leading art colleges and universities, and

Here is a nice introduction to Processing by the inspirational Daniel Shiffman @shiffman.



Processing vs p5js vs Processing.py vs ..

Originally Processing was one language which came with it's own editor and runtime (the thing that ran your code and showed the images or animation).

That thing was based on Java, which was stable, and available on many platforms - Windows, Mac, Linux, and others too.

In recent times, the community has started to create different versions of Processing. The leading alternatives are p5js and processing.py. P5js is Processing implemented in Javascript, and works through web browsers. Processing.py still runs on Java but tries to have a more Python-like syntax, with the aid of Jypthon.

Which to choose for our Make Your Own Algorithmic Art?


Let's look at the pros and cons.

Processing

Advantages:
  • The original and primary implementation of Processing.
  • Lots of existing guides, tutorials, books for Processing.

Disadvantages:
  • Needs specific software to be installed to create art. 
  • Anyone who wants to see the creations also need to install the client - which is unreasonable.


p5.js

Advantages:
  • Creation of art does not need special software. 
  • Consumption of art does not need special software - only a modern web browser, which means works can be viewed on computers, laptops, tablets, smartphones... even tony things like Raspberry Pis, popular in schools and kids code clubs.
  • Works can be hosted easily on the web.
  • Based on javascript which has huge adoption and huge effort to continuously improve it's performance. 
  • Is an official project of the Processing Foundation - and therefore receives full backing (and quality control).

Disadvantages:
  • Debugging the code is not as intuitive or effective as the main Processing - you're effectively using the browser's javascript console to see errors for a clue to the bug.


Processing.py

Advantages:
  • Python is the best language for new comers to learn. It is easy to learn, easy to read, very applicable, has huge adoption and community. Many kids in primary schools are learning it to support the UK's new curriculum. Huge enterprises like Google use Python. It's also the de facto standard for data science, with a rich set of libraries.
  • The Python version of Processing has much simpler and easier syntax - no horrible curly braces or semi-colons to deal with. 

Disadvantages:
  • Relatively new, with fewer resources and guides, and some are actually out of date and don't work.
  • Some issues and bugs still present.
  • Based on the same Java application as main Processing, and so needs it for both creation and consumption.
  • Lots of useful Python libraries don't work as the implementation is actually Jython.


The Right Choice: p5.js

The choice wasn't easy.

I would have loved the simplicity and beauty of Python. Given the intended audience of readers who may be first-time coders, or those who are just not very confident - Python is by far the best language to learn. Far better than the less friendly javascript-like syntax of p5.js.

The next most important concern was accessibility. P5.js is based on web technologies which are standard in almost every computer from a laptop to a smartphone. No need for special software to create algorithmic art. And even more importantly, no need for special software to view and interact with the created art. Working over the world's most pervasive, open and democratic technology platforms - the web - is a huge plus for p5.js ... even if the syntax isn't ideal, and the debugging is not that friendly.

So the winner is ...




1 comment:

  1. Thank you for the insight. It's been a real headache trying to decide between p5.js and processing.py. The fact that processing.py is made with Jython was critical to my decision. Python is already using up a lot of memory, I don't need JVM hogging up more.

    ReplyDelete