Monday, May 28, 2018

Assumptions, Misunderstandings, and Programming Decisions

My beginning students have big problems with writing decision statements. Boolean expressions are a real problem. Most of the time it is because they expect the syntax of a programming language to be close to how they express things in English.

For example, in English one can say “give me a number between one and 10” and it is pretty clear. When they try to say the same thing in programming language they write something like:


if index >= 1 and <= 10 then
or
if index = 1 - 10 then

Of course neither of the work as students expect. The first gives a syntax error and the second compares index to -9 with is probably never going to happen. Try as I might, there are always some students who get this wrong. It just isn't logical in their minds. They are used to making certain assumptions and filling in some blanks or ambiguities and they expect the computer to do the same. I'm running out of ideas on how to get this across.

The opposite end of the spectrum is when students think something is necessary when it is not. For example, if there are only two options than a simple if/else will work. You do not need and if/else if. I see all sorts of unnecessary comparisons from beginners. Many students get this right away. A few, more than I would like, struggle with this. Generally this sort of code does actually work so it is hard to get students to realize that here is a better way. "But it works!" is all that matters. For someone like me who worked in a time when programmers counted comparisons and had a ready handle on instruction speeds for optimization of memory and performance this is a painful observation.

In some of my classes I have enough time to get into the nitty gritty of this. With my freshmen for whom programming is only part of a quarter it is harder. One of my goals for this summer as I review all of my curriculum is to try to find some more/better/different ways to work on these misconceptions. Parsons Problems may be part of the answer. I have experimented a little with them this year and they seem to help. Maybe some animations will work if I can figure out have to make them. I've already written more specifically about these issues in the book I have been writing for my classes.

I could still use ideas. Surely someone out there has solutions to this issue. Any suggestions?

Friday, May 25, 2018

Can We Get there (#CSforAll) From Here?

When I was in high school (I graduated in 1971 so this was a while ago) there was a computer in the building. If you got an A in Calculous as a junior you could take the computer class as a senior. With 5,000 students in the school and only one computer teaching computer science to everyone was not an option. We’ve come a long way since then and lack of computers is seldom the problem. And yet, not every high school student takes or even has the option to take computer science. The obstacles today are different.

Some of the problems are the old chicken and egg problem. Not enough teachers so we can’t offer the courses. Not enough courses so there is no incentive to prepare teachers to teach it.

Some of the problems are perceptual. Administrators don’t see the need or the demand. Other people see a need for other things first. Or don’t see the need at all. There are assumptions that may or may not be correct about “room in the schedule” or “it costs too much.” We see all of those things debated over and over again. Sometimes the path to getting computer science education for everyone feels like this:

thenamiracleoccurs

We as a computer science education community are taking several paths. Cities like New York City are moving to put CS education as an option in all schools. Not quite the same as everyone taking it but access is an important first step. It is coming with in-service professional development as well. It’s all great.

Several states are moving in the same direction at the state level. Kudos to Arkansas which is doing outstanding work for example.

The questions then include two important ones: What is the step from CS for many to CS for all? What is the sustainability path?

There are a lot of ideas out there. One is that if we get more universities to require CS for there students CS will move down to more high schools the way things like calculous have in the past. That could help a lot.

The teachers who are being trained now as in-service will be retiring. Some soon, some not so soon. Those teachers will have to be replaced and there is no guarantee that the funding we as seeing today will be around in the future. Perhaps legislatures will declare victory and move on to other things. Clearly we need pre-service education for teachers to be the CS educators of tomorrow.

We’re starting to see some interest in actually doing pre-service CS education but we’ve got a long way to go. And don’t forget the shortage of schools who want/need to hire CS educators. Is there enough pull from schools or push from requirements that schools offer CS to make this preparation worth the interest of schools of education? I hope so but you never know.

Let’s not forget the looming teacher shortage in general either. While teachers in many states are actively pushing for better compensation and other changes to make teaching a better (for various definitions of better) experience the field has a bad rap in many quarters. There is a lot to be said for taking ones CS knowledge and going into industry.

I’m still optimistic. Some days VERY optimistic. My own state of New Hampshire is slowly but surely moving in the right direction. We’ll get to CS for many in the next few years. CS for all is still going to be a big step.

Thursday, May 24, 2018

Why Don’t Universities Require Computer Science?

We talk a lot about requiring computer science as a high school graduation requirement. It is an issue that is not without controversy. (Should Palo Alto students be required to study computer science?) While discussing that article in a Facebook group Mark Guzdial asked an interesting question.

Why are we talking about making CS a high school grad requirement when it’s not yet an undergrad requirement at most schools. Why is it so important at the high school level but not at all at the undergrad level?

It’s a fair question. Shouldn’t colleges and universities require some computer science as part of their general education requirements? If it is important for all high school students, and I think it is, isn’t it even more important for university students? At the university level, students should be able to learn even more and go deeper as well.

This might also have a side benefit of driving more K-12 computer science as school work to prepare students for something they know they have to study in post secondary education.

Wednesday, May 23, 2018

Teaching Through Stories

This time of year I think a lot about how I teach. There is something about the end of the year and evaluating how much my students have (or have not) learned that causes me to think about how much of what they learn (or don’t) is my responsibility. I look at the projects I assigned, the quizzes I gave, the lectures I presented, and every other aspect of teaching. The last few days have been about the stories I tell.

Brett Becker wrote Computing history in the classroom: The cereal box toy that was an early hacking device, and nuclear weapons systems that depend on floppy disks In part, this made me think of my own post on teaching computer history but it also make me think deeper about the how we teach history. History is not taught well as a mere recitation of facts and dates and names. It is better taught as stories. The authors of “Made to Stick: Why Some Ideas Survive and Others Die” write convincingly about the importance of stores for getting information that "sticks" in people's minds.

Teaching computer science is a lot more than just history though. If we want to teach concepts and have them stick shouldn’t we also be finding stories to explore the concepts? I think so. This can be harder than it seems though. The best and most convincing stories involve projects that are harder and more complex than the ones we can assign in a first programming course.

When we talk about avoiding hard coded “magic numbers” and replacing them with concepts I have a good story. Picture a team of four people working for a year on a software package that will spread across 16 computers. They use the number 15 in hundreds of places among thousands of lines of code. One day their boss tells them they need to account for 32 systems not 16. Hilarity ensues. OK hilarity is not the right word. A month or two of editing and testing ensues. This time the team gets smart and uses a defined constant rather than a magic number. Six months later when they are told that 32 is no longer the number but 128 is they change a single line of code and everything works fine.

I think that is a story that works. Well, as much as anything does with high school students.

I use smaller stories all the time but lately I have been wondering if there are longer more meaningful stories I can use for other concepts. They don’t always just come to me spontaneously though. One of the things I’d like to do is collect other stores. After all the smart people learn from other people’s mistakes and not only their own. Wouldn't a collection of teaching stores be a wonderful aid to teachers?

What stories do you tell to make concepts real to students?

Monday, May 21, 2018

Teaching the History of Computing

History is important. We’ve all heard, if not quoted, the adage that “those who do not learn from history are doomed to repeat it.” Mark Guzdial has a blog post (Computer science education is far bigger than maker education) that is almost as much a history lesson as it is an argument for the maker movement as covering only a subset of computer science. In his post, he talks about the big ideas developed by Alan Turing , Ada Byron, Lady Lovelace, and Grace Hopper.
“What Lovelace and Hopper did mattered, and we demonstrate that it mattered by teaching it and explaining why it’s important.”
One of the things we talk about in the course we teach freshmen at my school is the history of computing. Names like Turing , Lovelace, and Hopper come up along with many others. That is good as far as it goes but lately I have been thinking we need to talk history in more courses. How did we get to where we are and how and why?

Erik Meijer, the Dutch computer scientist, told me once that if I wanted to know what the next big thing in computing is going to be I should look at what  was the big thing in computing 20 years in the past. It’s true. Things in computing do move in cycles. I look at the way we do screen/form design now and see ideas I first saw in the Trax operating system in 1978. Cloud based computing is similar to the days when we had remote terminals connected to large mainframes. The whole idea of client/server applications keeps getting reinvented and redeveloped.

The past is a good place to look for new ideas and we forget that are our peril. My students once asked me how I “learned all this stuff” after a history lesson. I replied that I didn’t learn it – I lived it. A lot has happened in the 45 years since my first computer science class as a university student. I’ve gotten to meet and talk to some important people in the development of CS over those years.

But what about new teachers? How will they learn the history of computing? Is it taught in university? I suspect not much of it is being taught. What ideas will be missed because of a lack of historical knowledge and perspective? Am I the only one worried about this?

[Now get off my grass.]

Thursday, May 17, 2018

Can I Plan For Next Year Yet?

My school has a couple of weeks left but it’s getting close. My Advanced Placement Computer Science Principles students have taken their AP exam. My own exam for them is next week. My underclassmen have a bit more to do and I still have some topics to teach them. Soon the underclassmen will be starting their semester summative projects. So other than grading my workload is lessening. Not gone but at least I have some time to think. Thank about what?

While things are still fresh in my mind I am starting to plan for next year. This was my first time teaching APCS Principles so I learned a lot about pacing and scheduling. I need to modify my plan for next year. I want to move the explore task into the first semester I think. The Create Task should be earlier in the second semester because it was much too stressful to have it due right at the “drop dead” deadline with the College Board. I’ve got some work to figure out how to make that happen. I’d like to incorporate some small device programming as well. I want to explore the possibility of teaching networking using Micro:bit which can communicate with each other. I need some time to work on that.

My mobile app development course went well using AppInventor but it was also the first year teaching that course with that tool. I’ve got to clean up the pacing for that as well as thinking about more or better projects for students.  If they release a version that supports iPhones I have to borrow my wife’s iPhone and test it out.

My Honors Programming course has gone very well and I am really pleased with pacing and projects. My collection of resources is a mess though so I need to organize that. I’ve already been filtering through duplicated PowerPoint presentations and trying to build the perfect ones. No doubt I will continue to modify each one after every time I use them but at least I will not have to search through to find the current ones. I want to organize all of my resources by topic unit. If I have time, I want to record short videos on most topics as well.

I wrote a reference guide to C# in the middle of the year and gave it to my students. Now I need to fix all the problems that they found and modify explanations based on what confused students this time around.

Our freshmen course is taught by two other teachers so the pacing and much of the rest is determined as a team. It’s in good shape but I still want to look at organizing the materials a little. And we teach Visual Basic there so I am created a reference book for that using as well. That draft needs review and corrections.

It’s going to be a busy summer. And that is not even including attending the CSTA Conference in July. (Hope to see some of you there.)

Sunday, May 13, 2018

Does It Matter What Programming Languages We Teach in High School

I’m tempted to just leave this post blank and see what sort of comments it gets. But I am incapable of that. Sorry.

Assuming we are preparing high school students for university and other advanced education and not for jobs right out of high school, what difference does it make what languages we teach? After all, concepts are what really matters. It is hard to pick what languages our students will be expected to learn when they get to higher education.

Universities are using C++, Java, Python, Scheme, and who knows what else as their first programming language.Can we teach them all? Not hardly. Often we only have students for a semester or two. If we’re lucky three or four semesters. A few students in a few schools will have more. But still there is an awful lot we could and probably should be teaching them. Overloading the languages is not likely to be helpful.

There is some indication that the second programming language is the hardest to learn so maybe we try to teach two and not worry too much about which two. At least they will be well situated to learn what ever their university professors throw at them.

On the other hand some would argue that with limited time we should go all in on just one. One or two the question becomes which one or two? Does it matter as long as the basic concepts are taught?

Friday, May 11, 2018

Academically rigorous is incomplete without computer science

Mark Guzdial linked to this post on his blog - Feeling disadvantaged in CS courses at University of XXX – Original post at Minimal exposure

Interesting line from the original post: "Although my high school was academically rigorous, we didn’t have any computer science courses."

Maybe we need to decide that calling a high school “academically rigorous” is incompatible with saying there are no computer science courses?

Wednesday, May 09, 2018

Programming is easy. Debugging is hard.

I may be in a minority in this but in some ways the most fun part of my job is debugging student code. Students are very clever at wring code that doesn’t work in obscure ways. Some how they manage to create errors that look like they are in one place but are really in a completely different place.

The end of the year involves a lot of debugging. Students know more ways to do things wrong than every before. It’s a lot of fun. No, really it is.

Now I know that letting students struggle with logic errors is sometimes (often? mostly?) a good thing. On the other hand they usually lack the experience to see the possibilities. In general I find that struggling students are focused on the wrong part of their code. At some point a teacher has to step in and help out a little.

Today I had a student working on a Pong program and it was not recognizing when the ball hit a paddle. He was looking at the speed of the ball, the arrangement of the code, the working of the if statements and generally focused on a lot of different code. The problem could not be with the IntersectsWith method of the rectangle class. That is part of the system library so it must work. Right?

Maybe we are not updating the location of the rectangle in the right place and time? Maybe we’re checking in the wrong place in the code? Maybe it is a timing problem?

In the end it turns out that all of the code was correct EXCEPT that he was updating the height and width when he should have been updating the width and height. Yes, the order of the parameters matters. I’m kicking myself that I didn’t check that first but at least I did think of it eventually. Next time I will check that first.

And to think I posted a somewhat related post last week (My Code is the Same as Yours But Mine Doesn’t work ) Sigh! I should have known better.

Tuesday, May 08, 2018

Visual Studio Live Share–Something CS Teachers Can Use?

Microsoft is having their big MS Build event this week. I don’t have time to watch it live but I have been seeing hints of things via social media. Most of what they are talking about it for professional developers and is far more advanced than what I have time to get to with my students. But sometimes there are things I can really use. Visual Studio Live Share looks to be one of those things.

With Visual Studio Live Share two people can actually look at and work on the same code at the same time. Merge that with a Skype call and it is like being there. Think Google Docs for Visual Studio. (Someone will object to that characterization for sure.)

So far I have just tried it locally (two computers next to each other with me operating both) but I can see some educational uses. For one thing I can see sharing code with students and having them work on code I have on the screen from their own desks. I can also see easier pair/team working in rooms that don’t lend themselves to a lot of student movement. My tables don’t move and things can get crowded if people mover around too much.

I can also see using it to help students with their own work. Now in the classroom it may still make more sense to walk over to where the student is working. On the other hand if a student is working from home we now have a great way to work together.

I’ve been thinking about using it to watch students as they code (with their permission and their controlling the share) from time to time. That may give me some insights without being quite as intimidating as literally looking over their shoulder. For those students who pretend to be working this may be just the thing.

There are likely to be more ideas that others come up with. Time will tell. At least for now I have a few ideas worth trying out. What do you think? Do you see some educational potential?

Thursday, May 03, 2018

My Code is the Same as Yours But Mine Doesn’t work

Image for Twins the movie

We're all heard it from students "My code is the same as yours but mine doesn't work." The implication is clear – it is the computer's fault that the program doesn't work. Of course something is always different.

Often times it is a small difference. A student confused and lowercase l for a 1 perhaps. Or the is an extra or a missing semi colon. Sometimes the problem is in related code that the student hasn’t though to check. One thing I see a lot of is students referencing form objects (a button or a textbox) that they didn’t name the same way I did. Trying to reference txtName.Next as my code does will not work correctly if their textbox is still named textBox1.

Computers are picky that way. Names matter, semi colons matter, and many other little details that our minds easily fill in for us are not obvious at all to the compiler. Nor are they obvious to students. Students rush. They take shortcuts. They are used to things working out. Computers don’t work that way. Sometimes I think the hardest thing about learning to program is to understand that details matter and that sometimes you have to look in less obvious places.

Students are used to quick fixes though. The TV  murder is solved in 60 minutes (45 minutes plus commercials). The family crises is solved in 30 minutes on TV. Real life is not like that and programming is real life. I hear over and over again that research doesn’t support the idea that teaching programming automatically teaches problem solving. I have to wonder though if at some point debugging doesn’t click into the idea that details matter and that you need to look beyond the obvious answers.