Thursday, July 15, 2021

Notes on Day Two of #CSTA2021

Today started, for me, with help desk duty. While I was there no one needed any help which I suppose says good thi8ngs about the HopIn platform CSTA is using. The other committee member on duty, the amazing Myra Deister, and I spend most of the time catching up. We’ve known each other through CSTA for a long time. It was just like a “hallway track” time for us. I’d love to see tools specifically for that sort of thing.

First session of the morning I was bad. Well, fidgety I guess. I hoped in and out of a number of sessions the whole time.

I started with Misconceptions as Learning Opportunities (slides here) and learned some good things about assessment. An area I frankly need to learn more about. I will be watching the whole session when the videos are available.
I next hopped in to Introduction to Micro:bit with MakeCode just to see what they were presenting. I did pick up a couple of links to related research that I  read later.

https://aka.ms/MakeCodeResearch ,https://aka.ms/PhysicalComp, https://microbit.org/research
Release notes: https://makecode.com/blog/microbit/2021-release

BirdBrain Technologies dropped in to the session to say that they “ loved the micro:bit so much that [they] based the newest version of [their] products on it! US educators can try a free demo of [their]micro:bit based robots: at https://www.birdbraintechnologies.com/demo

I spend most of the rest of the time at Block-Based Machine Learning and AI with mBlock  “ mBlock is a powerful programming environment that combines the familiarity of Scratch with cutting-edge technologies like Google’s Teachable Machine and Microsoft’s Azure Cognitive Services.” (Slides here) I should have started here and I will definitely be watching the full video when available. BTW,
If you are looking for resources about teaching AI check out https://ai-4-all.org

Next up was the keynote by Dr. Amy Ko. I have been familiar with her work from both social media and published papers so I was really looking forward to hearing her speak. Follow her on Twitter (https://twitter.com/amyjko) and read her blog posts (https://amyjko.medium.com/) Dr. Ko gave a great talk which showed all of the levels involved in where things can go wrong in encouraging students to take and continue in computer science. Talks like this are a reminded for me of the many forms of diversity that I have to be aware of and how I need to adapt to meet the needs of people who are not like me. Dr. Ko posts her talks on her web site. This one should be there soon if it is not there right away.

Updated: with links to Dr. Ko’s talk:

Video: https://youtube.com/watch?v=p7IzFIDfyKY Slides: https://faculty.washington.edu/ajko/slides/CSTA2021Keynote.pdf

CSTA Keynote

After the keynote, I hopped into Teaching Exciting Computer Science Frontiers in High School for some ideas about advanced courses and students. The talk introduced me to NetsBlox which is a visual programming language and cloud-based environment that enables novice programmers to create networked programs such as multi-player games. Network programming, yeah! The system also connects to a variety of databases online. So a lot of possibilities for data science or cross curricula projects.  I need to look into this a lot more.

Next up was Selecting and Supporting a New CS Teacher. (Slides here) This mini-session was part of the administrator tack. Love that there is an administrator track BTW.  In any case, there was a lot of good information for administrators including some helpful links in the slide deck.

Teaching with YouTube with Oscar Velizin was next for me. Oscar Velizin has a YouTube channel with videos that mix math and CS. No surprise. One of the takeaways for me was the idea of providing access to the code that is demonstrated via GitHub or some other online system.  (Slide deck here) He had some good reasons for using PowerPoint compared to some other presentation tools.  Specifically the ability to screen capture, to rerecord individual slides, the built in Equation editor, and the ability to easy export videos.

Don’t tell anyone but I skipped the Birds of a Feature. Enough screen time and I wanted to be rested for the last keynote of the day.

The afternoon keynote as Zaretta Hammond who talked about Changing the Complexion of Computer Science Education. Yes, equity was a big focus at this year’s conference. I that that was wonderful. As we look at the events of the last few years we can see that a lot of work needs to be done to promote Computer Science for everyone.

A note of process. Yesterday I took notes in a text document. Today I took my notes in Open Live Writer which is my blogging tool. I filled things in during breaks between sessions. That made it easier for me. I like having my notes in blog form both to share with others and to return to for my own follow-up on sessions.

Wednesday, July 14, 2021

Day One–#CSTA2021

Today was the first day of the Computer Science Teachers Association conference. All online of course. It was a pretty cool day. I got myself set up with a two monitor system, headphones, and a notepad for notes. Being on the conference committee I had some specific commitments. The two monitors made that easier. I spend the first hour working the help desk so I missed some of the opening keynote and welcomes. It felt good to be able to help out that.

My first session of the day was AI and Machine Learning with Code.org with Daniel Schneider , a Code.org Curriculum developer. His Slides are at https://bit.ly/csta2021-aiml. One expects a high level of production quality from Code.Org and this program seem to have that. The curriculum can be used several ways as a stand alone or modules can be used in a larger course. If you are looking to teach about artificial intelligence and machine learning this is a great place to look for materials. Code.org AI/ML Curriculum

Next you was Secret Coders Teach Computational Thinking with Dr. Rachelle Haroldson and Dave Ballard Slides at  https://bit.ly/2UUPDUf They started with an introduction to as 6book set of books for younger students called Secret Coders. Now K-5 is not my usual thing but I have a grandson who just finished kindergarten who is already interested in computers so … After introducing the books they presented some good exercises to go along with the stories. Some were offline like the one at Fun-with-Coding.pdf which I can totally see adapting for older students as well. And some were online interactive. Overall, I thought it was a pretty good program for younger students.

The mid-day keynote was from Tim Bell, the man behind CS Unplugged, You know its going to be a good talk when the presenter starts by playing a huge  pipe organ. Dr. Bell is a great presenter. He had a lot of good things to say. For example, "We write programs for people to use. There may be a few people that need that memo."  The big learning for me though was him saying  that Combining unplugged activities with coding activity works better than unplugged along. Having students do an unplugged activity should be followed with some actual coding activity. Makes me think a lot about how I use unplugged activities.

Next up for me was  a session on the Carnegie Mellon University (CMU) CS Academy curriculum  Link to presentation slides. CMU has several courses of different lengths and for different levels of complexity. Course are Python based and have been developed and well tested in actual classrooms. The demos show some great production values with a lot of thought given to teacher tools.Courses start at the middle school level and into high school. Some of the modules will fit nicely into the coding parts of Advanced Computer Science Principles. And its all FREE!

Last session of the day for me was Coding with Scratch Junior in the PreK–2 Years. Looking for ideas for my grandson again. This session provide a slide deck of resources and a Slide deck. Scratch Jr is an Android tablet app that look crazy easy for students in PreK to grade 2. I think my grandson will like it. There are many ways it can be used cross-curriculum as well. Pretty cool stuff.

There were a bunch of sessions I would have liked to attend but one can only be in one place at a time. Thank goodness that all sessions were recorded and I will be able to watch them come August.

Tomorrow I will be back in the Help Desk at 10:30 Eastern US time. I’m looking forward to a bunch of great sessions after that.

Tuesday, July 13, 2021

Learning My nth Programming Language

They say that the second programming language is the hardest to learn. That’s mostly because one learns how to program using their first language but each language has its own idiom.  I was lucky in that before I completed my BS degree I had learned enough of at least six programming language to write usable programs. So when at my first professional programming job they handed me a language reference manual and a functional specification and asked me to develop on a new (to me) operating system I got on fairly well.

I continued to learn new programming languages over the following years and have lost count of them all. But having a project, a good reference manual, and usually some good sample code I had a lot of fun learning.

This spring I had to reconnect with Java and learn the Processing system. To be honest I used the code students had written before I took over the class for some of how I learned Processing. Syntax is new but concepts change a lot slower and experience (in this case with XNA) was very helpful. Having a wide range of experience sure does help. And I used Bing a lot

These days I am attempting to learn Python. I have a number of Python books written for beginners. They look great for beginners but for me they just don’t work. There is to much about how to program in general and finding what I need becomes tedious. Programming language documentation has changed over the years. For the most part that’s probably good. For me, well, let’s just say I miss the old dead tree simple language reference manual.

Finding good sample programs for what I want to learn has been a struggle as well. Search engine AIs are not as good as we need them to be yet. What to do? Well, this is were community comes into play. I asked for samples on the Computer Science Educator group on Facebook. Some brief conversations and Lisa Hines, a CS teacher from Canada, shared two wonderful samples that look like they should give me a real start. The Internet sure has made for some great community building for computer science teachers.

Monday, July 12, 2021

Avoiding Tour De Force Sample Code

Sample code is a wonderful way to teach and learn coding.  The problem with a lot of sample code is that it is just too complicated and to fancy. I call it tour de force code because it seems like the authors are trying to show off how awesome their coding skills are. That’s probably a bit harsh but I feel like using 1,000 lines of code to show off every single feature of a concept/API/Class or what ever is overwhelming. It is the sort of thing that sends beginners a message that things are over their head.

I’ve always tried to avoid over complicated examples that I write for students. Far too many of the samples one finds from major vendors are either too complicated or leave out important information that beginners are not likely to have. Of course most samples on the internet are written for professional developers so that’s understandable. Beginners (students) requirements are far different from those of professional developers.

It doesn’t have to be that way though. The Phidgets website (see my post on Phun with Phidgets for context) has a sample code generator that I really like. (https://www.phidgets.com/?view=code_samples ) There are a number of options depending on how much a developer wants to do themselves and how much they want generated. Any way you do it there will be lots to do to make your final program. The samples are very basic but they do let one test a device and see some of its features. I wish more companies did things like this.

Over the years I have written some code generators myself. In fact, one of my masters degree projects was a simple “compiler” that generated code in multiple languages to work with a user interface library.  It generated very basic code that handled the most repetitious and tedious parts of the code so that a developer could focus on the interesting parts of code. It had the advantage that it used as input the markup language for the documentation system. It’s a shame that commercial systems like that don’t exist today.

I’m starting to think that writing code generators might be an interesting project. Something like a user interface that asks for variable names and things like loop parameters and generates code snippets. Some provisional IDEs, Visual Studio for example. provide help with generated snippets but I think that coding a generator might help students understand the code they use better. It’s just an idea at this point but I want to think more about it.

Monday, June 28, 2021

Phun with Phidgets

Recently I requested a free (for educators) starter kit from Phidgets. Phidgets are small controllers and sensors that are easy to use and with a helpful API. The starter kit includes a bunch of things to introduce the platform.

The Getting Started Kit provides an introduction to students and teachers. We offer a self-guided, online curriculum with challenges and projects for students.

• Programming languages: Python, Java, C#, Swift
• Device compatibility: Windows, macOS, Linux, iOS, Android
• What's in the box: VINT Hub, Push Buttons (2), LEDs (2), Humidity Phidget and all required cables
• Suitable for school grades: 9 – 12

I spent some time with the starter kit today. What I was looking for was pieces that were easy to assemble and sample code that was reliable and easy to use. That’s what I found.

The first thing I did was assemble a sort of control box with two push buttons and two LEDs. I plugged the controller in to my laptop with a USB cable and fired up Visual Studio.  There are samples and tutorials in Python, Java, Swift, and C#. The systems work with Windows, Mac OCS, and Raspberry Pi. Projects are available in a wide variety of IDES including Processing, Eclipse, NetBeans, and Visual Studio among others. That;s a lot of options. IT looks like more languages are supported less directly.

So anyway, I followed the starter tutorials to get a feel for both the type of tutorials supported and to get a feel for using the Phidgets themselves. They were very easy to follow with a lot of code you can copy and paste to get started. In a classroom I would spend some additional time explaining the code in more detail. Students could use this on their own but would really benefit from the sort of deeper explanation a teacher can provide. I do like that there are suggestions of next steps without sample code for the student. That should encourage students to experiment a bit. Solutions are available to educators on request though.

Besides the buttons and lights I ran though the sample code for the temperature and humidity device as well. Equally easy to use. I was gifted a couple of other devices – a Power Plug Phidget and a Distance Phidget. I have some Raspberry Pis around here somewhere so my plan is to try these Phidget devices with one of them. That will give me a chance to learn something about the Pi devices as well. I can see a lot of potential for interesting projects combining Raspberry Pi and Phidget devices.

These feel like the sort of devices I have been looking for to do a variety of hardware and software mixes. In other words, physical computing. There are classroom sets available that while not cheap are in range for a lot of schools. You can’t give hardware away for free and these devices are high quality and well worth the prices. IMHO.

Note that I got the kit and devices for free but without any expectations of quid quo pro. I really like this stuff.

Friday, June 25, 2021

Is Picking a First Programming Language the Hardest Problem in CS Education?

All of a sudden the subject of the first programming language is getting discussed everywhere. OK, maybe not every where but it is in Twitter, Blogs, and Facebook. At least. Mark Guzdial gets part of the blame (credit?) for this with his conversation starting post on the Blog@ACM Why Did We Ever Think the First Programming Language Didn't Matter? It’s hard to find the conversations on Twitter but several of the CS education groups on Facebook have conversations around this post. For example, the Computer Science Teachers group here.

Now this a a topic that comes up regularly. I’ve made reference to it myself several times. Back in 2017 I asked the question How important is the first programming language really? and answered that I thought it was important but that curriculum and the teacher were more important. The language has always mattered though.

In 2016, I posted a link to an article called How Your First Programming Language Warps Your Brain One can find similar opinions widely spread on the Internet with special attention paid to Dijkstra

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

I think we have always known that a person’s first programming language has a major impact on how they view programming. My first language was FORTRAN and it took me a long time before I stopped writing FORTRAN programs in different languages.

What does this obvious importance of the first programming language mean for CS educators? Well, its complicated. For one thing,Elementary and middle school have different constraints than high schools which have different constraints from universities.

I had a conversation with a middle school student recently. She attended after school programs at a university near her that taught her Scratch. She loved it. At the same time she saw older students (she’s a rising 7th grader) using a text based language and found it intimidating. She’s not convinced that she can handle what she called “real programming.” I tried to encourage her but one conversation only goes so far.

Research tells us (the professionals) that block based language are a good first programming experience but if students don’t see it as authentic they may think that is as far as they can go. While block based languages give many the confidence and concept base to move on and advance are some students falling into the trap that it is not real enough? I don’t know.

I’ve taught a number of language as a first programming language over the years. Visual Basic, Java, C#, PASCAL, and I’m probably forgetting some language.I am not ready to say that there is one best first language though. It really depends on ones goals.

Selecting the right language is important. Important decisions are seldom simple or uncomplicated.

Monday, June 21, 2021

Why Are Arrays So Hard For Beginners?

Beginner programmers often, dare I say usually, struggle with arrays. Sometimes it is hard for experienced programmers like myself to understand why but with years of using them in many languages they’re second nature for us

Beginners have trouble differentiating between the index and the contents of a part of an array.That seems to be the most common issue. Somehow the idea that the index is, in some sense, part of the name and not the value being stored is hard for some to grasp. Though come to think of it, I never talked about an index as being like a name. Perhaps I should but as a very experienced programmer with a background in Assembly language words like index and offset are natural to me. Beginners should not need to know how arrays are stored and accessed at the Assembly or machine language levels. Perhaps I will discuss indexes as part of the name next time I teach arrays. What do others think? Or what sort of language do you use?

While vocabulary is important, and students should understand words like offset and index, perhaps we need vocabulary that is meaningful to beginners before we teach them the vocabulary of experts. It’s a thought.

And then there is the whole “index values start at zero” thing which I have written about in the past. Zero Zero Indexing Considered Harmful

The other think I have been thinking about that seems hard  for some beginners is the need to initialize an array. They tend to assume that if one declares an array the elements in it should be assigned some sort of default value. Of course some programming languages do this for some data types. Numeric types get set to zero for example. It’s seldom a good idea to depend on this action and most of us do teach students to initialize the elements in an array. It’s a great way to tie arrays and loops together early in the learning process. I wonder why there are not library routines for this sort of thing. The .NET Framework has Array.Sort, among other things, so why not Array.Initialize? That’s probably not practical for arrays of many types but for some of the built in types why not?

On Twitter last week someone suggested that perhaps the problem was with arrays themselves. That seems reasonable but solving that problem is for people smarter than me. I’m just asking questions.

Tuesday, June 15, 2021

Getting Excited for CSTA 2021

As a member of the CSTA Conference Committee, I attended the first of two presenter training sessions today. Wow! CSTA 2021 will be good. Now I have read most of the proposals for presentations and helped select them so I had a pretty good idea this is going to be a great conference but today brought home a couple of things for me.

The big one is the shear number of online tools that teachers are using to make online (and probably in-person) teaching more interactive and engaging.  I taught online last spring and in a mix of online and in-person this spring but I never had the time to lean about all of these tools. That is mainly because I retired at the end of the 2019/2021 school year and didn’t spend last summer learning about teaching online. I kind of wish I had though.Never say never even about returning to the classroom. But that aside, I am really looking forward to learning at the conference this summer.

CSTA 2021 is going to be awesome! Hope to see you there. So much to learn!

Friday, June 11, 2021

Exploring the Ternary Operator

I’ve never had a lot of use for the ternary operator. Until recently, I think I under appreciated it. I Don’t recall ever using it in professional development though that may be largely related to using languages that didn’t support it. I never taught it to beginners either. Between time available and topics to be covered it never rose to a high enough priority for me. I’m starting to rethink that. But first, what am I talking about?

In C-style languages the syntax is:

(expression-1) ? expression-2 : expression-3

There is a Boolean expression inside the parenthesis, followed by a ? and a value for a true case, a : and a value for a false case. For example:

(Player == WHITE) ? "White" : "Black";

Other languages have different formats. For example, in Python the true option comes before the Boolean expression.

[on_true] if [expression] else [on_false]
>>> x, y = 5, 6
>>> print("x" if x> y else "y")

We actually see this sort of thing in spreadsheets though I never really thought of it as a type of ternary operator. This example from Excel is really a ternary operation

=IF(G10 <  G11  ,"big","small")

Back in the day we had something not all that different in FORTRAN. There was (probably still is) an IF statement in FORTRAN that branches to one of three lines depending on if an arithmetic value is less than, equal to, or greater than zero.

IF ( N ) 10, 20, 30 

But enough history. What really changed my mind about this operator? As is typical for me I revalued it when I found a good use for it. I have been writing a version of the Reversi program in .NET and C#. I borrowed a bunch of Java code from my friend Tom Indelicato (read about that program here) Steal from the best is my motto and Tom is an outstanding programmer. Along with the syntactic changes moving from Java to C# I wrote a lot of code to make the game work in a graphical user interface. I made some different design decisions as well which changed how some things are handled. I created a user control class for the game squares for starters. As part of this I used three different integer values to indicate whether the square held a black disk,a white disk, or was empty.

In the past I have often used a Boolean value to indicate which of two players was the current player. Switching players is pretty simple with a Boolean value.

currentPlayer = !curentPlayer;

That wasn’t going to work if my player indicators were integers. I decided to use the ternary operator because I didn’t want to write multiple lines of code for something that simple. So I wrote:

Player = (Player == WHITE) ? BLACK : WHITE;

WHITE and BLACK are defined constants. The next thing I knew, I was finding uses for this operator in all sorts of places. The really cool thing (ok for a geek like me) was that I could use this statement inside other statements.

message = “No legal moves for " + ((Player == BLACK) ? "Black" : "White");

I guess this old dog can learn new (to him) tricks. Do you use/teach this operator? Are there other language features you have ignored until one day you realized they would be just right for something you were doing?

Thursday, June 03, 2021

Trip Report: Teaching as a Long Term Sub

Well, this is not actually a trip report but its something like it. I spend the last couple of months teaching at Phillips Exeter Academy as a long term substitute. It was an interesting experience for many reasons. Not the least of those was the pandemic precautions.  Everyone wore masks inside and out, there were clear dividers between all of the seats around the table (more about that table in a minute), and for most of the time faculty were tested for COVID twice a week. I was fully vaccinated before I started there and the school ran vaccination clinics for faculty and students during the term.

Phillips is different from most other schools. It is the literal definition of an exclusive New England boarding school for a start. With a very competitive admissions process one is not surprised that the students are smart and highly motivated. Many of the students I talked to were looking for more academic rigor than their local schools. Needless to say classroom management was never even close to an issue.

As I alluded to earlier, classes at PEA are taught around a table. It’s a big table but class size is limited to about 13. None of my classes were larger than 12 and two sections were 10 students. Yes, that’s wonderful for a teacher. Between the small class size and teaching around a table it is not easy for a student to get lost. Teaching around a table forces a more conversational method of teaching. Its very interactive. I really enjoyed the format.

Another part of the system there is something they call METIC. I forget what that stands for but basically what it is is a mid-term check in. Students in the class are given some time without the teacher present to discuss what was going well in the class, what is not going well, and what students and teacher can do to make the rest of the term go better. Now this can be hard on the ego for some teachers especially if students are hard on them. My students, and from what I hear  most students at PEA, are very respectful and honest. Following time without the teacher, the teacher returns and the items the students brought up (written on the white board) are discussed. For me as a new comer to the particular school environment this was extremely valuable. This is something I wish had happened earlier in my teaching career. I think it would have made me a better teacher.

Everything was not all smooth sailing of course. I took over the course in the fourth week of the term and my students had two other teachers in the first three weeks. Figuring out what students knew and didn’t know took me a while. I also had to figure out a plan for the rest of the term. Fortunately, other members of the CS department were incredibly helpful and supportive. I was give full access to curriculum from a previous time these two courses had been taught. This saved immeasurable amounts of prep time.They were also always available for my many questions about the courses and the school’s processes.

As I alluded to in my earlier post (Back in the Classroom Again) I had to reacquaint myself with Java and learn my way around two IDEs (Eclipse and Processing) that I had never used before. Its tough answering questions about IDEs when you have no real experience with them. Fortunately I am good at exploring menus and looking up things on the Internet. I’m far from expert at either IDE but I’m not totally lost either. I found Processing and its graphics library fun and interesting. My old experience with XNA from years ago helped me out there. Though I do wish Processing had some built in collision detection. Probably good for students to figure out and code that for themselves but I’ve been spoiled by .NET. I would use Processing again for Java.

Overall, I had a great experience. I learned a lot, got to work with great teachers, and teach some awesome students. I’m not unhappy about getting back into retirement though.

Thursday, May 27, 2021

Othello/Reversi for After the APCS Exam

My good friend and former teaching partner, Tom Indelicato posted about his end of year project for his AP CS A student recently. With his permission I share it with you.

I said goodbye to my seniors today (last day of classes for them). We wrapped up the post-Exam project (I gave them the framework for a Reversi / Othello game, and they wrote an AI for it) by having them play against each other. I put up a randomized tournament bracket, and awarded a $10 Dunks card to the winner.

An incredibly good class of students, they told me that they thought this was the greatest final project ever! I'm gonna miss them.

Tom also generously shared his framework code at https://1drv.ms/u/s!AmXKuaTMPmyCpVBNCyiB0h3t5uWi?e=j9Gv1N

Interestingly, a similar project was in the Nifty Projects session at the CSTA Annual conference in 2018. Unfortunately the GitHub code repository that was associated with it seems to have disappeared. There are other related and useful resources still there at https://sites.google.com/.../roger-jaffe-othello-competition

Most likely Tom's framework would fit along with it with a few minor tweaks.


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.