In Teaching, Context Is Key!

July 2, 2013 at 8:46 pm in Personal

When you were three years old, you asked “why” an awful lot. If you have kids you’re probably sick and tired of hearing that question. But it is a fundamental question; it’s how we learn. We have a need to understand. Some things are learned over time, like “We need to eat so we don’t die.”

But some things are not easily understood.

Like Pointers in C.

Recently I came across an exercise that was designed to help the student understand the use of pointers in C. Here it is:

Declare three doubles. Then write a function that takes in a double, followed by pointers to the other two doubles. The function should add one to each double. Call the function and print out the values of each. What do you observe?

This is instructor focused. It screams “I need you to understand pointers. We’ll do a trivial example that shows that the first parameter won’t be modified but the other two will.” It’s terse and leaves a lot of work up to the student. It’s good to make students work, but you must give them motivation before you just throw them into the deep end of the pool.

If we just added a little context and some explanation, we could make this better and actually explain what’s going on:

You need to write code to move a game piece from one location to another on a two dimensional board. To do so, define a ‘move’ function for this. The ‘move’ function should take in four arguments: the current position of the piece on the x axis, the current position of the piece on the y axis, the number of spaces to move on the x axis, and the number of spaces to move on the y axis. Since you can only return one value from our function, define this ‘move’ function as void, and use pointers to modify the original x and y position of the piece. Think about how you will modify those existing x and y positions.

Both use the same premise: in C, we can’t return more than one result from a function, so we get around that by using pointers to pass values by reference so we can  change the values of the arguments we pass in. This is often called mutation. In some languages, mutation is bad. In others, it’s the way stuff gets done. Context is key.

But this second example is more learner-focused. It gives meaningful context to the problem at hand. It explains what we’re doing, and the context helps the student understand why. It  specifically reinforces the idea that if we want a function to modify multiple values, we have to use pointers and modify those values.

This example could be vastly improved depending on what specific things you needed to teach.

What’s not helpful, though, is using simplistic, out of context exercises. A demo where you have the student print out memory addresses for variables does nothing to motivate them. Why do they care about the memory address? What’s its significance? You know the reason why they should care.

Articulate that to them. And if they’re not ready to understand it, then it’s not time to introduce the topic yet.  Teaching the basics is hard. Be patient, be articulate, and help students connect the dots.

They’ll get there, and so will you.

No comments


March 5, 2013 at 11:05 am in Personal

Being pulled in a lot of directions at once means you don’t get to finish some things. I didn’t get my RPM Challenge stuff done, although I did produce one track.

You can listen to “The Letdown” here.

I’m actually pretty happy with this song. I did a lot of it on the iPhone while waiting for meetings, waiting for things to build, or as a distraction for those times when my brain was starting to get fried.

Let me hear your thoughts. And check out the rest of my music.

No comments

RPMChallenge 2013

February 12, 2013 at 9:10 am in Music, Personal

I’m working a lot these days.

I’m editing a couple of really cool books, I’m working very hard on getting one of my best-selling books updated with fresh content, and on top of that I’m teaching full-time. That doesn’t leave me much time to work on music.

So against my better judgement, I’m doing the 2013 RPM Challenge, where you have just 28 days to write and record an album of music. I participated in 2011 when I wrote and created 26 Days and it was very good for me to do that. I’m looking forward to digging in again. I’ve already spent a few hours putting together some tunes, and I’m hoping to do the same thing I did previously-spend a few weeks writing and composing, and about a week actually recording.

I’m doing something a little different this time. It’ll still be electronic music, but it won’t be quite the same style. Stay tuned.

No comments

Another Change of Direction

June 15, 2012 at 3:52 pm in Personal, Work

For as long as I can remember, I’ve had this passion for showing people how to do things. When I was in fourth grade, my dad, a teacher for the blind and visually-impaired, taught me how to program on an old Apple IIe computer. Once I got the hang of it, I started teaching my friends how to do write little programs of their own in our short-lived computer club after school.

When I went to UW-Eau Claire, I got a job in the web development area. Io once again found myself helping students learn how to program. I graduated and got a permanent job there doing all sorts of application development, from ASP to PHP to Rails. And for over eleven years, I’ve been fortunate enough to hire, train, and work with some great people who became amazing software developers, not to mention great friends.

During that time, I’ve also written books and done on-site and remote training sessions.  I’ve helped authors shape their books as a book editor. I’ve even been asked to teach in the classroom at UW-Eau Claire a few times, where I’ve been able to share my love of software development with people just getting into the field.

I love writing code. There’s something pretty cool about solving problems with code, but to me it never quite compared to the feeling I get when I help someone else become a better programmer. And it seems that no matter what I do, I gravitate toward teaching. Now, whenever I am learning something new, I’m thinking “How would I teach this to someone else?”

This week, I accepted a teaching position at Chippewa Valley Technical College. I’ll be part of the IT Programmer/Analyst program, teaching people how to build better software. I’m extremely excited about the opportunity. The program they offer looks great and I’m looking forward to helping even more students become competent developers when I start this fall.

While I’ll be leaving my current day job, I’ll still be hacking on Ruby and JavaScript code, and I’ll still be writing books. But now I’ll get to put more energy into teaching, and I can’t wait to start.