Interface and Application programming

In this week’s we saw a large amount of programming languages that will enable us to write some code for applications and interfaces. There are many different high or low end languages available. Neil highlighted three languages in particular : Python, Javascript and Java. These ones are two of the most known programming languages available.

Python

This is a high level programming language which is known for its code readability. It makes use of object-oriented programming. This approach helps developers to write clear and logical code.

Python can be used with Processing. Here is the link to the documentation of Processing.py.

It works with the basic Processing environment. It is a software that allows to make visualisations, drawings and videos with code.

Processing_env

You cannot program in Python by default in Processing. You’ll need to install an add-on called Python Mode. It’s easy to do, you can do this by clicking on the drop-down menu on the right side of the tool bar and selecting “Add Mode…”. A window with the title “Mode Manager” will appear. Scroll down until you see “Python” and press “Install.”

After you’ve installed Python Mode, you can switch back and forth between the Python and Java versions of Processing using the drop-down menu in the tool bar.

Here is a demo of the Python mode in Processing : video of Python mode

Here is an exemple of code written in Python :

python

Javascript

This high level programming language is withly used for web applications. The programs in this language are called scripts. Javascript can run on a front-end page while python is only for back-end.

You can use the library D3.js to make some visual effects. It is a JavaScript library for manipulating documents based on data. With D3 you can also bring data to life using HTML, SVG, and CSS.

To use it, you just have to download the latest version (5.9.2) in the D3.js website here:

D3.zip

You can also link directly to the latest release by copying this snippet:

<script src="https://d3js.org/d3.v5.min.js"></script>

Here is a video demo of a demonstration of D3.js : video of D3.js

And here is an exemple of code written in Javascript for D3.js :

D3

Java

The standard language that comes with the software Proccessing we’re gonna use this week is Java. Java is used for all server side development and needs to be compiled.

What are the advantages of using Java ?

Here is a video demo of how Processing works : video of Processing

And here is an exemple of code written in Java for Processing :

java