Teaching Coding, Part 1

Scratch

My school has a three-week period between semesters called Winterim, where we offer an alternative curriculum. This year, I am taking the plunge and teaching an intro to computer coding. One of the biggest challenges of teaching at an all-girls school is sparking interest in computer science among my students. Hopefully, this minicourse will get a few girls inspired to pursue the subject further, and we can build on that. So, I’ll be writing a series of posts in the next couple of weeks to share with you what works and what doesn’t.

The basic course outline is this:

  1. Intro to coding through Scratch. (The screenshot above is from the Scratch programming environment.)
  2. Intro to Python by designing some simple games. For this part, I’m using Al Sweigart’s Invent Your Own Computer Games with Python. It’s available for free online here.
  3. Design your own Android apps. I’m using MIT’s App Inventor website in conjunction with the book App Inventor to do this. You need a Google account to log into the website.
  4. Time permitting, we’ll learn the basics of TinkerCAD, and print out some 3D projects.

I’ve spent the past couple of days exploring Scratch, and that will be the subject of my next post.

Success in 3D!

In my last post, I mentioned that my next goal with our 3D printers was to build an object from scratch. The first CAD program I tried was FreeCAD, which is very powerful for an open source product. However, it is about as non-intuitive as any software I’ve ever attempted to learn. I watched a few tutorials on YouTube, and I was able to make a couple of very simple objects, but it is not something my students will have the patience to learn. The next one I looked at was Wings 3D, but it wasn’t suitable for the same reasons.

The third time’s the charm, though, and I settled on TinkerCad, an online CAD program. After I set up my free account, it immediately offered me a very short lesson where I learned how to move objects around on the workplane. After 8 of these brief (and fun) lessons, I was very comfortable with the basic features of the software. Best of all, it is something that my students will be able to learn and use in less than an hour.

I decided to make a compact disc display stand. Using TinkerCAD, I was able to design one in about 45 minutes:

Tinker1

You can specify dimensions to the nearest 0.1 millimeter, so I was interested in seeing how accurately our printer could reproduce the design. TinkerCAD saves your projects on their site, but it also provides you with several options for printing and uploading:

Tinker3

I chose “Download for 3D Printing”, and this dialog popped up:

Tinker4

I saved my design as an .stl file, which is what MakerWare uses to slice the object. It took our MakerBot Replicator2 about 1 hour, 45 minutes to print my CD display stand. Here it is hard at work:

Here is the final result; all the dimensions match the design’s specifications exactly:

CD Stand1

And here it is in action, proudly displaying one of my favorite albums by one of my favorite groups, Big Big Train!

CD Stand2

Things I’ve learned so far: always print your object with a “raft” – a temporary base the printer lays down on the printing plate. When the build is completed, pop your object off the raft, then peel the raft off the printing plate.

Update: I designed a little stand for my iPod Nano:

standDesign

 

Here is the printed version:

iPod Stand

 

Here it is, valiantly supporting my iPod:

iPod Stand3

 

Entering The World of Coding

Women are underrepresented in computer science, so I have agreed to offer a three-week minicourse on coding at Harpeth Hall during Winterim, a between-semesters period for alternative curricula. My only previous experience with computer programming is from more than 30 years ago, when I had to take a course in FORTRAN for my engineering degree. I do not have happy memories of that experience.

Fortunately, there are many more coding languages to choose from these days, and there are some very entertaining and enjoyable ways to learn them. I’m learning Python, and I’m using two resources. The first one is the book Hello World! by Warren and Carter Sande. Hello World

It’s written at a level schoolkids can understand, but adults will also find it very helpful. It’s filled with useful illustrations, and best of all, it has a link to a downloadable file that installs a Python IDLE (a graphical user interface that allows you to write and run Python programs on your computer), so you can work through all the examples as you read. There is a brand new edition coming out in two weeks, and the link above will take you to the Amazon page for that edition.

Here’s a screenshot of one of the first exercises. It’s a program that converts any Fahrenheit temperature to Celsius:

Program2

The second resource I’m using is Codecademy, which hosts all kinds of online courses for people who want to learn coding. Here’s a screenshot of a typical lesson:

codecademy

The lessons are easy, entertaining, and you can learn at your own pace. Codecademy offers courses in jQuery, JavaScript, PHP, Python, and Ruby. And guess what? It’s free!

I’ll be posting later in the year on how the course goes, and what my students think about the subject. Meanwhile, here is a nice introduction to what is involved in programming.