Scratching away at code

Learning how to code has been on my to-do list ever since I started this blog back in 2005. In those six years I have learned enough html and css to put together a standard website from scratch, and just enough jQuery and JavaScript to take other people’s code and alter it for my use (as can be seen on my new landing page) … but I have yet to fully grasp programming languages such as Ruby and Python. I bought all of the books and have watched countless tutorials, and of course everything makes sense as you follow along. It is the point when it is then my turn to create a project that I run into trouble.

Enter Scratch. Scratch is a visual programming language developed by MIT to teach children the basics of coding. It utilizes commands in the form of puzzle pieces that fit together with descriptions on them in plain English, as opposed to syntax that may be difficult to understand for the true beginner. Scratch serves as the bridge between a general understanding of concepts such as loops, conditionals and variables, and the ability to write code in a text-based editor. It has already helped me to understand concepts in other languages that gave me trouble when I was simply reading them in a book. For example, I was attempting to create a basic slideshow using play, pause, next and previous buttons, but kept running into a problem of the buttons not responding to commands. After some trial and error, I realized that the background on the stage was independent of the code I was writing in the function for the button. Instead, I had to return out something when that button was clicked that the stage could hear, and then, once that occurred, I could then change the background to the next image. I think (but am not sure) that this is the same as having global and local variables and what takes place in a function is independent of other functions so you would need to return out a value in order to use it elsewhere.

As a photographer, I process many things visually. In this respect, Scratch is perfect … all of my commands and actions sit in a library on the left, and I can drag and drop them around to see changes in real time. Just how far Scratch will take me, I do not know, but the idea of visual programming has been catching on, and services such as Yahoo Pipes (scraping/aggregating data) and Waterbear (Javascript) will only continue to grow.

Screen shot 2011-06-20 at 2.53.36 AM

Scratch Project

Leave a Reply

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