John Resig : When Java and  JavaScript  finally meet

Many people sometimes ask : is there a relationship between Java and JavaScript? One answer i found somewhere is : “They enjoy the same relationship as car and carpet” ,meaning it is a relationship in name only. And it’s true, JavaScript was first named LiveScript by Netscape, the first real browser company. As Java was increasing in popularity, it was decided to rename it to JavaScript *1. As they did not have any relationship, well, nobody cared. Now, JavaScript is linked to Java by more than just a name!

The spark starts: The entry of Processing.

www.processing.org

download

What is Processing?, why was it created? Casey Reas and Ben Fry, the inventors of the language say : “We created Processing to make programming interactive graphics easier. We were frustrated with how difficult it was to write this kind of software with the programming languages we usually use (C++ and Java) and were inspired with how simple it was to write interesting programs with the languages of our childhood (Logo and BASIC). We were most influenced by Design By Numbers (DBN), a language created by our research advisor John Maeda, which we were maintaining and teaching at that the time.” They were studying at the MIT. *2

The craze of Processing

Processing is so simple: it provides instant graphical results, as well as integrating Object-Oriented Programming which makes it a suitable starting point in programming for children. From paint programs to chat applications passing through unbelievable visuals, both static and dynamic, processing has taken the world by storm.

The PIV virus

The Processing Integration Virus (PIV) is the virus of wanting to integrated processing everywhere, once you discover processing, you want to integrate it wherever you code, are console applications not just too plain? Where do people pass most of their time viewing finished products of coding? on the web, of course. At one time, the need was felt to include processing on web pages, to beautify them or to show your creations to the world. But web pages are designed using HTML, CSS and JavaScript, so, how to integrate a Java-based language on a web page?

John Resig joins the play!

download3

If the name John Resig sounds familiar to you, it’s probably because you have heard of him before. He is the builder of the JQuery JavaScript library, the most used JavaScript library in the whole world! He is currently a staff at Khan Academy *3. Well, to frame Processing on web pages, it was no wonder that such a genius accomplished the feat!

The hard way

John Resig did it the straight way: he used “terribly clever” JavaScript tricks to achieve the same results of Processing, he started ProcessingJs. With ProcessingJs, you can use the same Processing syntax, and get the same result, except that everything now works under JavaScript. You can also use var for variables instead of int, double, etc.

www.processingjs.org

download2

The power of Processing : Arduino

Massimo Banzi, the co-founder of Arduino says about processing :

“Processing changed dramatically the way we teach programming and it’s one of the major factors of the success of Arduino”*4 ,

this in itself is a great testimony as to the impact of processing!

-The Processing IDE and the Arduino one have the same look.

-Both have an in-built option to support each other

-The download page of both are similar; the contribute or download type.

A live example of processing :

I created a simple sketch,view it here:

http://abdurrahmaanj.byethost12.com/processing-example/

Processing : Some characteristics.

*Multi-platform : Processing works under Windows, Mac OS or Linux.

*Secure: Allows high-level cryptography for the exchange of important private information.

*Network-centric: Applications can be built around the network protocol.

*Dynamic: Allows dynamic memory allocation and memory garbage collection

*International: Supports international characters.

*Performance: Provides high performance and just-in-time compiles and optimisers

*Simplicity: Processing is easier to learn than other languages such as C, C++ or even Java. *5

You can also pull in JSON data in your processing application!

The family of processing :

untitled

*6

References :

1* Eric Freeman

2* Getting started with processing, Casey Reas and Ben Fry

3* http://ejohn.org/about/

4* Getting started with processing, Casey Reas and Ben Fry

5* Algorithms for Visual Design Using the Processing Language, Kostas Terzidis

6* Getting started with processing, Casey Reas and Ben Fry