Monday, July 28, 2014

Interesting Links 28 July 2014

The highlight of last week was a two-hour workshop on TouchDevelop which I presented to teachers who are part of the New York City Department of Education Software Engineering Pilot program.  That’s me presenting below.Embedded image permalink

There was a great bunch of really smart and enthusiastic teachers there. I hope they enjoyed it as much as I did. It brought me back to Brooklyn where I grew up which was an added bonus. It was great to walk those streets again.

I added a blog by John Olsen to my computer science education blog roll.  Let me know if I am missing anyone who should be there.

Chris Leach @chrisleach78 is working on a list of female ICT icons. That is women in the field of computing who have been recognized for their accomplishments in the field and not icons/images of women. Just to be clear.

An HTTP error 404 is when a web server can not find the page you have asked for. One can specify a specific page to show for this error and one group has really done a 404 page in a special way.

I had to share this list of 10 things classroom teachers need to know about modern school librarians via @LibraryAllegra because its just so true.

My students are always surprised when I tell them that their smart phone has more computing power than the computers that helped men land on the moon. This posts by Dan Bowen explains that that really means - How coding has changed in 45 years

 Building a SHIP – Outreach is the latest post  by Mike @Zamansky talking about the summer program for students to learn computer science that he has been running this summer. Seems like a great program.

There is so much great stuff happening in New York City with regards to computer science education. Mike Zamansky’s SHIP program. The SEP program putting CS in more schools. And the many efforts supported by the NYC Foundation for Computer Science Education (CSNYC). It will be interesting to see how this plays out over time. Will it start making “Silicon Ally” a force to be taken seriously by the people in Silicon Valley? We’ll have to wait and see.

sep_hd11Print

Friday, July 25, 2014

Geeks Pick Nits Even On Jokes

I posted this following image on my Facebook page.

running

Comments came immediately. First one was something like “only one step?” Another said the method should be called inside a loop. Another suggested a more involved loop.

while (stamina > 0) 
{
step++;
stamina--;
}

We could probably go on and on. I just find it amusing that coders just can’t look at the joke and see it at face value. They do, I think, see it funny at face value but they also want to make it better for some definition of better.


Thursday, July 24, 2014

Whack A Mole Project

I’ve done variations in Whack A Mole over the years. I did a Whack Something Game for Windows Phone 7 some years ago for example. But somehow I put it aside and didn’t think about it when I was teaching the last year and a half. This week as the National CS Principles Summit this project came up in one of the presentations. This struck me as a particularly good idea for me to bring back into my own practice. So obviously I started coding. I came up with this.
image
What I have decided I want to do is use this for is to teach objects and classes. I created a MoleHole class. I may have to revisit that name before I go to students though. Suggestions are welcome. The reason for creating a class is that I could allow the class itself to handle showing and hiding the moles. My hope is that students will understand that having the object take care of itself will make things much easier.
The first think I did was to create  (using Paint) a couple of images – one to show a “mole” and the other an empty “hole.”
NoMole MoleNothing fancy and I may ask students to create their own. So many of them are much more artistic than I am. Doubtless one of them will use a picture of me if history is any indication.
Then I created a new User Control. I’m using Visual Studio and C# for this sample by the way. Once created I added the images to the project as resources and loaded the empty hole image as the initial image for the object background.
I have very little code in  the class. The constructor just sets the initial value of the Tag property which I could have avoided by putting that in the properties when I added the initial background image. The one method I wrote changes the background image and Tag value.
        public void Swap()
        {
            if ((string)Tag == "Empty")
            {
                BackgroundImage = global::WhackAMole.Properties.Resources.Mole;
                Tag = "Full";
            }
            else
            {
                BackgroundImage = global::WhackAMole.Properties.Resources.NoMole;
                Tag = "Empty";
            }
        }

Very simple. I add the objects to the form dynamically and included in that is setting the event handler for the click event. The code for the event handler checks to see if there is a mole showing and if there is it increments the score and swaps out the image by asking the object to do it.

        private void Whack(object sender, EventArgs e)
        {
            MoleHole hit = (MoleHole)sender;
            if ((string)hit.Tag == "Full")
            {
                hit.Swap();
                score++;
                ScoreLabel.Text = score.ToString();
            }
        }

The mole appears or disappears based on a timer firing. It randomly picks a mole hole object and switches its image and tag, again, by asking the object to do it.


        private void timer1_Tick(object sender, EventArgs e)
        {
            MH[r.Next(MH.Length)].Swap();
        }

Overall, including dynamically creating and loading the mole holes there are something around 30 lines of code. I think I can get students to manage this. And then I’ll want them to make it better, fancier, more interesting. We’ll see how it goes.

Wednesday, July 23, 2014

Scalable Programming Projects

One of the things I look for in a project is that it is extensible. That means that a reasonable and simple version can be done but that students who want to do more or who want to challenge themselves can make a very special version that is really them. One such project that I have used in a small way is a slot machine program. One of my co-workers came up with a fairly simple assignment of this type.

1. Slot Machine – Create a slot machine with 3 “slots” (containing pictures or colors). For each round, clear the slots until the user clicks on it (or a button below the picture), and then assign a random color/picture. Allow the user to place a bet and keep track of money won or lost depending on the outcome of the spin.

Beginning students create some fairly simple applications to solve this project. Many of them look something like the following.

image

I have seen student projects that involve a number of simple variables  and a long series of if statements. I am too lazy to do it that way myself and incorporated some arrays and loops in my sample program. By adding arrays and loops the door is opened to a wife range of more complicated features. The sample below incorporates 9 different “rows” with a total of 27 different possible winning values. 

image

It also includes scatter prizes and a bonus game for some conditions. Obviously it has more visual elements as well. Conceptually though is it just an extension and enhancement of the first program.

One of the ideas I am working on it helping students from the simple to the more complicated. By showing them how the addition of arrays and looks I hope to show them how to plan for enhancement, extension and addition of more features to an initially simple program. We’ll see how it works.

Tuesday, July 22, 2014

One semi colon away from disaster

At a recent workshop Alexander Repenning said that sometimes teaching programming is “one semi colon away from disaster.” How true that is. Minor syntax issues, especially when dealing with beginners, can make a program look like a complete disaster.

Last school year I had more than a few students come close to panic when a compiler reported dozes, scores or even hundreds of errors. Typically adding a semi colon or a curly brace in the right place made most of the errors “go away.” The words “in the right place” are bold for a reason. At times is seems as though beginners start putting in semi colons or curly braces closely to random locations in hopes of making the errors go away. Sometimes the syntax errors go away but create interesting logic errors. Since too often students associate compiling and running with success the results are not happy for grading purposes.

I’ve been thinking about decorations THINKfor my computer lab. I’m starting to think that a couple of signs might be useful. One would say “Don’t panic” and another one just say “Think” like the old IBM signs used to say. And maybe “slow down to make faster progress.”

Panic is bad as it prevents sound thinking. And speed without thought seldom seems to get people where they want to know.

Returning to semi colons, yes we have to, they are one of the reasons so many people like to use block programming languages. Or other forms of drag and drop programming. They do help with talking about concepts and helping students to achieve some success with programming. But do they help when it is time to move on to “real” or traditional programming languages. It seems like a big jump and research seems to be light on the subject.

I had a conversation at the CSTA Annual Conference and found that there are others who are skeptical of the transference from block languages to traditional ones. We could use some more research on this. Does it work? How can we make it work better? What is the best way to help students with the progression? A lot of questions but in the mean time there are days when we still walk one semi colon from disaster.

Late edit but it belongs here:

comma

Monday, July 21, 2014

Interesting Links 21 July 2014

What a week I had last week. The CSTA Annual Conference, the National CS Principles Summit and then the CSTA Board meeting. I need a rest. I tweeted a lot from the first two events. Not from the board meeting though because that information properly comes through the Board Chair and Executive Director. It took me a while to scan though things but I believe I have some good links to share. I hope you find some value here.
I find it interesting that this is happening. Business schools are realizing that even if you are not a programmer it is valuable to be able to share some common vocabulary and experience with programmers. B-Schools Finally Acknowledge: Companies Want MBAs Who Can Code via Business Week @BW
Delphi for fun - looks like some interesting projects thanks to Peter Beens @pbeens for the link.
One of the events of last week was the National Computer Science Principles Summit. I tweeted about it a lot but you can get a lot of the resources and videos at the CS Principles Summit web site.
Embedded image permalink
Link to Rich Kick's resources for Computer Science Principles
An Office Mix presentation on using Code Hunt A good way to get a quick introduction to what Code Hunt is all about.
Interested in learning more about App Inventor? Follow the link for an online course. http://bit.ly/1jJgUA6
HTML5 Canvas Basics handouts http://www.missblomeyer.com/csta2014 from the CSTA Conference.
Teachers new to programming, nice resource for getting started especially with CS Principles.
Resources from computational thinking through game design workshop at the CSTA annual conference.
510px-Scalable_game_design_logo

Wednesday, July 16, 2014

Save The Date for the 2015 CSTA Annual Conference

Yes, we just finished the Computer Science Teachers Association conference. And it was a great one. You can get copies of many of the presentation decks at http://csta.acm.org/ProfessionalDevelopment/sub/CSTA14/Presentations.html and video of many of them will be available soon. But it is not too soon to save the date for net year’s conference.

The 2015 CSTA Annual Conference will be held July 13th and July 14th at the Hilton DFW Lakes Executive Conference Center in Grapevine Texas. Yes! CSTA is coming to Texas. More information will be coming out in the coming months but you can put the date in your calendar.

WP_20140716_001