Tuesday, May 18, 2021

Learning From My Students

Being back in the classroom has been a learning experience for me. For one thing I have had to learn a bit of Processing (the IDE) as students had been using it prior to my coming in as a replacement teacher. That’s been fun actually. And learning Processing has been on my to-do list for a while. It’s a pretty useful tool and makes graphics programming in Java almost as easy as C#/Visual Basic and the .NET library.

I have had to get reacquainted with Java as well. That’s more of a refresher than a new learning but students have given me some fresh insights into using it. One of the disadvantages of having programmed for so long is that my mindset is, to some extent, stuck in old ways of thinking. Take for loops for example. I am rather stuck in the idea that the comparisons in a for loop are just simple single Booleans when of course the Boolean expression can be a lot more complicated than that. My students are not as stuck so they suggest various options. That has been helpful in broadening my thinking.

CodingBat is a web site I have come to appreciate as well. I’ve known about it for a long time of course but never used it before because I wasn’t teaching either Java or Python. It includes a lot of very good projects that make for great homework being web based. It’s a little like Code Hunt, which sadly no longer exists. CodingBat is easier for beginners to use though which is a plus.  I found it very useful and recommend it to other teachers.

For one course I have had to review my knowledge of some data structures. Again, a refresher rather than all new learning but I think I picked up some things I either forgot or never knew. (Memory is a fickle thing)

I’ve also learned some things about teaching but that will be another post at a later date.

Thursday, May 13, 2021

Which Sort Do You Use?

My algorithms class is studying sorts this week. I felt like we needed a little hands on sorting to get an understanding of how some sorts related to the types of sorting people do. I had a number of decks of playing cards and their easy yo hand out and to sort. I don’t have one deck for each student and watching others sort is boring. You really want to avoid boring this close to the end of the year so I decided that I could split the decks by suit and have enough small decks for each student. Faster is often better anyway.

My students had been assigned some reading on Insertion, selection, and bubble sorts. I was interested to see if they would relate any of these to their chosen sort methods. Not bubble sort though. I wonder if we should even teach that one. But I digress.

The students were asked to sort their deck which they all did pretty quickly. Than I asked them if they used a selection sort or an insertion sort. About half of the students choose each one. This led to a good discussion of the two methods. It made for a good exercise introduction.

As a side issue, I had my beginner class separate the decks into suits. This was part of a discussion about While loops and the need to properly plan for data storage (the four output files), That it meant I didn’t have to do the separation was a nice side benefit.

In both classes, we had a brief talk about parallel processing and breaking a problem up into parts that could be run in parallels by separate processors. I take my lessons where I find them.

Sunday, April 25, 2021

Back in the Classroom Again

“What would motivate you to come out of retirement to teach during a pandemic?” That was the question I was asked during an interview for a long term substitution position.  My retirement last June had been planned for a year or more. I was very content in retirement. I wasn’t bored, COVID restrictions were not being particularly hard on me.So why was I considering this opening?

My wife and I were fully vaccinated so going back was not as scary as it had been but that just made the decision possible. There were really two reasons I was open to the idea. One is that the schools was Phillips Exeter Academy.  They have small classes (I am now teaching two classes of 10 and one of 12) and they teach around a Harkness Table. I’ve long been curious about that style of teaching. The other reason was that they really needed someone in a hurry. The person they initially hired to fill in for a teacher on sabbatical resigned after a couple of weeks into the semester. I guess I am a sucker for that sort of problem.

So what is it like for me? Well, I feel good about the COVID precautions. There are Plexiglas partitions around the table, students and faculty wear masks everywhere, and faculty are tested for covid twice a week. I believe students are tested often as well. Teaching with a mask is awkward and sometimes it is hard to tell which student is talking because I can’t see anyone’s lips move. But teaching more conversationally around a big table is pretty nice.

I have two students attending via Zoom which takes some getting used to but the students are good about it.

The hardest part is jumping in to without a clear idea of what students already know or don’t know. And figuring out how to move forward. The classes are in Java using Processing and Eclipse as IDEs. Both IDEs are new to me and it has been a while since I taught Java. AP teachers may remember the Marine biology Case Study? That was when I last taught Java. Catching up on the IDEs has been interesting. Returning to Java makes me appreciate C# and .NET even more. But we’re managing. Having smart, motivated students and small classrooms helps a lot.

So, how is your school year going?

Friday, April 16, 2021

CSTA 2021 Scholarships

Are you looking to attend the CSTA 2021 Conference but funding is an issue? There are a great many scholarships available that can help. Visit the scholarship site for full details and application information. I copied a lot of the information below.

Note that there are scholarships for international attendees and not just US based teachers. Applications close on April 30, 2021. So apply soon so you don’t miss out!


CSTA prides itself in promoting equitable access to the CSTA Annual Conference, our premier professional learning program for K-12 CS teachers, by offering scholarships that subsidize 100% of the program cost. These scholarships are intended to support teachers whose limited financial resources may prevent them from attending.

Our goal is to support as many teachers as possible. We currently have funding available for 325 scholarships for U.S. teachers but expect to secure additional funding. We will first prioritize awarding scholarships to: Black teachers and other teachers of color, those who teach marginalized students (BIPOC students, low-income, rural communities), and first-time conference attendees.

If you have a disability or require assistance completing your application, we are happy to help. Please reach out to conference@csteachers.org.

Applications close on April 30, 2021.

To be eligible for scholarships to the 2021 CSTA Conference, you must:

  1. be a CSTA Basic or CSTA+ member,
  2. directly teach computer science to K-12 students, and
  3. not have access to funding from your school or organization to cover conference registration fees.

Conference presenters and chapter leaders already receive complimentary conference registration and need not apply.

Monday, March 29, 2021

Learning To Teach To Learn

A blog post by Eugene Wallingford  (TEACHING YOURSELF THE MATERIAL) reminded me of some things. As he says, “A common complaint from students is that the professor makes them teach themselves the material.” During a graduate course I took in distributed Operating systems the professor assigned each student a topic to research and then teach to the class. I had a couple of peers who complained (privately) that it was his job to teach not theirs. I took it as an opportunity to dig deep in my topic and came away thinking it was a great learning experience.

As a teacher myself, I assigned topics to students to research and teach to the class on several occasions. I’m not sure if students complained behind my back but they were pretty good in my hearing. I found that this was beneficial to the students as well as to myself. In several cases students found features or uses that I had not considered. Students seem to lesson to peers more closely than to their teacher.

I also asked each students to write a couple of quiz questions (with answers) for me to use in a quiz for the whole class.The quality of the questions was mixed as one might expect but they also gave me insights into what students saw as the important part of their topic.

One thing I should have done is to have more rounds of this sort of thing. Students need to practice how to present material. One would like to think that they have enough examples of how to present from sitting through presentations day after day but that doesn’t seem to be the case. Students definitely need some more formal training in presentations than most of them get.

Do you assign students to research and teach topics? How does it work for you?

Tuesday, March 23, 2021

Too Many Ways to Add One

Someone posted a questions asking which sort of programmer one was from a list of ways to add one to a variable:

X++
++X
X+=1
X = X + 1

Actually the initial question didn’t include ++X but it soon showed up in replies. With all these ways to do what appear to be the same thing it is no wonder students get confused.

Daniel Moix replied to my Facebook post with X = X++ This doesn't work (at least not in C# or Java). While one might expect that the value in X would be increased by one after the statement executes it is in fact unchanged. X = ++X does work as you would expect though. It’s not surprising that students, clever people that they are, come up with variations that should work in their eyes but do not work.

Why do we have so many ways to add one? I can’t speak for the language designers (I assume most of this started with C or some earlier language) but lots of us like shortcuts. And it seems like every programmer has his or her own idea of how things should be done. There are few programs that have been around for any length of time that have only one way to do anything.

All of this is great for experienced programmers but can be a nightmare for novices. I used to debate in my head if I should even show all of the ways above.  X=X+1 and X++ covers most cases for beginners. Why confuse them?

I usually did briefly talk about X+=1 because a) students are likely to see it in other code and b) it is useful when adding (and other operations) where one is not changing by one.

This all adds some cognitive load. I think that teaching all the various ways at one time can be a bit much. It may be better to add things as they are needed. For example, maybe waiting until teaching loops to introduce X++ and X+=1. That context and specific use may be helpful. I didn’t do that before but I wonder if I should have. Opinions are welcome.

Wednesday, March 17, 2021

Programming using Text or Blocks? Why not Both?

Continuing my look at papers from the SIGCSE 2021conference. The papers are available for free for a limited time. Get them while you can. In this post,  I take a look at Dual Modality Instruction & Programming Environments: Student Usage & Perceptions.

This paper took a look at the usage of Dual Modality IDE with students. Dual modality means that the IDE is capable of switching between text based programming and block based programming. The authors used the JetBrains plug-in Amphibian which creates Java code. While teaching AP CS Principles using the code.org curriculum, I used AppLab from code.org with students AppLab is also Dual modality though with JavaScript rather than Java.

I was curious to see if the author’s conclusions matches my far less rigorous observations. They basically did. That is to say that they saw students using the blocks to learn concepts and gradually move to text. Blocks often become a reference for learning concept and less for developing program solutions. I noticed much the same thing. Students might also use blocks to learn and switch to text when writing final solutions.

In my course, I did not mandate either blocks or text but let students switch at will. What I noticed is that students with a prior programming background in text moved to mostly text much sooner than students with no prior programming. Some students seldom used text even near the end of the year. This did not seem to impact final grades in my classes. As the authors of this paper found, I saw even the very comfortable with text students use the blocks to explore new concepts.

If you are thinking about dual modality environments (or not) I recommend this paper. I think you will find it supports the value of this sort of environment.

Are you using a dual modality environment? What are you seeing with it?

Monday, March 15, 2021

Zero Indexing Considered Harmful

As the old computer geek joke goes. the three hardest things in programming are naming things and off by one errors. Lately I have been thinking about off by one errors and wondering if having array and similar indexes start from zero rather that one is contributing the off by one errors by novice programmers.

I understand why many programming languages start indexes at zero. It’s a natural outgrowth of pointer arithmetic. After all if the pointer is to the beginning of an array or other data structure the first element is an offset of zero. The language could hide this though. In fact, FORTRAN and several other languages do start at 1. I used to use a version of BASIC (Basic-Plus) where not only was the first element an index of 1 but a programmer could specify the low and high index of an array at what ever numbers they wanted. Individual characters in a string could be accessed as if they were in an array as well. The first letter was at index of 1. An index of zero held the length of the string.

So we don’t have to start at zero. Does it matter? I don’t have any studies or data (someone please research this for their PhD) but I suspect that starting from zero promotes off by one errors especially for novices.

Getting beginners to grok that the first element in an array is zero is a struggle. It seems like a great many of novice errors come from assuming that the first item is a list is item number 1. I see the same issue with loops. Going from zero to less that some value does not come as easy to beginners as from 1 to some value.

So there is my theory, starting from one is better than starting from zero and could reduce off by one errors. As the meme goes, prove me wrong.

Thursday, March 11, 2021

What’s Up with Novice Programmers and Comments

Continuing my look at papers from the SIGCSE 2021conference. The papers are available for free for a limited time. Get them while you can. I take a look at Usage of the Java Language by Novices over Time: Implications for Tool and Language Design.

The BlueJ tool for teaching Java has the (opt in) ability to collect data on language usage by the novices who use it. This is a valuable research tool and the authors of this paper have taken a good look at it for a number of research questions. I recommend the paper for more insights but I was particularly struck by one finding. Students, in large numbers, delete the comments that BlueJ inserts in code automatically.

BlueJ adds stub JavaDoc comments (which can be used to generate documentation) into objects that are created. Over 45% of projects analyzed had no JavaDoc comments in them Students had gone out of their way to delete them. Not answered in the paper but I suspect many of the comments were not expanded from the default either.

What is it with students and comments? In my own teaching I often created stub projects with comments as sub-goal labels. In several cases I saw those comments deleted before coding started. In other cases the comments were left completely separate from the code created in ways that suggest they were ignored. I know that students don’t see the value in adding comments to their code. Is that our (educators) fault? I know that most of us try to teach good commenting practice but at the same time the projects we assign are easy enough to understand (usually) without comments. But why ignore comments clearly designed to help students?

What’s going on here? This looks like a great research question to me. I wonder if anyone is looking at it? What do you think?

Wednesday, March 10, 2021

Inch by Inch–The Inchworm Problem

I am reading a bunch of papers from the SIGCSE 2021conference. The papers are available for free for a limited time.Get them while you can. I started with Exploring the Inchworm Problem's Ability to Measure Basic CS Skills

The Inchworm problem has been around for a while but was new to me. It’s an interesting problem for beginners for sure. Here is the description from TopCoder:

The inchworm is a creature of regular habits. She inches forward some distance along the branch of a tree, then stops to rest. If she has stopped at a leaf, she makes a meal of it. Then she inches forward the same distance as before, and repeats this routine until she has reached or passed the end of the branch.

Consider an inchworm traveling the length of a branch whose leaves are spaced at uniform intervals. Depending on the distance between her resting points, the inchworm may or may not be able to eat all of the leaves. There is always a leaf at the beginning of the branch, which is where the inchworm rests before setting out on her journey.

You are given three int values that specify, in inches: the length of the branch; the distance traveled by the inchworm between rests; and the distance between each consecutive pair of leaves. Given that the inchworm only eats at rest, calculate the number of leaves she will consume.

There is a bit more to the description but that's a start. There were 5 basic ways the paper’s authors found students use to solve the problem. Four are simulations and one is purely mathematical. I confess that a simulation was my first thought about a solution. The mathematical solution is much faster than the simulations.

The paper included multiple solutions and I found a solution on TopCoder pretty easily. That demonstrates a problem typical of interesting programming problems – cheating is easy. The author of the paper use a couple of things to reduce cheating.

For starters, there are few grade points for a solution. I assume the idea is that students will not work too hard to cheat for small point values. I am skeptical of this idea myself. Secondly, and probably a lot more importantly, students were required to document their design and process in digital journals. I had mixed results asking students to document designs in high school. It may be better at the university level. 

Overall, this was an interesting paper and I like the new (to me) project idea. I was thinking about how it might be set up with hints but my fear is that too much scaffolding would force students into one solution rather than letting students get creative.

Thursday, February 25, 2021

How Should We Evaluate High School Teaching Records?

Mark Guzdial posted several articles about evaluating the teaching records of undergraduate faculty. (Links below) They really got me thinking. Now evaluating secondary school (high school) and university teaching is pretty different. Class sizes are the most obvious difference especially in large universities. First and second year computer science courses in universities can have hundreds of students. One can’t teach 600 students the same way one teaches 20. University faculty also have different supports which often include teaching assistants to manage labs, help with grading, and other assistance.

So the question becomes, how to you evaluate the teaching record of a high school CS teacher? Some obvious things to look at as student evaluations, and student results on standardized tests like the AP CS exams. I’m not a fan of either of those. I had a class of highly capable students one year who just decided they would blow off the AP exam for a variety of reasons. They told me they did it. being evaluated on that year’s test results would have been a big mistake. I think most teachers would agree that there are things far outside a classroom teacher’s control that impact test results. COVID-19 anyone?

Student evaluations are also unreliable. Male teachers tend to be rated higher than females' teachers.  Fun and/or  easy teachers get evaluated higher than “hard” teachers whose rigor helps students learn more. And generally, students are not that good at evaluating teachers.

I think that peers and administrators at the high school level have a better idea of what a good teacher is/does than university faculty so I would give weight to peer/admin evaluations. Of course, being able to watch a teacher teach would be ideal. The time I did interview for a university faculty job teaching two classes was part of the process. I think that is very helpful.

I would also like to see what a teacher does to improve their practice. What are they doing for professional development? Are they taking workshops? Attending conferences? Online conferences are making that more affordable and practical? Do they read – articles, blogs, etc.? I have maintained membership in SIGCE for years to get access to research on how to teach and found that very helpful for my professional growth.CSTA has been great as well opening up chapter meetings, the annual conference, the publications, and general community building.  I would ask what things they have learned from others and added to their practice.

Importantly, what does a teacher do now differently from when they started teaching? There is a difference between one year of teaching ten times and ten years of teaching.

I should add that I want to know how they are growing their content knowledge over time as well. But pedagogy improvement is really critical. Teaching the way we were taught years ago is probably not the best way to teach.

Live long learning is something teachers should model so I want to see (read) how a teacher candidate does that.

What else should one look for in evaluating a teacher’s record?

Posts by Mark Guzdial that are related

Monday, January 25, 2021

Does Bad Code Lead to Good Learning?

Last week a teacher posted an interesting problem. They were looking for an explanation of why to code produced the answer that it did. The code is this:

    static void Main(string[] args)
     {
         int x = 2;
         while (x < 12 || (x % 3) != 0)
         {
             x += 3;
         }
         Console.WriteLine(x);
     }
}

The answer, which takes a while to appear, is 12. But why? It turns out that the value of x overflows. It overflows a lot! Eventually the combination of overflows results in a 12 appearing. It’s not at all obvious how this happens or even why this is not an infinite loop.

There was a lot of discussion of this in the AP CS A Teachers Facebook group. I did find it fascinating and wrote some debugging code to see what was going on.

I have to wonder about the value of showing this code to beginners. Or anyone really. What is the value of the learning, if indeed it does teach anything that beginners are ready to learn. Mostly it is not a great plan, in my opinion at least, to rely on number overflows. Different architectures, especially those with different work lengths, are going to take different numbers of iterations. Are they some that would never get to 12? I’m not sure and I don’t like relying on specific architectures.

BTW on my system with a full word this took 1,431,655,765 overflows. With a short it happens after 21,845 overflows. I still don’t know why it takes so many overflows but I am content for now.

In any case, is there value in asking students to figure out why 12 comes out?  I can see people disagreeing on its value as an exercise in debugging. I’m not a fan of it though for a couple of reasons. Firstly, why would you write that code? What is its value? Some people will find it to be an interesting puzzle for the sake of solving a puzzle. I did. But not everyone is “in to” such puzzles.  I think most people want to solve a problem to make something work and do something interesting.

I’m also not fond of code that is unclear as to its purpose and goal. In the Facebook group there were a lot of comments from experienced teachers who expected something completely different from the code. Infinite loops being the most common expectation. In fact, that this isn’t an infinite loop is highly unexpected. Code should be written so that someone can figure out what it does without actually executing the code. Especially for beginners.

Now I am not going to be critical of a teacher who does see value in this particular exercise but it’s not for me. As educators we often do create code just for the purpose of highlighting a specific language feature and small, not very useful pieces of code, often make up quiz/test questions for the sake of space and time. But for the most part I believe that students learn better with more context and with code that solves an interesting – to them – problem.

Related posts:

Tuesday, January 19, 2021

Scratching the Programming Itch

Programming is fun for me. It always has been.I’ve always written code to scratch a personal itch. That is to say that I like to write programs that interest me. If I can learn something new or try something different that is a plus. Not having a time pressure makes this even more enjoyable. I’ve written a couple of fun programs lately. I think they have some potential for student projects as well.

For example, my wife bought us some clothing from a company called Two Blind Brothers. It’s nice clothing and profits go to fight blindness according to the web site. The clothing all has labels in the braised bumps of Braille. Naturally one wants to know what the Braille says and while it is probably documented in the company web site I was looking it up letter by letter with a chart. Eventually I decided to write a program to help me out. Yes, programmers will spend an hour writing code to save themselves 5 minutes.

My program has a pattern of 6 dots that can be set or unset to match a Braille patter with the program displaying the appropriate letter. Or I can enter a letter and the program will display the pattern.

I’d love to assign this to students just to see the different ways students come up with to do the parsing and display. I’m probably going to use it as a platform for more experimentation. I have some other ideas about parsing and translating. It’s modular enough to make experimentation easier.

I’ve also been playing with a Yahtzee program. There are a lot of interesting facets to this program. One of them is verifying options. How do you recognize a full house? How do you recognize a straight? How do you make sure the values entered for a Chance or a three of a kind at legitimate? A couple of years ago I thought about using this as a project to use and enhance over the course of a semester. I ran out of time developing that but now that I have a program almost finished I may try to write up something like that.

Loops, arrays, classes (dice class anyone?) and more are all part of a project like this. It’s been fun writing it. I’ve learned a few things that may help me with some additional games.

Friday, January 15, 2021

Comments on Commenting Code

Comments sometimes seem to be a hot button for software developers. Opinions range from the manager I had who actually did want a comment on every line of code to the people who think comments are completely unnecessary. I tend to fall somewhere in the middle as I think most people are. We may draw the line differently but most people think there is a sweet spot for how many comments are a good idea.

Some people don’t see the value in comments. They believe that code should be self documenting. The variables and functions should have descriptive names for example. To some extent that is a valid goal. Code should be understandable by itself. That’s not always as easy as it seems. When we write code we do so with some specific, obvious to us at the time, information. This might not be the case for others who come to the code later. Or even to the original programmer after some time has passed.

When I talk to students about comments I often relate an experience of my own. I wrote a really cool (in my opinion) program while I was a university student. It drew pictures on a drum plotter. Pictures took about a half hour to draw on that device. Some years ago, decades after I wrote the original program, I decided to write the program again for a modern display device. I wrote the program, compiled it, and ran it. It didn’t look right at all. I stared at the screen and thought “that looks familiar. I think I made that mistake the first time.” Now it turns out that I still had the punch card deck (yeah, I’m that old) and could read through the original program. I came across a comment that read “this function takes degrees in radian” Ah, ha! That is what I got wrong both times. I simple fix and my program worked as I wanted.

Clearly writing comments, especially that one, paid off big time.

Something that took a while to figure out should always be commented in my opinion.

When ever the subject of comments come up someone brings up the case where code changes mean that comments do not match the code. There is no doubt that this happens but frankly I have no sympathy for the situation. A serious professional should be mindful of details like that in their code. When the code and comments do not match it means someone was in too much of a hurry to do a complete job.

Comments should document difficult things, non-obvious things (parameter lists to called methods are a good example, and anything that required some involved logic.

Student projects in a first programming course often don’t have the sort of complexity that a larger professional program might have so it is hard to get students to comment code. I always insisted on a complete header of comments at least. And a comment that describes the purpose of each method written. As I think on it today, I wish I had produced some larger piece of well commented code to have students read.

How do you feel about comments in code? And how do you communicate it to students? Please share some ideas in the comments.

Monday, January 11, 2021

Early Registration Open for the CSTA Annual Conference

Just registered for the 2021 CSTA Annual Conference Early discounted registration for CSTA+ members is now open https://web.cvent.com/event/354be991-0b98-48e0-b4d3-0e32b72a6e49/summary

If you are a CSTA+ member you should have the email.. If you’re not a CSTA+ member maybe you should think about becoming one!

I think its going to be a great conference. We learned a lot from last years conference on many levels.

Saturday, January 02, 2021

Recursion–How and When to Teach

I’ll start with a confession. Recursion is one of those concepts that I struggled to understand in the beginning. Was it me or was it how it was taught? An open question that I don’t want to look for blame. A recent article by  Shriram Krishnamurthi, CS Professor at Brown University, called How Not to Teach Recursion suggests that maybe I was taught badly and worse still that I taught it badly.

Adam Michlin wrote an interesting, related, post called Why you shouldn’t teach recursion (yet)

The teaching of recursion is one of those topics that really gets people talking. I hope thinking as well. Certainly I have been thinking about it lately.

Teaching it early, teach it late (as Adam suggests), not teach it at all? All question people ask and answer differently.

My key takeaway is that recursion has to be the natural solution to a problem for it to really make sense to students. Navigating a tree structure, file directories for example. This implies a prior understanding of the related data structure is also required.

Some languages and teachers use recursion for iteration. I guess for some that feels natural but it never has for me. Perhaps I am to old school and too deep into for statements and while loops. When I started programming there were languages that didn’t support recursion at all!

I have had several students discover recursion (and stack overflows) by having the main function call itself. Very instructive.

I’ve been programming for about 48 years now and very seldom have I had a real need to use recursion. By need, I mean that was the bests and only way to code a solution. One time I wrote a really cool recursive method which I was writing code for a living. Upon code review the rest of the team made me rewrite it as an iterative method because they decided it was too complicated and no one else wanted to try to debug it some day. Most of the teach was fairly young and were recent graduates from top CS universities too!

How important is recursion really? The AP CS A exam tests it lightly in the multiple choice questions (as I understand it). The AP CS Principles didn’t test it at all. SO if you are basing decisions on those exams (which is a whole other problem IMHO) its not that important. Do an advanced data structures course on the other hand it is probably fairly important.

If you are teaching it though I think the important things are outlined in Shriram ‘s article. The popular examples are problematic at best. From the post:

Where does recursion come from? HTDP argues that it arises from self-references in data. That is, recursive data suggest recursive solutions. This is the key insight you need for understanding recursion. Not only does it make sense once you think about it, it also demonstrates why most other approaches to teaching recursion are essentially incorrect.

But do read Shriram’s article. He explains it much better than I can.

[Edit: Mike Zamansky gives some thoughts on teaching recursion at On Teaching Recursion
Worth the read. ]

[Edit: Michele Lombardi gives here thoughts at Chiming in on Recursion

Friday, January 01, 2021

Looking Forward to 2021 in CS Education

What a strange year it has been. The pandemic and more took a lot of the steam out of what I had hoped to dig deeply into in 2020. Surviving is success in these times I guess. I taught online for the winter/spring semester of 2020 and then retired. Teaching online was not so bad but it didn’t leave me with much time to improve on things. Running as fast as possible to stay in the same place seems to have been the norm for most teachers.

But this is time to look forward not back. One thing that seems to have grown among the teachers I see on social media is cybersecurity. While we have seen cyber security at the CSTA conference the last several years is feels like 2020 was the year teachers started teaching it in larger numbers. I think that is only going to continue.

I see a lot of teachers looking for new courses that are relevant to students and cybersecurity certainly counts as that. We can also fit more of it into other CS courses. Students love it. Well, mostly.

CYBER.ORG (formerly NICERC) is one of several organizations supplying curriculum and professional development. And it is all free.I love that team.  Teach Cyber  is  another group as is TryHackMe There is a pretty active Cybersecurity Educators group on Facebook where a lot of teachers are sharing ideas and resources. I highly recommend that group.

Other than cybersecurity what am I looking to see more of in 2021? Well, online IDEs which really came into their own in 2020 are going to only get better. We’ll probably see more competition there as well. In fact, any option for teaching online will see growth even if, as we all hope, schools all return to in-person learning. Giving access to students outside of computer labs is just too powerful a tool to avoid.

I expect computer science, indeed most, conferences to retain a virtual component in 2021. Will they be mixed with both in-person and virtual aspects? I’m not sure but I see more and more conferences having the ability for people to attend virtually. The cost of that is coming down for the conferences and the ability of teachers to spend money for airfare and hotels is not growing as fast as the need for more teachers. There is also a growing interest in reducing carbon footprints on that part of many people.

Computer science education research has been gaining traction in universities. That’s pretty exciting to me as I think there is still a lot we can learn about how to teach CS more effectively. I am hoping that learning about the results of this research will be more available to teachers as well. We can’t all go to conferences or afford expensive peer reviewed journals. The real value of CS Ed research is getting the knowledge to actual teachers.

I see reason to be optimistic about CS education in 2021. We made it through 2020 and it is all going to get better. I can’t wait to see what happens!

Wednesday, December 30, 2020

Looking Back on Computer Science Education in 2020

What a year it has been. I was reading my start of the year post from January. The closing was “2019 has some serious potential.” I had no idea what was to come in 2020. By the middle of March I was teaching online to students who were doing their best to learn from home. It really changes a lot for teachers and students.

So what changed? Well, there was some serious growth in online development tools. Teachers moved to or increased their usage of tools like GitHub, Repl.it, and other online IDEs.  I still like the solution my school used (and continues to use now that they are mostly in-person) of a cloud based virtual machine. That the big cloud companies (I’m looking at you Microsoft and AWS)  haven’t jumped on this means they have missed a huge opportunity in my opinion.

Plans for a lot of physical computing went by the wayside as schools either didn’t have equipment to send home with students or didn’t want students sharing devices that could not be easily sterilized. I suspect emulators got a lot of use.

Along with school, conferences went virtual in 2020. It looks like that will continue into 2021 as SIGCSE will be virtual. It’s still uncertain if CSTA 2021 will be virtual or in-person.  CSTA 2020 went pretty well online. I enjoyed presenting virtually. Though to be honest it wasn’t quite as much fun as presenting in-person. I couldn’t hear people laugh at my jokes for one thing.

For myself, the biggest change of the year was retiring from the classroom at the end of June.  So I have missed most of the crazy on the fall of 2020 school year. I have been watching what my friends have been going through though. I guess I picked a good time to retire. I do miss the kids though.

Friday, December 18, 2020

Pythagorean Theorem Day Programming Project

I’ve been doing little programming projects for my own amusement. I thought about doing Advent of Code like the cool kids are (Looking at you Mike Zamansky who among others is blogging about those challenges) but I just can’t get into them. I need to scratch my own itch as it were. The other day a friend posted on Facebook that the date was a Pythagorean Theorem Day – 12-16-20 because a right triangle with a height of 12, a width of 16 has a hypotenuse of exactly 20. It’s a cute idea if we ignore that the year is really 2020 not just 20.

I commented that calculating the next Pythagorean Theorem Day would be a fun little programming project. Today I thought I would try it myself. The set up is pretty easy. Nested loops for month and day and using the usual math.

There are two issues. One is that not all months have the same number of days. The other is that we want an exact whole number for the hypotenuse.  The first was solved by creating an integer array with the number of days in each month and using those values in my equation.

The second took some thought. There are probably some really cool mathematical ways to do this. I thought about this and decided to cheat a bit. I converted my floating point result into a string, cast it into an integer, converted the integer value to a string, and then did a string compare. The result of the compare determined if I displayed the result or not. There are 12 such dates in case you are interested. Only two of them are after 20 though.

I leave figuring the rest out as an exercise to the interested (or assigned) programmer.

A few things make this a nice student project in my opinion. Nested loops of course, using an array to simplify the programming, and what ever you use to determine if the hypotenuse result is an integer or not. And it is short so you can use it as a demo or an in-class project.

What do you think? How else would you determine if the result was an integer or not?

Thursday, December 17, 2020

Musings on the Goals of High School Computer Science Education

Recent conversations on Twitter and Facebook have had me thinking about the goals of teaching computer science in high school. There is no single goal and it probably varies some by teacher, school, and student population. My goals were basically:

  • Give students a basic understanding of computing and computer science to better understand the world around them
  • Create an interest in computer science so students are willing to learn more.
  • Create in students the idea that they can “do computer science.”

I would rather not prioritize them. I think I did a pretty good job with the first goal. That’s probably the easy one though. But it is pretty important. Helping students better understand the world around them is at the heart of a lot of education. We don’t expect every student to be a novelist, a biologist, a chemist or a professional mathematician. So we are not (usually) expecting HS CS students to become professional programmers.

The second listed goal is pretty hard to measure objectively. I hope I made my classes interesting and the subject itself interesting. A number of students did go one to major or minor in CS so there is that. I hope I didn’t turn too many off.

The last listed goal is also hard to judge objectively but it’s really important. People don’t continue to invest time if they don’t thing they can succeed. Any one can learn computer science. Anyone can learn to program. Some may have to work harder at it than others and some will find it more interesting than others. Student have to know that they can do it if they choose to try.

If students choose to study more CS I want them to have a solid base to build on. I think that is a given. Right? Unless I succeed at the three listed goals above there is not much point in anything else though. So I made the course rigorous and I try to teach the concepts and ideas and good habits that I learned over the decades. I do it with a goal of building success, interest, and understanding of computers in the world today. I’m not just trying to teach the computer science nerds, no matter how much I love then, but all of the students in my class.

Monday, December 14, 2020

Dreidel Game–A Chanukah Programming Project

If you’re anything like me, you like to assign projects that have some relationship to what is going on in the world. Holidays are one such thing. December brings the Jewish holiday of Chanukah – usually right before Christmas. The Dreidel game is a game traditionally played during the Chanukah celebration. It is played with a top that has four flat sides. Each side has a letter of the Hebrew alphabet.

ש Shin ה Hey ג Gimmel נ Nun

The game has multiple players each of whom is given the same number of tokens. Players all place one token in to a “pot” and spin the dreidel to see who goes first. The player who spins the highest value starts. Note: nun is highest, then gimmel, hey, and shin. If there is a tie, the players who tied spin again.

Each player takes turn spinning the dreidel and taking an action depending on what letter they spin.

* Shin: put one more token in the pot
* Nun: do nothing
* Gimmel: take all tokens from the pot
* Hay: take half of all tokens lying in the pot.In case of an odd number of tokens, round up.

The game ends when one player has all the tokens or after some set period of time or mutual agreement.

There are lots of ways to program this of course. Normally, at this point in the semester I have been teaching students how to create simple classes. So when I wrote my solution I created a dreidel class. There are some reasons that this makes for a nice class to create. There is the usual protected data – the face value of the dreidel. And there is the obvious spin and get value methods. I also over loaded the ToString and CompareTo methods.

The ToString method allows for displaying the name of the face value of the dreidel. CompareTo is particularly useful for selecting the high spin at the beginning of the game.

I also added some public const values for the face values so that I could use them in calling programs without the programmer needing to know what the actual values are.

if (player.Value== Dreidel.Shin)

Here we have a fairly simple game to program with a class that lets the programmer do some interesting overloads and activities without too much complexity.

Inspired by a project idea posted on the AP CS Teachers Facebook group group (https://www.facebook.com/groups/APComputerSciencePrinciples/permalink/1873272652824371/)  Thanks to Lee Whiteley for sharing with the community..

Thursday, December 03, 2020

New Resources for Teaching and Learning about Artificial Intelligence

Earlier this week I was a guest speaker in a computer science class (via Zoom of course). It was fun to be back into a class and interacting with students. The students were asked to prepare questions for me and many of the questions were about artificial intelligence. That’s not surprising as AI has really jumped into the public in ways it hasn’t before. That’s why it is timely that code.org has created a new resource for teaching and learning about AI.

The main resource page for this is at https://code.org/ai There you will find a bunch of short videos of 3 to 5 minutes that cover various aspects of AI. Several of the videos explicitly focus on getting people to think about the ethics involved. Satya Nadal, Microsoft CEO, in his introduction makes one of my favorite points right off the bat. It is not enough to think about what computers can do but we also need to think about what computers SHOULD do. Ethics are woven into all the videos and not just the once focusing on ethics.

The videos are typical code.org videos. That means high production values and a diversity of impressive speakers. Presenters represent a variety of ages, races, and colors. They are all impressive and are practitioners in the fields of AI. There are academics and there are people from industry. They really highlight a broad cross section of people involved in AI today.

Besides the code.org videos there are links to videos from other organizations, lesson plans, and activities powered by artificial intelligence and machine learning. And more. It’s a great place to start building the set of curriculum that will work for your course and the age group you teach.

Tuesday, December 01, 2020

Why Do I care About This Program I am Coding?

Why do we program? Well, for some of us it is because we get paid to write code. For some it is part of our learning experiences. For a few it is the fun of it. There are a lot of motivations and they are different for different people. A couple of posts have been thinking about this lately.

Mike Zamansky has bee posting about the Advent of Code event. (Mike’s initial post here Advent of Code 2020)  Today I replied to his post about the first puzzle with the following.

I struggle with these problems a bit. Not because of the technical issues but because of motivation. Or perhaps relevance.  Why would I need to do this? What interesting or important problem does it solve? I guess the issue for me is that solving a problem for the sake of solving a problem, proving that I can did it basically, is not motivating to me. Maybe I have been programming too long to feel like I need to prove anything to myself. OR anyone else for that matter. I get that for some the challenge is enough motivation and that they get satisfaction from the effort. The journey being more important than the destination I guess. And that is fine and if people enjoy doing it that is wonderful. I'm happy for them. It just doesn't motivate me.

As I thought about it, this also related to a post by Mark Guzdial recently. Purpose-first programming: A programming learning approach for learners who care most about what code achieves: Katie Cunningham’s Defense I hope to be able to hear Katie’s defense tomorrow. And look up her papers.

When we as educators assign projects or do demos, what is the purpose of of the code? And does anyone care about it? Students work harder and longer, it seems to me, on projects that they care about. Not just for the grade though that motivates some. Do they want to see the program work for themselves? I always found that the hardest working most motivating projects were the ones students selected or decided upon on their own. Projects that solve problems that are meaningful for them are much more effective than projects that are more about “just do this to learn how this concept works.

I’ve been playing with code myself lately. Each project has taught me something but I was motivated more to solve a problems that was interesting to me than to learn the new concept/algorithm/language feature or what ever I learned. This is what we as educators need to bring to our students in my opinion. They have to care about the problem and not just the grade.

Sunday, November 29, 2020

Does It Matter How Fast the Code Is?

I’ve been having a lot of fun playing with code lately. One of the things I have been experimenting with is cryptography (See Tiny Book of Simple Cryptography) For one project I wanted to create a string of ones and zeros to represent the binary value of letters. I quickly came up with three ways of doing this. I know that are probably many more ways than that. But for now I have some that work and one of them I really like.

Which one is best? Well, that depends. Which one is the fastest? That depends as well. I think I know which one is fastest. It uses the bitwise & operation which generally is pretty quick. One used the Math.Pow function which I suspect slows things down quite a bit. The third uses nothing fancy at all and could easily be coded by someone with only a little programming knowledge. I suspect it is the middle in speed/ Does the speed matter though?

In this application , probably not. The bottleneck in performance is going to be in the I/O not the calculations. The performance of this function is lost in the noise.

What probably matters more, if one is looking to define “best”, is which algorithm is easier to understand..

I learned this lesson one day back when I was writing code for a living. We were doing a formal code review of my code and I had written what I thought was a very clever piece of code that was pretty efficient. The review made me rewrite it using code that was no where near as clever or interesting. It was, however, a lot easier for someone new to the code to understand. And that was more important.

Now there are applications where performance is critical. I remember working with a company building a system  to collect weather data. They collected a huge amount of data is a very short period of time. They were actually comparing the instruction execution times of various machine language instructions to pick the computer they were going to buy. That’s pretty exceptional though.

To complicate matters even more, today’s optimizing compilers are very smart. It is rare that a person coded Assembly language program can outperform code generated by an optimizing compiler. I was involved in actual benchmarks of this in the 1980s and things are improved since then. Take these two pieces of code:

if (foo % 2 == 1)

label1.Text = "Odd";

if ((foo & 1)==1)

label2.Text = "Odd";

Which one is faster? You may think the second one is faster. You might be right. On the other hand, a really smart compiler by generate the same low-level code from both of them. Unless you were on the compiler writing team you probably don’t know. Even if you have the source code for the compiler do you really want to spend the time to see how it is optimized?  You couple probably also look at the generated code but is that worth it either? Not generally.

The first example is clearer. A number of my friends who write code for a living tell me that is what they would use. Because it is clearer and understandable by more people it is not worth worrying about an optimization that may already be taken care of for them by the compiler.

Once upon a time it mattered a great deal if one iterated though a two dimensional array by column first or by row first.  One had to know which was faster and do it right. Today, compilers take most of the worry about this away from us. We can do it in the way that seems more logical for us and for the application.

One of my friends who has worked on compiler development teams tells me that conversations about this sort of optimization are frequent there. People working on compilers have the time and the experience to make compilers smart. I’m pretty sure more of them (the people and the compilers) are smarter about code optimization than I am.

That doesn’t mean we can ignore performance. I’ve seen some beginner code that is horrible in performance. But still there are trade offs. I once wrote a very slow program that I ran once a month. I thought about a way to optimize it that would cut a minute or two off of the run time. It would have taken me an hour to code and that was a lot more time than it would have saved me. Turns out a faster computer a few months later ran the inefficient code a lot faster anyway.

Honestly, though discussion optimization and performance can be fun for a certain class of geek. Geeks like me.

Sunday, November 22, 2020

The Making of a Computer Science Teacher

There is quite the conversation going on in the private Computer Science Educators group on Facebook about teacher preparation for CS educators. This is a very interesting group for CS educators BTW. Join if you are on Facebook. I link to some specific articles at the end.

It’s a lot more complicated question than it might appear. There is the argument about what CS educators need to know to teach CS effectively. Is something better than nothing or is not enough going to mean poorly prepared students? Given all the complaints I have heard from university people about high school students being taught CS wrong (what ever that means) I tend to believe that CS educators should have a lot more depth of knowledge than the courses they are teaching. Definitely more depth than their students will get from the course. We expect this from teachers of other subjects (for the most part – see highly qualified teacher).

As to preparation, and its close cousin – certification – we are dealing wtih three main types of people who need preparation to teach CS.

  • Teachers of other subjects
  • CS experienced people moving into teaching
  • Career beginners who are not previously teachers or CS people

They all need something different. I have heard people say that a good teacher can teach any subject after learning some content knowledge. I would argue that teaching CS is different from teaching most other subjects. A teacher needs to know how to teach computer science. We've been fortunate over the last decade or two that some serious research in how to teach CS has been done. CS teachers need to know what has been learned about HOW to teach.

Teachers of other subjects also need some solid content knowledge. Topping out at the content involved in AP CS Principles and AP CS A (the top high school cs courses) is not enough. Well, not for high school CS teachers. Students are going to ask deeper questions than what is required and you can only get by with “well, let’s look that up” so often before people start to wonder if you know what you are doing.

How much do you need? And this goes for people new to teaching as well as just new to teaching CS. That’s a struggle. I don’t think you can get it in two one semester courses let alone a couple of weeks worth of summer workshops. Two semesters of programming is probably the minimum for that aspect. In the first one a person learns a programming language and a start of how to solve problems. It takes a second course to really become a programmer. Of course there is a lot more to computer science than programming. Vocabulary, networking, algorithms, security, CS ethics, and well, if your have taught AP CS Principles you get the rest. So three or four semesters of real CS.

Everyone who teaches CS including those new to teaching and those career changes needs a course or two (or three) if pedagogy. A focus on teaching CS for sure but also some work on test development and evaluation and classroom management. Do they teach classroom management in regular education programs? CS has some interesting complications involving students playing on the internet and messing with lab computers.

I also think that CS teachers, especially now when there are seldom multiple CS teachers in a building, need to learn about external resources. Social media, CSTA, summer workshops and conferences, StackOverflow, and generally how to build a network to support your growth as a CS teacher.

To prepare to be a great CS teacher is going to take a lot of work. Yes, people do figure it out on their own I know people, I am one, who came to industry without training in teaching and did a pretty good job. Enthusiasm and great students will get you pretty far. That’s not the ideal I look back and wonder how much better my students would have been if I had known what I know about teaching CS back then. I don’t think I messed anyone up too much but could I have taken them further? I like to think so.

If CS is going to take its place with other core subjects we have to learn to teach it well. We have to have more than just enthusiasm for the subject.. We have to set high standards for teachers as well as students.

Facebook Conversations

Mike Zamansky’s post of the subject https://cestlaz.github.io/post/teachers-can-learn-cs/

Monday, November 16, 2020

Tiny Book of Simple Cryptography

I've been playing with simple cryptography. Mostly stuff that was solid before computers. Just for fun mostly but some of it may make for interesting projects for students. I've written a little bit about the things I have been playing with.

This is not a big book and it is intended more to spark interest and not to be a real reference book. There are footnotes linking to Wikipedia articles that would be a good next step for learning more.

I have a couple of substitution ciphers and a couple of  transposition ciphers. Added some Steganography

http://www.acthompson.net/TinyCrypto.pdf

Comments and gentle criticism welcome. I have coded solutions in C# that are ok. Some of them even have comments.

Updated 5 March 2021 to include a brief chapter on the PigPen Cipher. Also some minor edits in other sections.

Thursday, October 29, 2020

TileCode–Creating games on and for handheld devices

People are Microsoft always seem to be working on interesting and unexpected (to me anyway) things.  My most recent discovery is TileCode. From the website:


Microsoft TileCode is an app for designing, coding, and playing video games directly on low-cost MakeCode Arcade gaming handhelds, as well as in the web browser. With TileCode, we are using the medium of video games to explore the combination of
  • Natural language for informally specifying games goals, rules, and mechanics;
  • Physical computational models that foreground concepts such as data parallelism, pattern matching, and conflict resolution;
  • Testing and debugging of programs to establish confidence in their behavior and to refine specifications;
  • Machine learning to help bridge the gap between natural language and programs, as well as to generate non-player character behavior in games.

Our ultimate goal is to provide a sandbox in which students can express and refine their game ideas, while learning about computation, programming, and machine learning, supported by software engineering practices.


It's a pretty interesting idea. I wonder how it might work in classrooms. There is a webinar about their research later in November that I hope to sit in on.

TileCode builds on a lot of previous work and not just from Microsoft. It builds on Kodu and MakeCode but they reference a lot of other block based tools in their paper - TileCode: Creation of Video Games on Gaming Handhelds

I'm really fascinated by the work I am seeing in domain specific tools lately. While games are a popular topic I'm been following Mark Guzdial's work with domain specific languages for Social Studies with interest. I tend to think that rather than see artificial intelligence take over the job of programming that we’ll see more and more domain specific languages (should we call them tools?) that people will use.  I’m not convinced that AI and machine learning will know when rules are really guidelines.

Wednesday, October 14, 2020

What If We Asked Students To Write Textbooks?

A professor friend on Facebook posted that a student emailed him to say that they textbook the were using was “crap.” I suggested in jest that he asked the student to write a better one. That’s pretty tough since how do you write a textbook about something you are learning as you go? (Can be done. Is painful. Don’t ask how I know this.)

The exchange got me thinking though. Supposed we asked students to write a chapter for a mock textbook? Or perhaps asked them to write step by step instructions for completing an exercise assignment. After it was covered in class but perhaps in lieu of a test.

I think it would be interesting to see how students explain concepts. Have they write to explain things to people their own age. How would they explain things? What words would they use? What examples would they give?

They say that to really understand something you have to be able to explain it to others. 

Somehow I don’t think most students would like this exercise though. Of course we already ask students to do things they don’t like – taking tests being one of them.  I do think that it would give us insights into what they do understand and how they understand it. Or misunderstand it as the case maybe.

Anyone want to try it?

Monday, October 12, 2020

Thinking About the Algorithms in Our Lives

My wife and I use these fitness trackers, ours are made by Garmin, to keep track of our activity during the day. Each day the devices give us a goal for how many steps we should take that day.  The goal goes up or down depending on how many steps we did on the previous day. I think. Maybe.

Being the computer guy that I am I keep thinking about how the algorithm actually works. Is it a simple algorithm based on some sort of average or does it have some amount of smarts? Does it take several days activity into account or just the previous days? Like so many things in our lives the algorithm is completely opaque to users.

Google Page Rank, the algorithms that run on the computers controlling our cars, and the software John Deere uses to control the equipment they make. (see article linked below for way this opacity is a problem for some) are all secret. Why?

Well, various companies have various reasons for keeping their algorithms secret. Competitive advantage is the reason for some. For many it is to keep people from “gaming the system.” Google, and other search engines, don’t want people to find ways to get unfairly high placement in searches. I suspect some of that is involved in my Garmin’s secrecy. For others, it is about keeping control of the how the systems them make are run – often for the sake of safety. That’s why many companies don’t want their software “messed with.”

How good or bad this is for the consumer is quite up for debate. There are solid arguments on both side. Arguably, the right thing depends on the situation in many (perhaps most) cases. These are issues we need to think about going forward. People who write software and create algorithms have a responsibility to make the right decisions about secrecy or openness. The decisions have to be about more than just money as well.

Do you discuss these issues with students? I think we need to do so.

Farmers Fight John Deere Over Who Gets to Fix an $800,000 Tractor

Sunday, October 04, 2020

Artificial Intelligence, Humor, and Appreciation of Beauty

Last night I started re-reading Heinlein’s The Moon Is A Harsh Mistress.  It’s an old book, written in the mid 1960s, so there are some old ideas about computers and computing in it for sure. There is some hand waving about how AI is done and how the computer, Mike or Mycroft Holmes, becomes self aware. It is fiction after all. The computer is trying to understand humor and a human friend is trying to help. One way he is helping is to get lists of jokes and report back on which jokes are funny, which are funny once, and which ones are always funny. That sounds a bit like machine learning we see today I think.

In any case, even is the computer does understand humor at some level and is able to create jokes that people find funny does that mean it has a real sense of humor? Will it be able to laugh at jokes that are not in its system? I wonder.

This makes me wonder about other things. We know that AI has been able to write music that people enjoy and create art that looks like it was done by master artists. Is creating art or music the same as enjoying art and music? Maybe not. Now human artists “hear” music in their heads before they write it down or play it. Beethoven write music while he was deaf and so could not hear it being played.

I’ve been to a number of wine tastings. I don’t like wine. No matter how many times I taste it I just don’t enjoy the taste. Listening to wine experts talk about wine and tasting it myself I think (could be wrong) I could learn to identify the wines that wine lovers like. I don’t see me enjoying the process very much though. Understanding is not the same as enjoying. Is it the same for computers and AI? I think so.Recognizing beauty or humor or music is not the same as enjoying it.

The difference between humans and AI is that humans enjoy their creations. And they enjoy the creations of others. If we think about creating beauty as enough to  being human-like  I think we have a narrow view of humans. What do you think?

Thursday, October 01, 2020

MicroBlocks For IoT and other Physical Computing

Well, there is a new tool in town for programming micro devices like the Micro:bit and the AdaFruit Circuit Playground Express and many more! It's called MicroBlocks and was created by a rock star team with experience with creation of such tools as Scratch and Snap!. It’s pretty exciting for a number of reasons. One of them is the wide variety of devices it works with. Another is the Natural Languages it supports.

Live Coding is another interesting feature.

MicroBlocks is a live environment. Click on a block and it runs immediately, right on the board. Try out commands. See and graph sensor values in real time. No more waiting for code to compile and download.

And Multi Tasking.

Want to display an animation while controlling a motor? No problem! MicroBlocks lets you write separate scripts for each task and run them at the same time. Your code is simpler to write and easier to understand

I played with it a bit and it looks pretty intuitive especially for those with previous block programming experience. I made the mistake of trying it without having a device to use with it handy. I have several at home and so I’ll be trying them next week. But I wanted to get the word out so that if people want to try it over the weekend (yeah, I know you don’t have as much free time as you want) or have some students try it out you could.

Sometime next week I want to do a side by side comparison with MakeCode which supports several of the same devices. Some obvious differences are that MicroBlocks supports running the exact same app on different types of devices and that MakeCode has emulators. Since most people only use one type at a time and have physical devices the impact of those differences will be different in different environments.

We are living in exciting times!

Tuesday, September 22, 2020

What I miss and don’t miss about teaching

Fall has come and while students are back in school I am not. I’ve been reflecting a bit about that. I don’t miss getting up at 6 AM and driving for close to an hour to get to school. I don’t miss running my life by a bell schedule. I don’t miss grading, report cards, and other administrivia. I don’t miss classroom management issues.

On the other hand, I do miss interacting with students. I especially miss the interactions that take place outside of class. I miss the look, and sound, of students when they get a concept or when their program works – finally. I miss debugging student problems with programs or their project. Students are very good at finding ways to mess up a Visual Studio project. That’s the one big downside to using a professional tool. But I had fun putting things back together.

There are all sort of debugging issues that come up in the code. There is syntax issues (semi colon hide and seek anyone?) and logic problems. Both are fun little puzzles to solve. And I am sure there are still many that students have not discovered.

But the big miss is the students. I still think I retired at the right time for me.

I hope your school year is going well. I am following all sort of teacher/school things on social media and I know its not easy. Stay safe. And if you have a student program you can’t debug let me know.

Tuesday, September 15, 2020

Why Computer Science Teachers Should Read Books

Since I retired I have been reading more computer science related books. You may have read my book reviews on Humble Pi, Weapons of Math Destruction, or Computer Science in K-12. More and more I realize that I missed out on a lot of good ideas and information. Each of those books has given me ideas that I wish I had thought of a long time ago.

Currently, I am reading Nine Algorithms That Changed the Future: The Ingenious Ideas That Drive Today's Computers. I haven’t gotten very far yet but the book has covered indexing of web pages, PageRank, and public key encryption so far. I’ve started the chapter on error detection. Pattern recognition, data compression, data bases, and more are yet to come. I’m really looking forward to data compression. Teaching AP CS Principles has built up an interest that I didn’t have before.

The indexing chapter is one I had read long ago. Many years ago I experimented with indexing. I wrote some code that indexed the Bible for me. The program was more general purpose than that but the Bible seemed like a good challenge. The program used a list of words and a text file of a book as input. It output a markup language file that worked with a product called VAX Document. VAX Document read the markup language, called SDML, and formatted a document including an index. I wish I still had the code so I could adapt it for some other backend processors. Sigh.

In any case, the idea of creating and assigning indexing projects has some appeal for me. I can see this being interesting for students especially in the context of understanding search engines and more involved search queries.

Other chapters include a lot of information that would be helpful in understanding and explaining various important concepts. And maybe inspire still more programming projects!  So I do recommend this book to AP CS Principles teachers.

PS: More of my book reviews at http://blog.acthompson.net/search/label/book%20reviews

Saturday, September 12, 2020

How Are You Doing?

We’ve now finished the first week after Labor Day and at least in North America almost everyone is back to school. That may not mean physically back in a bricks and mortar school building though. My grandson is starting kindergarten online this week. I didn’t see that coming a year ago. Teachers, students, and parents are adopting to all sorts of new ways of teaching and learning. 

I confess to being happy I am retired but I am also sympathetic so those still teaching. I do worry about you all. I hope you are finding ways to take care of yourself.

My son is an elementary school principal and his summer was as busy, if not more so, than during the middle of the school year. Administrators have been having a tough time so have some sympathy for them.

Somehow many people seem to think this is all easier for computer science teachers. This is not the case of course. Yes, we may be more comfortable with computers than some teachers but the tools for teaching online are new to us as well. And helping students with computer problems is as hands on as helping students in art, or math, or English. Maybe more so at times.

I think we’ll see some tools appear and older tools will see new features develop Social media is full of teachers talking about online IDEs for example. I’m still not a fan but that’s me. I still like the idea of using virtual machines on a powerful server for teaching computer science..  No doubt a lot of people will be trying new things. If nothing else, we’re going to learn a lot this year about new tools for teaching CS.

And that brings me to a final point, have you thought about sharing what you are learning with other computer science educators? The call for proposals for CSTA 2021 is out. Even if you are learning a lot of what doesn’t work you are learning some things that do work. We’re all better off if we all share what we are learning. Please consider a proposal for the conference. If you have questions about what is involved let me know. I love presenting at CSTA conferences. It’s the best audience you could have. Seriously!

Wednesday, August 26, 2020

The End of School Computer Labs?

There has been a lot of talk in recent years about doing away with computer labs in schools. BYOD and one to one computers have been talked about and have been growing movements for a while. I wonder if the current situation will be the final tipping point.

My old school removed the computers from the computer labs. The work involved in constantly sterilizing and cleaning them was becoming too much. So students bring their own devices and now connect to virtual machines via the network. They have access to all the school’s licensed software no matter what device. This worked great when we moved to remote learning in the spring.

Besides the cleaning/sterilizing issue this means a lot of new flexibility. Of course it makes it easier if school has to close and students have to learn from home. But in school it opens more rooms for teaching. And if you have small rooms classes can even be split across rooms with teachers in one room, or even at home, teaching to several rooms with safety distancing.

I computer room can have a more flexible layout, perhaps with easily movable tables for group work, focusing on a lecture, or just plain spreading out.

Will computer labs now totally disappear? We’ll see. A lot depends on a willingness and ability to provide computers for every student. That’s easier in wealthy areas than poor ones. But it just may be the way things have to be.

Saturday, August 15, 2020

Book Review: Humble Pi

Recently, I asked my Facebook friends for recommendations for non-fiction books that would not get me depressed. Several people recommended Humble Pi: When Math Goes Wrong in the Real World so I bought a copy. I’m glad I did.

The book presents some interesting case studies in math done wrong. From people confusing units of measure (pounds and kilograms for example)  to engineers changing one variable in an equation and assuming the answer doesn’t change and many more. As you might expect there are a lot of examples where computers play a role.

There are examples of problems caused by variable type mismatches, binary overflows, and people just misinterpreting the results. You’ll get any number of examples you can use with students. A valuable book to teachers of computer science, physics, and mathematics for sure.

The book is written in an easy to read and often humorous fashion. It’s an enjoyable read even if you are “not a math person.” I bought the Kindle edition but I am wishing I hard bought a hardcopy edition to keep on my bookshelf. I’ll be back looking at this one.

Thursday, August 13, 2020

Are You Ready to Help with CSTA 2021

The call for participation in CSTA 2021 is now out. You can learn about the submission process and look at some possible topic areas on the conference information page here. There are several ways to help out with the conference (see below). You can present or you can become a reviewer. Both are very important roles.

I encourage CS teachers to consider submitting a proposal to present. I have been honored to present at the CSTA conference a number of times over the years and have found it a very rewarding experience. The audience is kind and anxious to learn. This summer, the conference being online, added a new and extra facet which I found surprisingly energizing. I am hoping, as I think most of us are, that next summer we will be meeting in person. Either way, presenting at CSTA is a great way to be part of the community and to help expand knowledge

Chances are that you tried something new this past spring. Or will be trying something new this fall semester. That means you probably have something worthwhile to share. Don’t be shy!

Reviewers are also critical to having a good conference. Reviewers read and evaluate proposals and are essential in the process of picking the best presentations at the conference. Please think about helping out in this way.


  • Apply to present: We're accepting submissions for a one-hour session, three-hour workshop, 20-minute mini-session, 45-minute Birds of a Feather discussion, or a poster session. Visit our website for more information on the process and to submit your application. All submissions are due by Nov. 8.
  • Become a reviewer: We invite you to consider reviewing submissions for CSTA 2020! If you've attended or presented at a prior CSTA conference, have a connection to K–12 computer science, and are available between Nov. 23, and Dec. 17, consider volunteering your time!

Wednesday, August 05, 2020

Learning Python Part 2: Distracted by a Turtle

I cracked a book and found out that Python supports turtle graphics. I love drawing pictures with graphics. I have since I was in university. So today I played around with the Python turtle a bit.

Mostly I played with a few of the usual turtle methods and wrapping drawing code inside loops. I had some fun but didn’t learn a lot. I’m not sure that was the most productive use of my time.

It did suggest that using graphics with Python is potentially a way to make learning Python more interesting. I have Mark Guzdial’s book on Media Computation around here somewhere. I’m going to dig it out and see if it the libraries for it will work in my environment.  I want to do more than draw lines.

Tuesday, August 04, 2020

Programming Projects for Learning or Grading

The purpose of school work is to get good grades. Well, at least that seems to be a common view on the part of students. Most teachers will tell you that the motivation for students to cheat is that they are lazy and still want to get good grades.  The recent posts by Mark Guzdial  (linked to at Changing How We Teach Computer Science) have sparked a lot of comments on his blog and on Twitter which had sparked some thoughts on my part.

I have long believed that projects are a great learning exercise for students. I haver become less enamored with them for grading. Cheating seems to show up all to often. Often it is hard to prove cheating because projects are to short, variable names are too likely to be the same logically, and there are limited ways to solve them. I have seen the most creativity and the least cheating (provable or otherwise) on larger projects where students were all doing something completely different.

A common thread in the comments I have been seeing recently is that students cheat not because they are lazy but because they don’t know how to solve the project on their own. This idea resonates strongly with me.  I see a lot of satisfaction on the faces of students who successfully complete projects. They tend to actually enjoy the process when they have success. 

Over the last several years I have increased the number of other means of assessments including multiple choice questions that include reading and understanding code. Comparing quiz results with project results has been interesting. Some students show close correlations between quiz grades and project results. Other students not so much. While I haven’t conducted a rigorous or scientific study by any means, my observations suggest to me that students are copying the projects of others because they haven’t gotten a strong enough grasp of the material. 

I’m pretty convinced that evaluative instruments that require the reading and understanding of code are better tools for understanding what students actually know than looking at projects. That is not to say that looking at projects is useless. To the contrary, students who work hard against the struggle show what they know and don’t know in their code. A project that doesn’t work correctly give a teacher a lot more information about student understanding than a project that works perfectly.

In my ideal world, I would give each student a different project for every concept I want them to demonstrate knowledge of. That is clearly not possible and certainly doesn’t scale to large classes. I’d love to have a way to watch student progress on a project. What do they try and what do they do when things either work or don’t work. I don’t know of a good tool to that right now or even if it is practical. I guess for now teachers will just have to watch students closer.And use other tools for grading and for determining what students actually know.

Sunday, August 02, 2020

Learning Python: Part 1

Python has been on my radar for years but I haven’t really had the motivation to learn it myself. It’s time though for several reasons. Reason number one is that I need a learning goal to keep stretching my mind and knowledge. I don’t have a bunch of students finding new puzzles to solve so I have to make my own mistakes.

First step was to pick a development tool. I have played with a bunch. IDLE, PyCharm, Processing, and some I forget. I didn’t like any of them. So I am using Visual Studio. I expect many to tell me that was/is a horrible choice but its the devil I know so there is that. Many of the tools feel like steps backwards to me. I’ve gotten spoiled by the Intellisence in Visual Studio among other features. IDLE felt like what I used to learn BASIC-Plus 40+ years ago. Anyway, I want to spend my time learning a language not an IDE.

OF course there are two parts to learning a new programming language. Part one is the basic syntax. Part two is the idiom of the language. The first part is easy. The second not so much.

I’ve started with easy stuff. Declaration of variables, simple math, declaration of functions, and control flow. IF statements and while loops were pretty straight forward. For loops are different and idiom rears its ugly head here first for me.

For loops in Python seem to be what I think of a ForEach loops in other languages. Very powerful and useful. On the other hand, how do I do the equivalent of:

for (i=0; i <= 100; i+=5)
or
for i =0 to 100 step 5

Or do I need to use a While loop to do this? Go ahead, show off in the comments and help me out.

String manipulation, one of my favorite things to code, is probably next for me.I think that will be ok.  Lists and dictionary come after that. I think I will have to read up on them as they look to be thought of differently than arrays in the languages I am used to using. They also look like fun and powerful to use. So there is that.

Classes after that. Hopefully that moves quickly.

Once I get some basics down I’ll start looking into various libraries and what not. Perhaps go back to try some graphics in Processing. Is there an equivalent to Windows Forms like I use with C# and Visual Basic? Or do I have to go backwards again to do that?

At least I’m having fun. Now to go crack a book.

Thursday, July 30, 2020

Changing How We Teach Computer Science

I haven't been blogging much lately. I'm adjusting to being retired for the most part but I have been reading and thinking a lot about teaching computer science along the way. Mark Guzdial has been thinking even harder and has posted a four part set of blog posts about the subject.

I find that many of his ideas as close to how I have done things in the past. Of course at the high school level we see a lot fewer students with previous experience in CS than many university faculty do. SO we follow much of his suggestions in proposal #1 out of necessary.

The whole series is worth reading. Don’t ignore the comments either.

Saturday, July 18, 2020

Book Review: Weapons of Math Destruction

Weapons of Math Destruction has been out for a couple of years now and it is one of those books that a lot of people reference. I finally got around to reading my copy this week.  For those of you who are not familiar with it, the book talks about algorithms involving huge amounts of data and how they are used and misused.These WMD are involved in increasing parts of our lives from teacher evaluations, to credit scores, to policing, to getting hired for a job. Companies make assumptions that the algorithms are fair, impartial, and that they get the results they are advertised to provide. Often all of those assumptions are wrong.

In some ways I think the point could have been made with one or two chapters but providing a multitude of examples is definitely informative and convincing. The book is more than a little scary but I think that is the point. We should be concerned.

Those of us involved in computing, perhaps especially those of us teaching computing, need an eye opening book like this. It can help us do better and perhaps avoid some of the unintended consequences that this book so clearly outlines.

I’d love to assign this book as required reading to students. I could probably get away with that at the university level but high school students are both reading adverse and already loaded with a lot of reading. I think what I would do at the high school level would be to place a couple of copies on course reserve and assign specific chapters to individual students to read. I’d have them submit both an oral and a written report of their chapter. Some group discussions would also be a plus. This is a natural for an AP CS Principles course but I think it would fit in elsewhere as well.

We need people in computing who can look at technology and think about unintended consequences and, perhaps more importantly, ask what are the impacts on society of what we are thinking about doing? Is it all just about money and the bottom line or are we actually making people’s lives better?

Wednesday, July 15, 2020

Thoughts on Virtual Conferences - CSTA 2020

The first online CSTA Conference is now about 24 hours behind me. I was fortunate to experience it both as an attendee and a presenter. After mulling it over a bit I have to say it was a much better experience than I expected it would be.

Attending was very low friction. No travel half a day each way (with attendant airfare) no hotel to book and pay for and that is just to start. Attending sessions was easy. No hunting for rooms for example. I have put in a lot of steps in previous conferences going to the wrong room or finding a room at out of the way locations. None of that here. No trouble entering and finding a seat. Or leaving if I wanted to switch sessions. Really very smooth.

Attending sessions was great this way. I particularly liked the chat window as it allowed others to share resources and for more people to ask questions. I hope there is a way to capture the chat session information. I would like to have the comments from my presentation at least.

Presentations were of the usual high caliber for a CSTA conference. Sure some were better than others but over all much higher than some other conferences I will not name. Presenters seemed comfortable presenting online. Some of this may because a lot of us have been doing so for school but the preparation for presenters was really very well done. As a presenter I felt very prepared for the platform.

As a presenter things went pretty well. I had wanted to have a second monitor running but due to some technical issues that were all my fault I didn’t get that working. Let that be a lesson to me. Not being able to see the chat window while I was presenting was a disadvantage but the wonderful CSTA proctor was able to see it and fed me questions as appropriate. Having a person who can do it is very important in an online presentation.

While presenting I obviously could not see the reactions so setting an audience based pace was difficult at best. Attendee questions did help there. I also missed hearing people laugh at my jokes (be they intentional or otherwise). There were some comments in the chat that said people did laugh so that’s good. Presenting online is not as much fun for me as presenting in person. One the other hand, I don’t think any of us presenters would have had the size audience we had online if we’d had the conference in person.

The hopin platform worked very well – flawlessly for me. I recommend it. We had a reception area for finding out what was happening and when. A “main stage” for keynotes, breakout rooms for the concurrent sessions, a networking area, and a virtual exhibit hall.

The networking area was very interesting. It placed you in a session with a random attendee for 5 minutes. Just enough time to meet someone and be very low stress. You didn’t have to find an excuse to “walk away.” I took part a few times but as an introvert I have my limits.

The exhibit hall didn’t quite work for me. I like to look at booths and the physical objects in them. It was great if you like to listen to exhibitor presentations and I know that many people do. So that was a mixed story for me. I would love to know what exhibitors thought of the experience.

I was going to write about missing the “hallway track” in this post but I think that deserves a post of its own. So that will probably show up tomorrow.