Sunday, November 27, 2016

How Fast Can You Sort a Deck of Cards?

OK I admit it – sorting fascinates me. No, really it does. OF course it is also an important topic for computer science classes. CS Unplugged has a lot of resources for teaching/learning sorting algorithms. Hadi Partovi of Code.Org shared a link for a very cool Sorting Algorithms Animations web page. They're all pretty cool. It’s nice to have multiple tools in your toolbox for something like this. Recently I tried something new with my freshmen.

I asked my students who thought they could sort a deck of cards the fastest. Could they do it faster as an individual or as part of a team? Freshmen being freshmen there were several who thought they could do it faster as an individual. Others liked the team idea. So tried it. I took out a deck of cards and shuffled it. Then I timed a student as they sorted it. BTW the first discussion was “what does sorting a deck of cards mean?” Is it all Aces followed by all twos or is it Ace to King of one suit followed by Ace to King of the next suit? Does the order of the suits matter? All important questions that open the door to conversation about sorting.

Setting teams of students to the task is interesting in different ways. Using a team allows for some parallelism in the process. Most teams start with one person separating the cards by suit with the other team members sorting each individual suit. A really good team might split up the deck for the initial sorting by suit.  A good conversation can be had about those different techniques. One of the best discussions I have had involve asking why using four people is not four times as fast as only one person.

Everyone softs things from time to time but no one seems to think about it much. It is one of those things people just do. Thinking and talking about it is the first step towards doing to better. Using something common place like a deck of cards while looking closely about what is going on seems to be a good learning tool. Anyone else doing something like that? I’d love to hear other ideas.

(As an aside: the deck I used was the Notable Women in Tech Cards. I have the poster version on my lab wall as well. Good conversation starter.)

Saturday, November 26, 2016

Programming vs. Computer Science

Programming is not the same thing as computer science. But of course they are related. For example, knowing how to use the following arrays is programming. Knowing which one is more efficient and why is computer science. Especially if you know that the answer starts with “it depends.”

int[,] myNumbers = new int[50, 3];
int[,] yourNumbers = new int[3, 50];

Just a thought for the day.

Friday, November 18, 2016

Truth and Fiction in Programming Memes

I ran into a couple of images with messages about programming today. One I think is useful. The other I think is the opposite of useful. The first one is cute.

safe_imageI see this all of the time with my students. Either they write some code without understanding it of the IDE creates some very important code for them. Either way they don’t quite understand what it does. They find it confusing. So they delete it. What could go wrong? Quite a bit it turns out.

This happens to more experienced programmers as well. Hopefully not as often. The lesson is that you really do want to understand code before you modify or delete it. Hint: Comments can help here. If other people are ever remotely likely to look at the code (or if you are remotely likely to ever look at the code again) having good comments can help prevent the deletion of important code by contributing to its understanding.

The other one I found annoying. sleepyFor one thing it perpetuates the stereotype that programming requires long hours, little sleep, and not much of a life. Not helpful. But it gets worse. Programming with insufficient sleep can result in serious mistakes, bad code, and problems for a lot of people.

I’ll never forget a developer I worked with many years ago. He insisted that he could (and had to) work very long hours on very little sleep. When asked about “diminishing returns” he replied that was not a problem for him. Then one morning we came in to work to find out that he had accidently erased our main development store. The backup was also not as current as it should have been. We lost a week’s worth of work for several people. Ouch!

No, if you are sleepy it means someone has messed up. Someone has not planned the work properly, done work properly, or set unreasonable deadlines. Or something else but still something is going wrong not right if the programmers are tired. Proper planning can avoid a lot of missed sleep. So many people seem to skip that step though. Go figure.

Wednesday, November 16, 2016

Hello Cloud 2017

I’m telling my students  about this. Looks like it will be educational even if money is not enough of an incentive.

hello cloud

Online Contest

The Power of Azure

Master cloud computing with Microsoft Azure and you could win $1,000!

Cloud computing is changing the technology industry. When you start looking for your first job, will you have the cloud on your résumé? You will if you compete in our Hello Cloud Challenge!

Every month, one student will win our $1,000 sweepstakes. To compete, all you need to do is sign up for Azure (free, no credit card required) through Microsoft Imagine and then complete one or more of our Hello Cloud activities. Each activity you complete gives you another chance to win. And you only have to do each activity once – your name will still be in the sweepstakes month after month!

Register for our Hello Cloud contest today and you can get started!

The Hello Cloud activities are hands-on real world scenarios that will help you learn how to manage and deploy projects in the cloud!

Thursday, November 10, 2016

Too Many CS Teaching Resources

The Bring IT, Together conference is taking place this week in Niagara Falls, Canada. I’m not there but I have been seeing some social media updates today.  It looks like a great conference and on some level I really wish I were there. At the same time I have been thinking back on a conversation I had last Saturday with Pat Yongpradit (Chief Education officer at Code.Org and a wonderful teacher).

We talked about how many tools are available for teaching computer science these days. There are an awesome number of them. There are robots for teaching programming. There are block based languages for teaching. And then there is an increasing number of Internet of Things objects for teaching programming. Last weekend I attended a workshop on using microprocessors and electronics for teaching programming (and more). There is the BBC Micro:Bit, Arduino, Raspberry Pi, and many more micro processor based items all the time. (I should make another list but maybe someone is doing that already?) 

Do we need all of this stuff? How do we pick from all the stuff out there? Every time I go to a conference is see a “shiny new object” for teaching computer science. My first inclination is to get one (or more) and think about how to fit it into my curriculum. And then someone reminds me that I have limited teaching time and limited resources and there is that whole only 24 hours in a day restriction.

Much of what we are seeing is brand new and while it looks great there is seldom research or experience to back up its usefulness. Usually we see it demonstrated by either the people who created it or by early adopters. I would expect it to work for the people who created it. Generally people create tools closely aligned to how they teach. I know my first textbook was based completely around the way I taught and what works for me. Does something that works great for the creator work for everyone? Much as we’d all like to think so it is far from a sure thing.

The same, to some extent, is true of people who are early adopters of new resources. How much of what it working for them is related to the ways they would teach with any other resource and how much because of the tool itself? It’s really hard to tell. Some tools are adopted enough over time (think Alice and Scratch) that it becomes clear that they can work for a lot of people. Though a close look shows that Alice works better for some teachers than Scratch does and some times Scratch works better than Alice for other teachers. Which one are you and how do you find out?

OK this is coming out a little more negative than I really intended. I do like new tools. And I do try to bring them into class. On the other hand a lot of stuff I have used for some years seems to work really well. There is nothing wrong with using things that work even though they are not the latest and greatest thing being show at tech conferences. Right?

Saturday, November 05, 2016

Thinking Deeper About Programming Contests

I have this set of mixed feelings about student programming contests. On one level they just feel very artificial and inauthentic. You have a tight time schedule, some problems that are as much about the algorithm and they are programming and its all a narrow view of computer science. But lately I have been thinking beyond the façade in a way.

I took a group of students to a competition hosted by the Internet company Dyn the other day. The day started with tours of their offices. Like most Internet companies these days the offices at Dyn are cool. They are in a renovated mill building so the modern interior and the old exterior and “bones” of the building make for an interesting contrast. The tour impressed the students. (and me as well.) So that was a start. Then there were some brief (they must understand HS student attention spans) talks about Internet topics. Dyn was recently in the news for a Distributed Denial of Service attack so hearing from people involved about that was pretty impressive.  The “please study CS so you can come to work for us later” that students heard from professionals was huge as well. Having that experience is probably worth the trip by itself. It helps to see where they could be one day.

I’ve been to a lot of high school programming competitions in the past. Usually I spent my time there with faculty. I did some of that at this one as well. There is a lot of value in getting a bunch of CS teachers together to share ideas and experiences. While that is not a goal of these events (always) it is a valuable side benefit.

Being at an event with students was pretty new for me though. It changes how you look at things. I watched the students (MY students) work. I could not help them of course nor could I really listen in on their process. I could observe it. What I saw was unmistakable teamwork. The process was dynamic. It was not always the same student at the keyboard (teams were only allowed one computer) for example. All three students were involved no matter who was at the keyboard.  Developing that teamwork is a critical “soft” skill that seems to be reinforced by an event like this.

After the competition the students talked a little about how things went. Clearly there was give and take, strategy, and planning during the competition. Having that time crunch seems to force some organization on students. Sure we have deadlines in the classroom but they are not as close or as tight as in a programming competition. This is probably a good thing.

tl;dr I’m thinking that taking students to more programming competitions may be a good ide. And not just so they can win prizes.