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.

I 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. For 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.

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?