processing

learn2code lesson 1 - getting started

Welcome to my new project: learn2code!

In my 13ish years as a librarian I've met a lot of people who either wish they knew how to code or were somehow convinced they couldn't learn. The thing is, though, it's easier than ever before to learn programming, and there are more benefits than ever before in a librarian's professional life to know more about coding. Rather than spending any more time being frustrated about it, I figure maybe I should just help people learn.

The great thing is, now we have Processing. Processing is a programming environment created by artists and programmers to do programmable art. It's also fun, easy to get started with, and a really good way to get comfortable with the ideas behind and processes for writing code. I'm no expert in Processing, but I really enjoy using it, and I think you can too.

Everybody can learn to code, even if you're a complete beginner. Here's one way to get started.



learn2code - lesson 1 - getting started from Dan Chudnov on Vimeo.

A few quick notes:

  • I've never done video production before. There's a lot to learn! Sorry about the rough edges (especially the sound). I'll get better after more practice.
  • The first step is to download Processing. Get the right version for your computer, and install it. When you're done installing it, there should be a "Processing 0135" folder, and inside of that is the application "Processing 0135". That's what you run to get started!
  • In this lesson, you'll learn:

    1. How to write a program, run it, and stop it
    2. Setting up the display window and its grid with size()
    3. Drawing shapes with point(), line(), rect(), and ellipse()
    4. How to save your sketch code
    5. How to save your sketched image with save()
  • Save your sketch to a location you'll remember. That'll create a folder and a file inside that with a name ending with ".pde". This means "Processing code", and it's just a text file.

  • Then the filename you give to save() will be the name of the file that contains your image, which will be in the same directory as your .pde file.
  • The code for my self-portrait is attached to this post. You can try my code for yourself if you want.
  • My wife (a cataloger, and not a coder - yet!) watched this and then coded up her own face very quickly. It was totally different from and much better than mine!
  • Questions or comments? Leave them here, or on the video at vimeo.com.

Give it a try for yourself. Watch it all once, then try it on your own, or watch a little and try everything yourself as you go, or whatever works for you.

When you're done, upload the picture to a site so the rest of us can see it! If you use a public image sharing site, tag your photo with both "learn2code" and "learn2codel1" so we can filter it into a big stream of photos and admire each others' work. Here are tag links for flickr:

I hope you enjoy this, and remember, this is only the start! Much more to follow. If you get tired of waiting, I'd recommend you look around the processing.org site to learn more about the cool things other people are doing with Processing.

Processing.js rocking our collective worlds

Trying processing.js, one of the most exciting web things I've seen in many moons.

Deterministic Schelling sociology

I'm utterly unfamiliar with the model proper and all more recent work exploring Schelling's segregation models besides what David patiently explained to me. But I find myself strangely, repeatedly, clicking-to-randomize his Schelling Applet and trying, by observing the random dot scatters on each new "blank" canvas, to pick a pixel that will be green after the system emerges into its steady state.

With just a little bit of guessing at visual clustering, I can guess the right answer more times than not, which probably isn't surprising to anybody who knows the theory and its implications. But then that makes me want to further pre-cluster and aggregate little cluster nodes and bigger ones to study before and after connectedness levels and see if that can help predict anything about social graphs and data webs.

If, perhaps, I had any idea how to do that, that is.

Syndicate content

This site is Copyright (c) 2005-2008 by Daniel Chudnov. All rights reserved.

All opinions stated here are my own, and do not reflect those of my employer.