< Return to Video

Q&A #7.1: Comparing p5.js and Processing - Part 1

  • 0:00 - 0:04
    *train whistle* hello welcome to a Q&A video I'm
  • 0:04 - 0:05
    going to talk in this video about what
  • 0:05 - 0:07
    is the difference between p5.js and
  • 0:07 - 0:09
    processing, i'm probably in a moment going to say
  • 0:09 - 0:11
    exactly that same thing, because I'm actually
  • 0:11 - 0:12
    just after the fact recording an intro
  • 0:12 - 0:15
    because I went on for so long i decided
  • 0:15 - 0:17
    to drop to divide this particular
  • 0:17 - 0:19
    discussion into three parts. so the first
  • 0:19 - 0:21
    part i'm just going to kind of talk
  • 0:21 - 0:23
    about those real bigger picture of these
  • 0:23 - 0:24
    two different environments and what
  • 0:24 - 0:26
    programming languages they're built on
  • 0:26 - 0:29
    and kind of how that plays a role in
  • 0:29 - 0:31
    their features and ways that you work
  • 0:31 - 0:33
    with them and I'll diagram that on the
  • 0:33 - 0:35
    whiteboard the second part i'll actually
  • 0:35 - 0:36
    show the two different environments and
  • 0:36 - 0:38
    type some code side-by-side and look at
  • 0:38 - 0:40
    the editors and see some pieces of that
  • 0:40 - 0:43
    and in the third part i will make a list
  • 0:43 - 0:45
    of pros and cons of why you might want
  • 0:45 - 0:48
    to use one versus the other or where
  • 0:48 - 0:50
    one environment excel over the other
  • 0:50 - 0:52
    environment and as well as take some
  • 0:52 - 0:54
    questions from the live chat about
  • 0:54 - 0:55
    things that I missed
  • 0:55 - 0:57
    so that's going to be three videos if
  • 0:57 - 0:59
    you find them interesting please watch
  • 0:59 - 1:01
    them if you kind of don't please don't
  • 1:01 - 1:03
    watch them and offer you maybe in the
  • 1:03 - 1:05
    second part *train whistle*
  • 1:05 - 1:07
    hello welcome to a coding train Q&A
  • 1:07 - 1:09
    video in this video I'm going to answer
  • 1:09 - 1:11
    a question that I get a lot about the
  • 1:11 - 1:13
    project the software projects that are
  • 1:13 - 1:14
    maintained by something called the
  • 1:14 - 1:16
    processing foundation the processing
  • 1:16 - 1:19
    foundation was founded in 2012
  • 1:19 - 1:20
    its mission is to promote software
  • 1:20 - 1:22
    literacy within the visual arts and
  • 1:22 - 1:23
    beneficial literacy within technology
  • 1:23 - 1:26
    related fields and I would say
  • 1:26 - 1:28
    primarily also to make these fields
  • 1:28 - 1:30
    make this more accessible to diverse
  • 1:30 - 1:31
    communities and i encourage you to read
  • 1:31 - 1:33
    more about the processing foundation's
  • 1:33 - 1:35
    initiatives and projects and mission, all
  • 1:35 - 1:37
    on the process foundation website but
  • 1:37 - 1:39
    I'm not here to talk about the processing
  • 1:39 - 1:41
    foundation in this video because i have
  • 1:41 - 1:42
    this habit of doing that all the time
  • 1:42 - 1:44
    the question that i get a lot and this
  • 1:44 - 1:47
    question comes from someone named
  • 1:47 - 1:49
    shiffman ok so i posted this question
  • 1:49 - 1:52
    but it's only because people tweet and email it to me all the time
  • 1:52 - 1:53
    but you can actually ask your own
  • 1:53 - 1:55
    questions here other github repository
  • 1:55 - 1:57
    in the issues which I'll link to in this
  • 1:57 - 1:58
    video's description but the question
  • 1:58 - 2:01
    here is what is the difference between
  • 2:01 - 2:03
    p5.js and processing and the last time I
  • 2:03 - 2:05
    tried to make a video you'll see it in
  • 2:05 - 2:07
    this playlist answering the question I
  • 2:07 - 2:08
    really went into the history
  • 2:08 - 2:10
    of these projects and why they
  • 2:10 - 2:12
    exist and the philosphy and
  • 2:12 - 2:13
    principles behind them in and some
  • 2:13 - 2:16
    differences in that extent
  • 2:16 - 2:17
    but i didn't really get to what I think is
  • 2:17 - 2:19
    important and on a lot of people's minds
  • 2:19 - 2:21
    which is the technical differences
  • 2:21 - 2:22
    what are the
  • 2:22 - 2:24
    underlying programming languages behind
  • 2:24 - 2:26
    these environments
  • 2:26 - 2:27
    what kind of editors can i use with
  • 2:27 - 2:29
    these environments what kind of projects
  • 2:29 - 2:30
    what kind of features do they have
  • 2:30 - 2:32
    whats the difference between
  • 2:32 - 2:34
    the syntax and features of both
  • 2:34 - 2:37
    of these frameworks and that's what I
  • 2:37 - 2:39
    want to discuss in this particular video
  • 2:39 - 2:41
    ok so I'm gonna come over here to the
  • 2:41 - 2:44
    whiteboard for a second, hi! I'm over
  • 2:44 - 2:47
    here at the whiteboard now
  • 2:47 - 2:50
    so here's the thing, processing and p5.js
  • 2:50 - 2:53
    are I would say open source
  • 2:53 - 2:59
    frameworks software projects that are
  • 2:59 - 3:01
    kind of broad projects that involve
  • 3:01 - 3:03
    different aspects and so each one let's
  • 3:03 - 3:06
    think about each one as sort of
  • 3:06 - 3:09
    three categories so each one of these
  • 3:09 - 3:13
    projects is all three of these things
  • 3:13 - 3:15
    if some ways, a library
  • 3:15 - 3:17
    they're built on top of a programming
  • 3:17 - 3:21
    language and then for each one of these
  • 3:21 - 3:23
    that you might use you need someplace
  • 3:23 - 3:25
    where you would sort of type your code
  • 3:25 - 3:27
    and figure out how to use it an editor
  • 3:27 - 3:29
    so let's think about these three
  • 3:29 - 3:34
    categories for a second so p5 and
  • 3:34 - 3:38
    processing let's start with processing
  • 3:38 - 3:41
    so processing is built is written is a
  • 3:41 - 3:44
    library for so these are really kind of
  • 3:44 - 3:47
    one thing
  • 3:47 - 3:51
    it's really not three, it's really two.
  • 3:51 - 3:54
    processing is a library
  • 3:54 - 3:58
    for the java programming language
  • 3:58 - 4:00
    the library, the things that processing
  • 4:00 - 4:02
    is adding or building on top of, or
  • 4:02 - 4:04
    giving you features for are things
  • 4:04 - 4:11
    like drawing data hardware
  • 4:11 - 4:17
    sound
  • 4:17 - 4:18
    so maybe this is a good way of thinking about it
  • 4:18 - 4:20
    and maybe I could add more things here
  • 4:20 - 4:22
    so it's a library
  • 4:22 - 4:24
    meaning it's really ultimately what it
  • 4:24 - 4:26
    is one of the aspects of it if the
  • 4:26 - 4:28
    library of code that you can call
  • 4:28 - 4:30
    functions from, it's built on top of the
  • 4:30 - 4:33
    java programming language, there is an
  • 4:33 - 4:40
    editor for processing which I'll
  • 4:40 - 4:42
    say is like a desktop editor
  • 4:42 - 4:45
    so processing has a desktop editor
  • 4:45 - 4:48
    that you can download and use.
  • 4:48 - 4:52
    the language that p5 is written in and that
  • 4:52 - 4:58
    it is a library for is JavaScript and it
  • 4:58 - 5:03
    has libraries also for drawing and data
  • 5:03 - 5:07
    and sound
  • 5:07 - 5:09
    and hardware but I could keep
  • 5:09 - 5:11
    going with this list, but the primary
  • 5:11 - 5:16
    thing that i might add here HTML CSS or
  • 5:16 - 5:20
    maybe more importantly Dom.
  • 5:20 - 5:22
    because it's javascript,
  • 5:22 - 5:24
    and i'll get to this in a bit more
  • 5:24 - 5:26
    there's a big component of p5
  • 5:26 - 5:30
    involving the web, so now where do you
  • 5:30 - 5:33
    create projects using p5? Here is the thing:
  • 5:33 - 5:37
    processing which is a project that
  • 5:37 - 5:43
    started in 2001, in 2001 if
  • 5:43 - 5:45
    you wanted to write and compile and this
  • 5:45 - 5:47
    is a sort of an aspect to this as well and
  • 5:47 - 5:50
    create software sketches you would need
  • 5:50 - 5:53
    a code editor most code editors were
  • 5:53 - 5:56
    difficult to download install maybe you
  • 5:56 - 5:57
    need to use command line if you're just
  • 5:57 - 5:59
    using a text editor you have this big
  • 5:59 - 6:01
    giant complex environment like eclipse
  • 6:01 - 6:06
    so processing really the idea of
  • 6:06 - 6:08
    processing being an editor is really
  • 6:08 - 6:11
    fundamental to the project you download
  • 6:11 - 6:13
    this editor you open it up and you type
  • 6:13 - 6:16
    code in it you hit 'play' or a run button
  • 6:16 - 6:18
    you see the result of your code,
  • 6:18 - 6:22
    'E-Z peasy' so to speak so just as much at
  • 6:22 - 6:25
    processing is both a library with all
  • 6:25 - 6:26
    this functionality a place to call
  • 6:26 - 6:27
    those functions
  • 6:27 - 6:30
    in an editor in very fundamental to the
  • 6:30 - 6:34
    project. p5 in many ways that's a little
  • 6:34 - 6:36
    bit less the case because of the world
  • 6:36 - 6:39
    that we live in now and where you can
  • 6:39 - 6:41
    program for the web you know name your
  • 6:41 - 6:44
    favorite editor everybody has their you
  • 6:44 - 6:46
    can use added more supply more brackets
  • 6:46 - 6:47
    are codependent some of these are
  • 6:47 - 6:48
    web-based better just knowing their
  • 6:48 - 6:51
    desktop editors you can just have a you
  • 6:51 - 6:53
    can just use any text editor you can run
  • 6:53 - 6:56
    a server so there's all the fishes left
  • 6:56 - 6:58
    a little bit less of a fundamental piece
  • 6:58 - 7:00
    of the project out there was and I'm
  • 7:00 - 7:02
    gonna make a separate video about this i
  • 7:02 - 7:06
    think there was a p5 jas desktop editor
  • 7:06 - 7:10
    that we modeled after the processing one
  • 7:10 - 7:12
    of many similarities many differences as
  • 7:12 - 7:14
    well because ideas that simple thing you
  • 7:14 - 7:16
    downloaded tiger code you press the play
  • 7:16 - 7:17
    button you see the result
  • 7:17 - 7:20
    this has now been deprecated hopefully a
  • 7:20 - 7:22
    desktop editor will come back at some
  • 7:22 - 7:25
    point in lieu of developing an entire
  • 7:25 - 7:28
    web page editor so their website editor
  • 7:28 - 7:29
    is currently in development there's no
  • 7:29 - 7:31
    public release of it yet but certainly
  • 7:31 - 7:32
    when its release
  • 7:32 - 7:34
    I hope to have people who are working on
  • 7:34 - 7:36
    it comes and presented on the youtube
  • 7:36 - 7:36
    channel
  • 7:36 - 7:40
    Kathy target charts are occasions is
  • 7:40 - 7:42
    that is the lead developer of the People
  • 7:42 - 7:44
    vs web editor and the work that she is
  • 7:44 - 7:46
    doing is just but not else i'm very
  • 7:46 - 7:47
    excited to the point that will be able
  • 7:47 - 7:50
    to have that a public relief if there's
  • 7:50 - 7:52
    no this is not a new idea there are many
  • 7:52 - 7:55
    web-based editors symbol code pen
  • 7:55 - 7:57
    jsfiddle these are places where you just
  • 7:57 - 7:59
    go to your web browser you see a place
  • 7:59 - 8:00
    where you can type in code and you can
  • 8:00 - 8:02
    see the result of the code you could say
  • 8:02 - 8:03
    that you could share it
  • 8:03 - 8:05
    this is very powerful so while there are
  • 8:05 - 8:07
    a lot of options for web editors that
  • 8:07 - 8:09
    you can use we have decided to try to
  • 8:09 - 8:11
    make one that's kind of geared towards
  • 8:11 - 8:13
    people GS specifically and highly
  • 8:13 - 8:16
    tailored to a beginner so if you are a
  • 8:16 - 8:19
    teacher and you've got the group of you
  • 8:19 - 8:20
    know ninth graders on Saturday afternoon
  • 8:20 - 8:22
    for a couple hours you want to teach
  • 8:22 - 8:23
    them the beginning of learning to code
  • 8:23 - 8:25
    what would be the easiest way to do it
  • 8:25 - 8:27
    open up the browser everybody sign up
  • 8:27 - 8:28
    for an account type in your code hit
  • 8:28 - 8:31
    play save share that's kind of mp5 yes
  • 8:31 - 8:32
    to all the libraries are configured and
  • 8:32 - 8:33
    set up for you
  • 8:33 - 8:34
    that's kind of a goal of this this
  • 8:34 - 8:36
    particular web editor
  • 8:36 - 8:39
    project so this is the landscape between
  • 8:39 - 8:44
    these two things so now here i think it
  • 8:44 - 8:47
    is worth exploring for a second and then
  • 8:47 - 8:49
    i'm going to them kind of 102 things
  • 8:49 - 8:50
    going to do is just show you these two
  • 8:50 - 8:51
    environments and like make the same
  • 8:51 - 8:53
    program in both of them to see
  • 8:53 - 8:55
    highlights of differences and then I
  • 8:55 - 8:56
    also want to make a list of pros and
  • 8:56 - 8:57
    cons of why you like you want to use one
  • 8:57 - 9:00
    versus the other but let's let's spend a
  • 9:00 - 9:04
    minute here on Java and JavaScript and I
  • 9:04 - 9:06
    don't like to say versus just put a
  • 9:06 - 9:08
    little heart because i love you by the
  • 9:08 - 9:10
    way people think java is like not a
  • 9:10 - 9:14
    thing anymore but it's used so widely
  • 9:14 - 9:17
    and people don't like job but i like all
  • 9:17 - 9:18
    programming languages it's the place
  • 9:18 - 9:20
    that you can write some code and express
  • 9:20 - 9:22
    yourself and make something interesting
  • 9:22 - 9:23
    it's a good place to be might not be
  • 9:23 - 9:25
    your favorite but let's not be so mean
  • 9:25 - 9:29
    about java so Java is a programming
  • 9:29 - 9:32
    language i think it was started in 1991
  • 9:32 - 9:33
    but really more formally launched
  • 9:33 - 9:36
    probably 1995 everyone in the comments
  • 9:36 - 9:39
    can correct me here if you walk up and
  • 9:39 - 9:43
    the idea of java the big exciting thing
  • 9:43 - 9:48
    about java was write once run anywhere i
  • 9:48 - 9:50
    think with the acronym write once run
  • 9:50 - 9:52
    anywhere anywhere
  • 9:52 - 9:55
    whoa Rob war up at the Royce didn't have
  • 9:55 - 9:58
    like a good ring to it but um the idea
  • 9:58 - 10:01
    is if you were writing your code and C
  • 10:01 - 10:04
    or C++ you would have to rewrite your
  • 10:04 - 10:07
    code entirely if you move from a apple
  • 10:07 - 10:08
    computer to a windows computer to a
  • 10:08 - 10:11
    linux machine to a mobile phone to a
  • 10:11 - 10:14
    toaster and the idea of java the magic
  • 10:14 - 10:16
    was you didn't actually write code that
  • 10:16 - 10:18
    native to that computer you wrote code
  • 10:18 - 10:22
    is very generic way and then there you
  • 10:22 - 10:23
    would have something on that computer
  • 10:23 - 10:27
    called a java virtual machine so as long
  • 10:27 - 10:30
    as the Java Virtual Machine was part of
  • 10:30 - 10:32
    this device then your java code could
  • 10:32 - 10:34
    run on it the Java Virtual Machines
  • 10:34 - 10:36
    essentially job is to translate your
  • 10:36 - 10:40
    java code which turns into java bytecode
  • 10:40 - 10:44
    to that machine specific machine code so
  • 10:44 - 10:47
    this is what it was exciting and
  • 10:47 - 10:50
    powerful innovation and java really
  • 10:50 - 10:54
    adopt most of the same syntax as c++ and
  • 10:54 - 10:56
    it was also highly object-oriented
  • 10:56 - 11:00
    language for better or worse it can be
  • 11:00 - 11:03
    very very wordy and tedious and kind of
  • 11:03 - 11:05
    ugly in many ways are beautiful and
  • 11:05 - 11:07
    elegant depending on how you look at it
  • 11:07 - 11:09
    but what processing a lot of what
  • 11:09 - 11:11
    processing did with java is when you're
  • 11:11 - 11:14
    working in its desktop environment a lot
  • 11:14 - 11:16
    of the rapper code to sort of extra code
  • 11:16 - 11:18
    you need to put the beginning and end of
  • 11:18 - 11:21
    every program in java probably can add
  • 11:21 - 11:23
    for you behind the scenes so that makes
  • 11:23 - 11:24
    it a little bit simpler and some people
  • 11:24 - 11:27
    think of it wasn't really java it's it's
  • 11:27 - 11:29
    because it or is it but it really is
  • 11:29 - 11:33
    java however you are allowed to a not
  • 11:33 - 11:35
    have to live by this like very formal
  • 11:35 - 11:37
    object-oriented way of thinking although
  • 11:37 - 11:38
    you can of course two objects and you
  • 11:38 - 11:41
    don't need all of this extra java stuff
  • 11:41 - 11:42
    that looks very intimidating and
  • 11:42 - 11:44
    upsetting in a way on your like first
  • 11:44 - 11:46
    day looking to program to have that
  • 11:46 - 11:47
    handle this computer stuff that you know
  • 11:47 - 11:48
    what it means
  • 11:48 - 11:50
    so that's really what's going up what
  • 11:50 - 11:52
    happened profit now processing was also
  • 11:52 - 11:53
    in this is what I spent a lot of time in
  • 11:53 - 11:55
    my previous video check i'll try not to
  • 11:55 - 11:57
    harp on too much here
  • 11:57 - 11:59
    java made sense because they could
  • 11:59 - 12:01
    connect to a lot of hardware and
  • 12:01 - 12:03
    librarian for data and networking but it
  • 12:03 - 12:05
    also at the time there was something
  • 12:05 - 12:08
    called applet which were part of early
  • 12:08 - 12:11
    browser's javascript in many ways with
  • 12:11 - 12:13
    need to to complement the fact that
  • 12:13 - 12:15
    JavaScript might be a programming
  • 12:15 - 12:16
    language of the browser that would
  • 12:16 - 12:18
    complement applets but a way of running
  • 12:18 - 12:21
    your profit pitches in 2001 when process
  • 12:21 - 12:23
    of creating that export to Annapolis and
  • 12:23 - 12:24
    share it on the web can't do that so
  • 12:24 - 12:27
    much anymore so the JavaScript of
  • 12:27 - 12:30
    actually what kind of struck started
  • 12:30 - 12:31
    being developed around the same time a
  • 12:31 - 12:34
    little bit after it had other names like
  • 12:34 - 12:39
    mocha and maybe like live script because
  • 12:39 - 12:42
    and netscape and various companies that
  • 12:42 - 12:44
    were developed organizations that were
  • 12:44 - 12:46
    developing early browsers realized you
  • 12:46 - 12:48
    needed something to that you could write
  • 12:48 - 12:50
    code right in the
  • 12:50 - 12:53
    browser in your HTML in your file to
  • 12:53 - 12:55
    like control the behavior and logical
  • 12:55 - 12:56
    things that are happening on a webpage
  • 12:56 - 12:57
    and that's where javascript came from
  • 12:57 - 12:59
    now javaScript obviously is very
  • 12:59 - 13:01
    different now
  • 13:01 - 13:06
    in what year is that 2017 of that it was
  • 13:06 - 13:09
    back then that there's been many
  • 13:09 - 13:11
    different specifications for the
  • 13:11 - 13:13
    language there's there's an organization
  • 13:13 - 13:19
    called ICI ma is that when they were on
  • 13:19 - 13:22
    version like there's like es6 and early
  • 13:22 - 13:25
    term i haven't adopted the new syntax of
  • 13:25 - 13:26
    my video tutorials of JavaScript just
  • 13:26 - 13:29
    yet i can pick your very life doctor to
  • 13:29 - 13:32
    get to show you the environment but but
  • 13:32 - 13:36
    but but still it's quite different but
  • 13:36 - 13:40
    it still is fundamentally the language
  • 13:40 - 13:42
    of the browser a key difference however
  • 13:42 - 13:45
    is that while this is compiled code you
  • 13:45 - 13:47
    have to write your code and then run it
  • 13:47 - 13:49
    through a process that converts it into
  • 13:49 - 13:51
    you know zeros and ones that can be
  • 13:51 - 13:53
    executed an application javascript
  • 13:53 - 13:55
    doesn't work that way
  • 13:55 - 13:56
    javascript is what's known as an
  • 13:56 - 14:00
    interpreted language meaning the browser
  • 14:00 - 14:02
    just read your code and executed at the
  • 14:02 - 14:04
    same time which allows for a lot of
  • 14:04 - 14:05
    flexibility and exciting things like
  • 14:05 - 14:07
    live coding or changing code apply
  • 14:07 - 14:09
    running it typing your code in the
  • 14:09 - 14:10
    browser getting rest there's all sorts
  • 14:10 - 14:12
    of possibilities that you can explore
  • 14:12 - 14:15
    because it's interpreter on the fly and
  • 14:15 - 14:17
    can change as it's running over time as
  • 14:17 - 14:19
    opposed to send it to be compiled and
  • 14:19 - 14:22
    finished but and so invested these are
  • 14:22 - 14:24
    very different programming languages the
  • 14:24 - 14:26
    name is just there because of this thing
  • 14:26 - 14:28
    that applicants were there and
  • 14:28 - 14:29
    JavaScript supposed to complement that
  • 14:29 - 14:32
    and so but added some of the syntax for
  • 14:32 - 14:35
    a while is the same but the actual
  • 14:35 - 14:37
    quality of the language of JavaScript
  • 14:37 - 14:41
    ism do more functions are a job
  • 14:41 - 14:42
    everything about object
  • 14:42 - 14:44
    javascript is that can be object is
  • 14:44 - 14:45
    underrated but functions that sort of
  • 14:45 - 14:48
    this primary thing and this left of can
  • 14:48 - 14:50
    do want to that of course but that sort
  • 14:50 - 14:53
    of the primary think so p 5ks is just a
  • 14:53 - 14:56
    library for JavaScript so if you are
  • 14:56 - 14:58
    quoting full learning p5 yes what you're
  • 14:58 - 15:01
    learning to program in java script
  • 15:01 - 15:03
    and the library of functions that you're
  • 15:03 - 15:05
    calling to maybe draw or do things come
  • 15:05 - 15:07
    from p5 yes if you are learning
  • 15:07 - 15:09
    processing your learning the syntax of
  • 15:09 - 15:11
    the java programming language and how it
  • 15:11 - 15:12
    works and getting access to all these
  • 15:12 - 15:15
    libraries from profits to draw and do
  • 15:15 - 15:18
    that type of thing so and in truth at
  • 15:18 - 15:20
    least in my experience people say well I
  • 15:20 - 15:21
    don't want to use the framework because
  • 15:21 - 15:23
    i really want to learn the with a real
  • 15:23 - 15:24
    big
  • 15:24 - 15:26
    well guess what the real thing is
  • 15:26 - 15:27
    learning how to use different framework
  • 15:27 - 15:29
    so if you learn how to use P by jet
  • 15:29 - 15:32
    maybe you'll learn how to use 3jf RP
  • 15:32 - 15:36
    production or a no matter chance or fill
  • 15:36 - 15:38
    in the blanks doctor is different
  • 15:38 - 15:40
    libraries in different framework for the
  • 15:40 - 15:40
    languages
  • 15:40 - 15:42
    ok so that's kind of a rather
  • 15:42 - 15:44
    long-winded summary of all this and what
  • 15:44 - 15:46
    I want to do now is just show you the
  • 15:46 - 15:48
    two different environments and house
  • 15:48 - 15:50
    intact looks between them and then make
  • 15:50 - 16:04
    a lift of pros and cons between the two
Title:
Q&A #7.1: Comparing p5.js and Processing - Part 1
Description:

more » « less
Duration:
16:04

English subtitles

Revisions