Computer Science Teacher Alfred Thompson

This is Alfred Thompson's blog about computer science education and related topics. Alfred Thompsonhttps://plus.google.com/116648179447008949472noreply@blogger.comBlogger1232125
Updated: 2 hours 37 min ago

Arrays, Loops, and Racing Horses

19 April, 2018 - 03:36

One of the things I like about using Visual Studio and C# (and Visual Basic for that matter) is the ability to easily create some fun graphical projects. I’ve been using variations of the horse race program for years now. I though it might be fun to share my latest use.

Students sometimes have trouble seeing the benefits of arrays because they are used to small projects that can get by without them. I want them to see how the combination of loops and arrays make expanding programs easier.

My students were given a mostly empty project with the objects you see in the image above already part of the project. I don’t want them to get lost in setting up the GUI. There is a “Race” button, a “Reset” button, four picture boxes, and the finish line (a nicely formatted label.) No code though. We’ll create that as a class.

The first thing we do is allocate an array of three picture boxes. Next we assign the value of the existing picture boxes to the array. We talk about how the picture boxes now have two names or two ways of addressing them. This is related to people’s names – formal name, nickname, etc.

public Form1()
{
     InitializeComponent();
     Horses[0] = picHorse0;
     Horses[1] = picHorse1;
     Horses[2] = picHorse2

}

The naming I use (I hope) drives home how identifiers that differ only by a number at the end leads one naturally to thinking about arrays.

We write code to move the “horses” random distances each time a timer fires. Using timers is not absolutely necessary and I have used while loops but timers open some ideas for interesting projects. The “Race” button enables the timer and the horses start moving by changing the Left properties by random numbers of pixels..

for (int index = 0; index < Horses.Length; index++)
{
     Horses[index].Left += r.Next(3, 8);
}

Next we add the code to check to see if the Left property plus the width of the box crosses past the left property of the finish line.

Students are asked to figure out the Reset button on their own and most do so easily. At this point we’ve had a lot of discussion about the code we’ve written so far. Next I ask them to add more horses to the problem. They soon discover that this is a fairly trivial task because of the way we have designed the program.

Since we get to work with interesting arrays and see how setting up loops we cover some important topics. Best of all, students seem to like this project.

There is room for student creativity as well. Some add only a few horses, some add many. Some get fancy with reporting winners. Some explore other images from what I provide. Others decided they wanted that last place horse to disappear before the next race. That involved a lot more work then they expected but they were motivated to try things. But no one, including me, get bored.

Categories: Planet

Training The Next Generation of Computer Science Teachers

18 April, 2018 - 09:11

The biggest problem in computer science education is training the teachers we need. That seems to be the big thing on my social media in the last few days.

This past week was a major document release in New York of "Priming the Computer Science Teacher Pump: Integrating CS Education into Schools of Ed”. Mark Guzdial wrote about it here. You can also download the actual report here.  Mark also shared the slide deck from the event on Slideshare here. If you don’t have time for the whole report the slides make interesting reading as a sort of summary.

It has been clear to many of us in CS education for a while that we really need schools of education to step up and prepare CS teachers. This report addresses what is needed with some solid recommendations. This being computer science education, others are tossing in their opinions.

Mike Zamansky, who was at the release event, gave some of his thoughts on his blog at - Math For Math Teachers - watering down CS Ed before we even start. Mike comes from a heavy CS background and many years teaching at a highly rated, entrance exam, public high school in New York City. That gives him a particular perspective.

Garth Flint, who teaches as a smaller private Catholic K-12 school in Montana, wrote a blog post on the subject - CS Ed – to water or not to water, that is the question which really covered the situation for a lot of teachers especially those in rural areas and other smaller schools. 

It’s a different perspective from Mike’s. One is not better than another – they’re just different. In a sense those two posts show some of the diversity of educational environments we’re seeing in computer science education.

Preparing teachers for this wide range of needs is definitely going to be part of the challenge. I can’t see a one size fits all CS teacher preparation scheme working. There is really going to have to be some local variation as well as consideration as to different age level preparation. I’m not sure one can easily prepare for the full range of Kindergarten though Advanced Placement Computer Science. Content is one thing but the how to teach is another.

OK, now there is something of a roadmap. Will schools of education move into this space the way we need them to do? We’ll see I guess but I hope so.

Categories: Planet

Teachers For Now or Teachers Forever?

14 April, 2018 - 04:10

One really can get a lot out of following Twitter hashtags from conferences and other events. Today I saw the following Tweet:

This in a nutshell is the concern with a lot of current efforts to prepare computer science teachers in a hurry. Yes, you can teach a teacher to teach a specific course and you can give them a lot of scaffolding and tools to get by. They may even see great results. But what happens when things change?

My school has something like 20 different courses in the Math department. Can you imagine hiring a teacher who could only teach one of them? Even one that is a soft of default course? Seems like a long shot. We want our Math teachers to be able to teach a range of courses. We want that not just so they can be moved around as needs change or to give them diversity during the day but because we want teachers who know where their course fits into the whole curriculum stream.

Shouldn’t we want that for computer science teachers. The #Home4CS event, from what I can tell from Twitter, was about preparing pre-service computer science teachers in university schools of education. One can easily find Masters degree programs in teaching English or teaching Math or teaching other sciences. A MS is Teaching Computer Science? That’s a bit harder to find. That’s really going to be essential if computer science education is going to grow and mature the way we really need it to develop.

Content knowledge is absolutely critical for teachers to be able to continue as computer science changes. It’s necessary but not sufficient though. Teachers need to know how to teach computer science. It’s not the same as other subjects. Yes, people with deep content knowledge can learn to be good teachers. And teachers can pick up content knowledge and develop into good CS teachers. Learning content AND how to deliver it before starting in the classroom would be a huge advantage. It would be better for teacher and students alike.

It is not going to happen until schools of education start making a home for computer science educators.

Categories: Planet

Can We Afford a Digitally Illiterate Congress?

12 April, 2018 - 23:11

Like many people I found the Zuckerberg Congressional Hearings disturbing on several levels. Yes, there are some serious issues with Facebook and other Internet services with regards to privacy, security, and social impact. We clearly need to deal with them. That is probably a topic for more discussion and blog posts. The lack of understanding of how technology and the Internet works on the part of people who can and likely will pass laws about them was also deeply concerning.

Doug Bergman talked about this at length in his post “The Elephant in the Room.” That’s a great read and I recommend it highly. But I have to stick in my own two cents.

Someone asked me if we required deep aviation knowledge in the members of Congress who questioned Howard Hughes. I think their point was that we don’t expect our Congress people to be deeply technical on all subjects that come before them. That’s a valid point  but at the same time we would hope that they would consult with experts before making decisions. And frankly some of the questions should have been general knowledge and were not deeply technical.

A lot of people who disturbed when Senator Hatch asked how Facebook could maintain a business model where its users didn’t pay for the service. I know I was. Advertising support is a model that predates the internet. It’s a model that allows us free radio and TV for example. To not know that this is how Facebook supports itself is worrying to me.

That and other questions could have been and should have been explained during staff preparation of the Congress people while they prepared their questions.  They are pretty basic.

These hearings were one of the best arguments that everyone needs some computer science knowledge. Not just the computer people. Not just the STEM people. Everyone! And just maybe, with the way things are going,  its particularly important for those planning on a career in politics.

It also seemed that several people had trouble understanding the answers even though Zuckerberg tried to make them simple. It seemed like one Congress person had no real understanding of what an encrypted message was about. That’s not just a Facebook or even internet thing. Though we do often discuss it in digitally literacy units (I know I do.)

Categories: Planet

Why Programmers Need To Ask Questions

10 April, 2018 - 00:36

I keep seeing suggestions that people don’t need to learn programming because computers will do it better. I am skeptical. In part I am a skeptic because I have been hearing this sot of thing for scores of years and I don’t think we’re getting close to this that quickly. But more importantly I worry that it will take language processing a long time to get good enough at understanding people and language.

For example you may have seen this old joke:

A wife asks her husband, a software engineer "Could you please go shopping for me and buy one carton of milk, and if they have eggs, get 6!" A short time later the husband comes back with 6 cartons of milk. The wife asks him, "Why the hell did you buy 6 cartons of milk?" He replied, "They had eggs."

I like to share that with my students to help them understand ambiguity in language. Today I saw this somewhat macabre version.

I’m still not 100% sure I want to use this one in class but it does highlight the risks of unclear speech.

One of the things I learned developing applications early in my career was that users use language that works for them and for people in their field but which may not be clear to others. It is important to understand their vocabulary, their understanding of the tasks, and how they work. Without a common set of assumptions trouble is an unavoidable result.

In the first joke above there is no clear connection between eggs and milk and bad assumptions are made. I’ve learned to question my wife closely about the shopping lists she gives me. Things that are totally clear in her head may be totally opaque to me.

Will computers be able to know how to ask the right questions? Or will they make assumptions of their own? I’m guessing this will take a while to work out. In the mean time we, people, are going to have to be very careful about how we instruct computers.

Categories: Planet
ACCE Partners
ACCE Partners
ACCE Partners
ACCE Partners