Radio Inspire

How To Learn Sign Language

0.4: What are some programming languages? – Processing Tutorial


We’re very close now. We’re just a few videos away from actually
opening up a Processing window and typing in some lines of code, running our code and having our first
computer program. But I think before we do that I want
to talk about something which is – okay – let’s just say – It’s Time to Learn Programming, then the
big question arrives What programming language should I learn?
What’s my project? What am I doing? What’s the right environment? What’s the right
language? And this – this is a question that’s loaded with anxiety and confusion and, “Oh! What if I’m
learning the wrong thing?” and “Shouldn’t I be really learning this?” and I first I just want to say a general
comment first before we to take a programming languages. There is no
perfect programming language. There is no perfect programming environment that
will do everything you always wanted it to do is perfect and exactly right for the
particular project you’re making and often the answer to that question is,
you know, the answer to the question “what programming
language should use?” it’s the one that you just sorta feel comfortable with how it looks good
kinda like you’re happy to get started and the one that you’re using right now.
Better to be writing code and making something then to be spending all day worrying
about trying to find that perfect language so in a sense, one answer is, “Pick something
get started.” You can learn this language and try this
one later and another one later it doesn’t really matter. But for us we
have to come to a decision and in many ways I’m picking a programming language
and environment which is one that I’m comfortable with.
It’s one that I work on. It’s one that I’ve known for many years. I’s not perfect. – and so that’s what you will be learning.
And and hopefully you will find other languages
and environments in your life and this will have helped to you to that end. So let’s just – first though – okay so let’s think
about what are – what’s the kind of map of programming languages that are out
there and what what are the sort of pros and cons advantages and disadvantages
using different languages Hello! Okay! So one thing we can look at (I’ll provide a link to this) this is a nice
little chart called, “The History of Programming Languages,” I think it’s available from O’Reilly, and we can first at least see
like back here in 1954 the invention of Fortran which you can see right here we can
start to kind of like scroll around this thing, we can see that there are zillions of languages and they have
various relationships and they all have funny names like Oberon AINSI C and Ada and all sorts of other stuff.
The other thing I should point out about this nice little graph/chart is that ends in 2004 so a lot has happened by the way the last
ten years nine or ten years there’s a lot of other languages a lot
of other innovations on this chart if you were to continue it would get even bigger and crazier but
you know just looking at you realize oh, my goodness, it’s totally overwhelming. look how many language there are. We
could also kind of go to Wikipedia there’s “Comparison of Programming Languages” page
and you can scroll down and see, look all these possible languages. There
are zillions of them. So I think we can kind of make our own
little list, just to kind of – you know you’ve probably heard –
this would be the moment where I’d say, “Hey, everyone out there, the three of you
watching this video, raise your raise your hand and shout out a
programming language that you’ve heard of,” and you might say, “Pascal!” (probably none of you has heard of Pascal) but – Pascal – (Ooh, boy this pen doesn’t work) Pascal. There we go. You might say
C. You might say Java. You might even say something like, “Oh,
what this thing, ‘Assembly Language’ or ‘Machine Language?'” I’ll write Assembly Language down here. And you might say, “Oh, what about ActionScript?” And you might even learn something – have heard of something – probably you haven’t,
but the first programming – one of the first programming languages I learned actually was “Lingo,” which was the programming
language of Macromedia’s Director which I believe still exists? Anyway so we could start making this list, and I
kinda started doing this I think I probably put Pascal in the wrong place but what I’ve – one of the things i wanna talk
about with this kinda list of programming languages and what you might pick – and I’m gonna say say C++ / Objective-c is this idea of low level versus high level and this is kinda lowel-level
[corrects spelling error] low-level high-level this is an important concept
that comes up in thinking about programming languages,
right? So essentially let’s say you want to write
the lowest level possible code, that you were completely insane
person who wanted to just like torture yourself for eternity, you would you would say I’m only going to write my
computer program as a sequence zeros and ones, right? Because ultimately so here’s mine – you know this – execute this code – it’s amazing – it’s
beautiful. Here this is my program, right? (and I guess you can see it because I
wrote off the edge of the screen) but let’s just say this is your
program – what am I talking about? Okay, this is like the lowest –
essentially everything that executes on your computer – all data – is stored – all instructions are stored as a
sequence of zeros and ones. But this is unrealistic.
How could you possibly really be expected to write software just as a series of 0’s and 1’s? So
there’s generally a process where you want to be able to write your code in
a higher level way the ultimate like – if I’m creating a
graphics application, which is what we’re going to be doing, a really high level programs might
say – might be written something like this draw a red square – draw a square on the
screen that’s like medium size and red colored and draw circle that’s really big and blue.
That’s very high level. It really is like English and
what happens is there’s a compiler that will take that high-level code and translate it into machine language. So assembly language is kinda want to
the lowest level programming languages that people use. When C came around, C was often
refered to in this kind of like oxymoron type way a high-level low-level language meaning it’s
high-level in that you’re writing code that starts to
have higher-level, more English-like constructs, but it still
allows you the low-level access to the computer – direct access to the computer’s memory – lots
of stuff that you can do it makes it very very very – you can execute very very fast. So anyway that’s just
kind of an important concept to realize most of the languages that I haven’t
kind of written up here which I’ll kind of like add over here
like – that you may have heard of- like Ruby, JavaScript, Python, and we could keep going here,
we could write lot others these are all generally high-level
programming languages. Now there’s another kind interesting
little component that I think that I’ll mention which is this idea of a language
that’s ‘compiled’ versus ‘interpreted’ – now in many ways I almost
want to stop myself and not talk about this because – we don’t really – these are some
details that when we’re first learning to program we’re gonna put aside. We just want to write
the code run it and make stuff happen but it’s something to think about as you
start getting to this larger world of programming languages. So let’s say you’re writing a program in C,
right? You write out the text-based instructions in your high-level language. That program
gets compiled down into the sort of lowest level program
which is like one level below Assembly Language, which is
Machine Language the zeros and ones. Then it can be run.
This is great; it makes it run it makes run very very
very fast but it is – – is different that some languages that we
have now that are interpreted, JavaScript being one of those. A language which is interpreted is
actually – while the program is running – it is
reading your code line by line and executing the program. This allows for
things like live coding, right? If a program is
actually reading the code as it’s running you could change the code as it’s running and the
program would change in real time which cannot happen in a compiled language
because you’ve got to write your code, compile, then run it. So I the reason why
mention this is we’re using – we are going to use Processing (am I recording? Yes?) We’re going to use Processing which is, and our code is actually going to be
compiled before it’s run which is something we’ll see as we start to
first write our programs. Another topic that I want to bring up is
this idea of ‘client-side’ versus ‘server-side’
programming. This is an important question because you know you you might have project
ideas in your head things that you want to make and one
thing might be, “I had this idea for this kinda interactive exhibit about dinosaurs for a science museum.” In that sense you might be building a client-side application a desktop application that’s
gonna run maybe it reads some pixels from a camera so the user can
interact with in a draw some dinosaur footprints to the screen or
something like that. You might also have an idea for, “Oh, I have this
website I want to make where the user enters all this
information about – personal information about themselves – and it gives them back their horoscope.” so these are different applications and
require a different set of programming languages for them, and one thing that we can see here
i mean all this idea of anytime you go to a web
page – if this is my web browser – and you type in, you know, “Google.com”
and you search for something you are sending a request to a server in the cloud which – it’s not really a
cloud – it’s an underground bunker basically with some servers, but you could think of it as a nice cloud floating in
the sky – where a program – a server-side program –
“a server-side program” executes and returns information back to you so
you can see the result in the browser. This is different then, perhaps, there being an animation in
the browser that’s running that you click on and when you click on
it it makes little pretty fireworks. That might be something written in JavaScript that is executing on the client side, this
animation that’s running locally on your computer and reading your mouse clicks. The server
side programming is this thing that happens when you have to request the
program runs it says you data back. Perhaps that’s written in Python. Now
there are lots of different languages. In some languages you can write, you know, in JavaScript you can write
client-side programs, and in Javascript you can write server-side programs something
called Node.js – it’s not language-specific, but conceptually
there’s a different thing going on here. Are you writing a program that is executing
locally on your laptop? You know, here on my prop here there’s a
program running on this laptop. It is drawing pixels to the screen. That is a client-side program. There’s a
program running somewhere else on a server that is sending me information
back about how excellent my jog was this morning or whatever from the RunKeeper website or whatever but (I
guess I just plugged RunKeeper. I like it) That’s a server-side program. So this is
an important consideration when you’re learning programming languages and you’re creating applications with
them, and this is something you want familiarity with, both client-side and
server-side. This video series that I’m doing, while we
will refer to and demonstrate some examples that involve server-side programming later, on is
really focused on client-side programs. We’re going to be
writing applications that open a window on your
computer screen draw pixels, draw text, draw things to
that window, and that you can interact with on your
laptop, so were really learning client-side, which I think is an
important thing to note. And this brings up kinda where with we’re kinda finishing off here so if you want to do stuff for the web, there are a lot of fantastic resources
out there for you to learn web programming. JavaScript is a
terrific programming language to learn has lots of
applications Python is another fantastic language
to learn as a beginner, but we’re going to use something called
Processing, and I’m going to writet “Processing” right here and I’m going to draw up like a weird
little arrow there that is pointing back to Java.
So what is Processing? Processing (I really should be able to say it) Processing was developed – was created – in 2001 by Casey Reas and Benjamin Fry while they were
students at the MIT Multimedia Lab under John Maeda so what Processing really started as
was, “Hey, we need something to make these projects
we’re making. Let’s make something.”
So Processing is this really nice simple environment. You can download it. It’s kind of all-in-one.
You can open it. You can type some code. You can run it.
It works. So I’m gonna get to that in a second – more about why we’re
using Processing, but let’s just think – you’ve probably heard the term “Creative Coding.” The term “Creative Coding” started as a
kind of catch-all phrase for people making creative applications
with code, trying to make Art, trying to make
installations, trying to make weird obscure impractical crazy ideas, and you know there’s a lot of
discussion now, “Is this a good term? Is this a bad term?” One thing I think I heard from
Jer Thorp was you could think of it as “creative writing”
– the process of writing for – the process writing code for
creative applications. There is also now the term “Poetic Computation,” which
i think is interesting. But anyway, there are lots of
environments and I’ll draw a line here – you might
have heard of something called “Open Frameworks.” You might have heard
of something called “Cinder.” These are creative coding
environments. These are libraries – frameworks – for writing code, and your code, though, is really C++. C++, even with all of its advantages in terms
of having low-level access to the machine is a very hard language to get started in
right from the beginning. You have to a have to manage that
memory. There’s lots of stuff you have to learn about, like these things called “pointers.”
There’s — you’ve got to – using these environments
in addition to writing C++ you’ve got to use on the Mac something called Xcode – the
development environments which are larger and more complex, so –
I want to use in this video series something that’s a bit
simpler that we can get started with a bit more quickly. But these are
terrific environments with a lot of similar qualities to Processing. The
other thing you might have heard of which I think is important to mention is something called max “Max/MSP/Jitter” I’m going to put this over here
somewhere: Max/MSP/Jitter and there’s also something called PD
or “Pure Data.” these are known as dataflow programming environments, and the interesting
thing about dataflow programming environments is you actually aren’t actually writing your code
as text. you’re essentially designing a flow chart for how your
program should run. You’re putting a box on the screen and
than giving that box some inputs and then connecting some data to those
inputs and then the box may have an output which goes to another box (and it
looks like an interesting little alien there) – So this is actually really
fantastic and for many people – many people
find this way of programming more intuitive
and easier to do. It’s certainly works wonderfully for audio applications because
if you think about how an audio app – if you build audio system physically you
have a bunch of mixers and instruments and cables and
things have input and output go through stuff it eventually make it
to a speaker that comes out. So this idea of writing an audio application with the
dataflow programming environment is a – and you can certainly do graphics
applications and many other things. I would encourage you to look at
Max/MSP and PD. So there is huge world of stuff and you
could spend your life learning every programming language. You could
also spend your life worrying about “OMG which one should I use?” So I’m
gonna say to you right now, “Stop worrying.”
If you feel like you don’t like the way this video series is going then go to another resource online and
learn a different programming language. But what I will –
What we’re going to use is Processing. And I’m going to very briefly now show
you kind of the core basic reason – one of the core reasons why Processing is
gonna work well here for learning to program. And so let me
walk over here and I’m going to switch over to the desktop – Processing is just an application. I’ve
downloaded it. It is already sitting here on the machine.
Where do you download it? I guess I might as well show you this right now. If you go to
Processing.org you can actually click here to
download Processing. I guess I’ll mention that Processing is a non-profit foundation. You can make a donation when you
download, and that donation is tax-deductible but it is available for free. You are not
required by any means to donate and I would imagine maybe when you’re just
first trying it out you wanna see if you like it first. But the other thing I should mention
here is all these creative coding environments, Open Frameworks, Cinder, Processing, these
environments live in this rich landscape of “Open Source.” So what does this mean for it to be
“Open Source?” It means not only can you get – are you getting this
software these things are available to you for free (although Open Source doesn’t have to be free)
[but it also means] that the source code how – these
things are written, right? – these are libraries that are applications – you can actually go and
read the source code, contribute to them, it is all completely open to you and all
this stuff is available in something called GitHub which is a website, essentially, for sharing open source
projects. But i digress. This is where you can get Processing and
download it. Once you have it on your machine you can run the application and you can
see here when you run it you’re going to get
this window like this and if I zoom in all the way here we can
see there’s this nice little button called “Run.” And if I were to actually just run – press
“Run” right there we get this little window and look!
Here it is! Our very first computer program we’ve
ever written! There it is running. It opened this window, and
look at the code! It’s amazing! It’s like “The Emperor’s New Code” or whatever.
There’s nothing there. Obviously the next steps were gonna get
to in the future videos – we’re still in this sort of introductory place – but
you can just skip right ahead – is, “What do we write there?
What do we write there, and what is it that happens?” and – but – um – but I’ll just write one line
of code just to demonstrate this – and this is what – one of the nice things about using Processing
is we were able to just write our code really simply in this
interface, run it, and we get our window and everything just kinda a works really
we can kind of get up and running with that really quickly. Okay so there’s so much more to say
about Processing and why we’re using it I guess um – but I think this video has gone on
for quite a bit of time. I’ve kind of rambled through a lot of things – so we’re going to – We’re going to get to a bit more about
Processing, the reference, how it is that you really learning Java
while you are writing Processing – I think we’ll get to that as we as we as we start learning in some of
the future videos. Okay, the next thing I think I’m
actually going to continue this thread by showing you a kind of range of projects
and things that are made with Processing and Computational Media that might help you start to think about
the kinds of projects you might make a while following along these videos

86 Replies to “0.4: What are some programming languages? – Processing Tutorial”

Leave a Reply

Your email address will not be published. Required fields are marked *