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.

Trackback URL for this post:

http://onebiglibrary.net/trackback/254
AttachmentSize
learn2codel1.pde186 bytes

Jonathan Rochkind (not verified) on May 18th 2008

Nice. Sorta kinda reminds me of logo, the graphics-oriented programming language they used to teach to kids.

dchud on May 18th 2008

Yeah, it definitely fits a similar role to Logo, but built on a contemporary platform (java) that's widely used and useful. And I'm hoping we can prove that it's a smoother stepping stone to doing practical work with code for a wide variety of people in a wide variety of contemporary languages, too.

Thanks for the comment!

albagcorral (not verified) on May 20th 2008

fantastic tutorial!

thanks!

TweakingKnobs (not verified) on May 20th 2008

thanx , you are a very good and nice teacher , i loved to see the second, third and more advanced parts 8D

dchud on May 20th 2008

thanks for reading and watching, albagcorral and TweakingKnobs!

Stephen Francoeur (not verified) on May 21st 2008

Dan, this is fantastic! I've been looking for a project this summer to teach myself something valuable. For a long time I've been wanting to find a way to learn the basics of coding. I hope this will be as fun as programming in BASIC on an Apple II was for me when I was an adolescent in late 70s/early 80s.

dchud on May 22nd 2008

I hope this works for you! Oh, and, nice ant!

Anon. (not verified) on May 22nd 2008

Should be called "Cooking with Dan"

dchud on May 22nd 2008

You're right, it should.

Ross (not verified) on June 04th 2008

I always wanted to try to get somebody to learn how to code from scratch with Hackety Hack. Maybe that's just my Ruby Uber Alles world view.

Izzy (not verified) on June 06th 2008

Just wanted to thank you for taking the time to do this! I'm a librarian who would like to delve into coding, and this is the perfect way for me to start , as you go step by step :)

fraN (not verified) on June 21st 2008

AWESOME tutorial Dan. It´s the lesson 2 coming soon? Pleeeease!! :D

Tom shelley (not verified) on July 02nd 2008

I've wanted to learn to code for a while, and have made a few botched starts. I would love to come on this journey with you.

Good luck.

EricRG (not verified) on December 24th 2008

I'm learning Processing

(I bought somes books and all...)

Processing is a great thing powerful and easy to learn...

Maybe I'll try to make some video too (I don't have to much time to do it now... :-( )

What you do is VERY useful

thanks

:-)

LeGaou.Net (not verified) on December 27th 2008

Hello again,

Happy New Year to everybody :oD :oD :oD :oD :oD:oD:oD:oD

I hope you still want to make videos to help learning Processing because we are waiting out there :op :op :op !!!

Wellll I'd like (very much) to make a french translation of them (yes yes) what do you think about it ?

I don't know how to do it but it cant be to difficult to make subtitles !!!

If someone wants to help me... thanks (you may write to my page http://legaou.net ) My computer is working with Linux Mint (based on ubuntu 8.10). A software very simple would be nice (opensource of course).

:-)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <pre> <code> <img> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <form> <input> <span> <object> <embed> <br>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <apache>, <bash>, <css>, <diff>, <dot>, <java>, <javascript>, <mysql>, <perl>, <php>, <python>, <rails>, <ruby>, <sql>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.