Thoughts on stuff … lots and lots of stuff

Scratching the coding itch

Scratch_catWhat coding experience I have goes way back to high school. For those keeping score, that’s more than 20 years ago. When I was a kid, I taught myself some BASIC programming, and then I was educated using Turing through two years of computer science classes in high school.

That’s a far cry from the programming languages and development tools available today. Back then, we had a basic text editor to work with. Then we had to save and run a compile, which wasn’t necessarily connected directly to the text editor. Today, things are a little more integrated (and make sure to check out tomorrow’s FierceDevOps for more on that).

Yesterday, while taking a break from work and from struggling with the C7, D7 and G7 scales on the C harmonica (*grumble*), I went to the living room and booted Raspbian to play, firstly, with Scratch. Using the Raspberry Pi User Guide as a basis for learning, I loaded up Scratch to check it out and essentially relearn some of the fundamentals of programming. Basically, getting back into the logic of high-level computer programming languages and what kind of thinking is required (“if” statements and the like) to make a computer do what you want it to do.

Scratch is a visual programming language designed to teach the basics, particularly to kids. The three exercises in the book were enough to give me a taste of the tool and remind me about a few of the key programming concepts I’d need for the next project.

That’s Python, in case you haven’t guessed. According to Eben Upton, one of the brains behind the creation of the Raspberry Pi, the naming of the tiny computer came about because of two parts. The first is the historical significance of naming computers after fruit. The second part is essentially a short form of Python, the programming language that Raspberry Pi expects its users to develop in.

And the first Python exercises in the book were fairly typically. There’s the simple “Hello, World!” program in which you learn the simple command to put text on screen, and then it dives into a guided tutorial of recreating the old Nibbles game, although it’s much simpler with Python than it was in Turing. Python is outfitted with pygame, a language addon that makes it simpler to get right into the specifics of what the game is supposed to do instead of first creating the playing field.

I’m only partially finished the so-called Raspberry Snake coding exercise. And hopefully I haven’t made any typos anywhere. I haven’t had to debug code in more than two decades, and I’d prefer not to start on the first real programming exercise I’m going through.

But while tapping away sitting in front of the Python text editor, I got to thinking about a project a friend in high school did. Using Turing, he (for fun — yes, we were both geeks) programmed a simple Tron lightcycle two-player game. Once I get a better handle on Python, I’d like to try to recreate that.

It might be awhile, though. I have a lot of reading and learning to do before I can make that happen.

Leave a Reply