Thursday, January 27, 2022

What Do Computer Science Teachers Need For Professional Development

Mike Zamansky had a great post called Trends In Professional Development in CS - it's not all good. We’re still at a very interesting place in the development of computer science education.  The shortage of qualified CS teachers is becoming more acute and more and more schools and school systems attempt to expand CS education. Professional development is also growing as well As Mike reports a lot of it is from content providers who have a vested interest in promoting their content.

What do CS teachers really need for professional development? Learning about tools and established curriculum is helpful for sure. Increasingly though, we are seeing teachers without a strong CS background being asked to teach CS classes. Few would ask teachers who could not speak Spanish to teach AP Spanish but that doesn’t mean that teachers who don’t know a lot of CS aren’t asked to teach AP CS courses. Weird isn’t it?

So clearly a lot of teachers need content knowledge. Learning along with students using canned curriculum sort of works I suppose but to be that feels like everyone is going to get shortchanged.  We are starting to see more pre-service programs for CS teachers. The program Mike Zamansky is helping to build at Hunter College for example. And there is usually the option, time consuming and possibly expensive, of taking regular university CS courses. The key thing is that school systems have to be supportive (with time and money) for teachers to get this training. A week or two in the summer is not going to cut it for CS content anymore than a week or two is enough to prepare is Physics or Chemistry teacher.

The other thing CS teachers need to know is how to teach CS. Content alone isn’t enough. As someone who entered teaching with lots of CS knowledge but nothing more than having been a student in terms of how to teach. That’s not as much as some might think! Teaching CS is different from a lot of other subjects. Similar in some ways for sure but also different. Learning how to use specific curriculum is helpful and I have learned a lot from content providers over the years. We could do more. While pre-service programs are starting to come online and include this sort of thing there is still a shortage of such education for in-service teachers.

We’re starting to see more “how to teach” sessions in conferences like CSTA. The one I lead in 2020 was very well attended which suggests that there is demand. Books are starting to come out as well. Computer Science in K-12: An A-to-Z Handbook on Teaching Programming edited by Shuchi Grover is my favorite and one I recommend highly.

We still need a lot of research on how to teach computer science. That looks like it is increasing as well. That’s great especially if researchers share their results in ways that are accusable to teachers. Not all K-12 teachers have access to papers that are behind paywalls. I’m sure hoping to see more research based teaching techniques at CSTA this summer.

What do you want to see in CS teacher professional development? Who is doing it well? Any other books to recommend? Feel free to add in the comments.

Tuesday, January 25, 2022

Writing The Wordle Clone

Kelly Powers posted a Wordle project document on the AP CS A Teachers Facebook page. It’s solid as one would expect from Kelly who is just awesome. It inspired me to write my own Wordle clone to better understand what is involved from a student project perspective. Of course I did it my way.

A Wordle project must consist of several parts:

  • Pick a word
  • Accept a guess from the player
  • Analyze the player’s guess
    • Look for letters in the right place in the work
    • Look for letters in the word but not in the right place
    • Look for letters not in the target word
  • Give the player feedback
  • Repeat accept and analyze until player finds the work or had 6 tries
  • Report on end of game

Most of this is platform and language independent. The exception is giving the player feedback. I’ll get back to that.

Picking a word can be easy (a hard coded selection – great for debugging) or a little more involved (picking randomly from a list). The list can be a small array or a large one that involved reading from a file. Which you select depends mostly on where students are with regards to reading from files and filling arrays or array lists. I have links to two large lists of 5 letter words at the end of the post. The first is one that I use and is on my web page. The other is a larger list on GitHub.

Accepting the player guess can be as easy as reading a work from a line. Analyzing the word is the first place where students have to think things our. String methods like SubString for looking at individual letters, IndexOf for locating specific letters in a string, and others are very handy here. Once can create new arrays of a) letters that are in the right place b) letters in the word but not the right place, and c) letters not in the word at all can be useful. I’ve sure there are lots of other ways as well. Much will depend on how you display the results to the player.

Feedback! One can reprint the player’s guess with letters that are in the correct place in UPPERCASE, letters in the word but the wrong place in lowercase, and empty spaces for letters that are not in the word at all. That’s probably a great way if you are totally text based. If you are graphically minded, you can try to duplicate how the web based game displays results.

There are lost of graphic libraries that will let programmers display things graphically. Swing in Java, Processing (for Java or Python), as well as many online drag and drop tools will all do this. I worry that for most of them students spend more time on the graphics than on the nuts and bolts of the rest of the program.

I’ve gotten a bit, ok maybe more than a bit, spoiled using Visual Studio and Windows Form projects in Visual Basic or C#. That is what I used to program my solution (image right). I have 6 arrays of label boxes. Yes, I should have used a two dimensional array. That would have made some things easier but I was not trying to make the best version ever. A lot of beginning programming classes skip multi-dimension arrays as well so I wanted to see how it would be done without them.

As each letter of a guess was entered on the keyboard it was entered in a label box. After all 5 letters for a guess was entered I checked all the letters against the Wordle word and the back color of the box was changed appropriately. The result was pleasing.

Checking for a winner was a matter of checking the state of all 5 label boxes in the row array. This would be similar in a text based display as well.

All in all a very doable project for many programming classes. And it is current which I see as a plus. Additionally students will probably be very happy to play help debug their peer’s programs.

Monday, January 17, 2022

Computer Science for the sake of ?

My grandson in kindergarten has a class in reading. It makes sense as he is just learning how to read. Over time, school spends less time teaching how to read and a lot more time using using reading to support learning. For many years, I have been saying that computer science and its tools should be the same.

Early on I thought of things like using spreadsheets to look at data. More and more I see programming as a learning tool as well. But coming back to data. I recently watched a TEDx talk by Emmanuel Schanzer titled Four Ingredients for K-12 Data Science. Watch it. It’s cool. In any case, it is clear that Bootstrap Data Science takes things I used to think about to a whole new level.  I saw a presentation on this by students at a conference in the before times and was impressed with what students had learned.

Now Bootstrap is probably best known for their mix of computer science and algebra but they are moving into more areas of the curriculum and I think that is a great thing.

I’ve also mentioned Mark Guzdial’s work in teaspoon languages. (task-specific programming => TSP => Teaspoon) Mark’s work involves “adding a teaspoon of computing into other subjects.” It’s still some early days on this effort but it looks very promising.

Last spring, while I was teaching at a new (to me) school I spend some time with a teacher of astronomy. He was having his students write Python programs to solve astrophysics problems. Faster and more accurate than the slide rule stuff back in my day.

In many ways, I think the CS 4 All movement has been a bit too focused on stand alone computer science classes. Those have a role for sure and some great value. But ultimately, computer science is used in just about every discipline we have today. Teaching it in those various contexts and using CS to help learn those other areas of knowledge is were CS education can have its greatest impact. And greatest relevance. Finding more ways to do that should be a priority. Not just for CS bot for all areas of teaching and learning.

Wednesday, January 12, 2022

Planning Before Coding

After all these years one would think I would know better. But it turns out that when coding for fun I don’t always do the planning that I should. It always comes back to hurt me. If you have been reading this blog lately you know that I have been playing with a Wordle solver. It’s going well. But ..

I started well. I identified several thins my solver should look for:

  • Words that include letters I know are in the word
  • Words that don’t include letters I know are not in the word.
  • Words where a letter (or letters) are in specific positions
  • Words that include required letters that are not in positions I know they don't  belong

I coded up the first two options first and a partial implementation of the third option. So far so good. The problem came when I wanted to add an implementation of the fourth option and a more complete implementation of the third. The problem is that I had neglected to plan for where in the code I would do those checks. I tried tossing them in to the existing method but it was a mess. I had to change a good bit of the code around filtering words to make it both work and be more understandable.

In hindsight, I think I would have been better off creating stub methods for all the options and filling them in one by one. It’s a technique I recommend to students all the time so I should have thought of it myself. This would have given me a stronger framework from the beginning and made my life easier.

In any case, this exercise was a reminder not to start coding before enough of the planning has been done. I know the mod these days is to write fast and break things with a lot of rewriting. I find that to be less than ideal for me though.

Tuesday, January 11, 2022

How Do You Define a Computer Scientist

The last few days have seem some social media discussion about requirements for a computer scientist. Is Calculus a requirement? Is Assembly/machine language a requirement? Among the “yes” and “no” answers there are requests for a definition of a computer scientist. I doubt we could get agreement on a single definition. The mental image people have of a computer scientist is closely related to what knowledge they think a computer scientist should have.

In K-12 education I think we should be very careful and drawing too narrow a definition of a computer scientist. If truth there are many kinds of computer scientist and each kind has its own requirements.

Someone exploring the science of compiler design and code optimization probably does need a solid understanding of machine language. Someone whose focus is on machine learning probably doesn’t as their tools will be at a higher level than the machine. Computer cryptography could probably use a good dose of Calculus. As could some other focuses. Does someone studying user interface? Maybe not.

Should students focus on a special area while in (or before) high school? I don’t think so. They'll have more opportunity to find a focus later. Is Calculus useful? Sure, and for more than just computer science. But there isn’t much that students will do in your average HS CS course that requires it.

The same is true of assembly language. Assembly language clearly gives students greater understanding of the machine below. Some exposure to it is good for programmers and computer scientists. Should it be required? Again, probably not at any depth unless there is a specific need to it.

Back when I was learning CS we had a computer without the memory for an operating system. Programming in assembly language was required. I had to learn how to program subtraction, division, and multiplication on a machine that lacked built-in instructions for those operations. A great learning experience but not one I found much use for later in my (almost 50 year) career. I did work on some projects that required a firm knowledge of the execution speed of different instructions. And knowledge of assembly language helped there. But we don’t see that sort of need except in rare cases these days.

What was required knowledge 50 years ago may not be the same as required knowledge today.  We have to avoid the blind assumption that what we learned and the way we learned “back in the day” is the way things have to be today.

Friday, January 07, 2022

Wordle Solving For Fun and Coding

After my post the other day (Is Wordle A Project To Assign Students to Program?) I got thinking about solver help for Wordle. I happen to have a huge word list I got some somewhere some time ago. For various reasons I had written a program to make sub list files of words of a specific length. So of course I have a list of 5 letter words – something over 8,000 of them. So that is a start.

Phase one of my program was to find all the words that had a specific letter in a specific location. That narrows things down a bit was not near enough. Phase two was to ignore words that had specific letters which I knew were not in the correct answer. That was very helpful.

If I don’t know where any letters were I was not getting close enough. So I added a method to include all words that had specific letters in any position while ignoring words with specific other letters.

You would be surprised at how many 5 letter words have the same five letters but in different position by the way. On the other hand if you get enough information about what letters to exclude, what letters to include, and one or more letters with a specific location than finding the answer is pretty easy.

This was a fun (for me anyway) coding exercise. Will it be fun for students? I have no idea. Let me know if you have an opinion or try it with students.

Tuesday, January 04, 2022

Is Wordle A Project To Assign Students to Program?

Seems like a lot of people are playing Wordle on social media these days. Have you tried it? It’s a word/letter version of old Mastermind game The idea is that you enter a five letter word and the game tells you if you have a letter from the word in the correct place (green highlight), a letter from the word in the wrong place (gold highlight), or a letter that isn’t in the word (grey highlight). You have 6 attempts to get it right.

You can read more about the game many places but I read about it here.

It’s a fun game to play especially if word puzzles are your thing. I’ve had students program Mastermind in the past. It goes pretty well. This might be a fun variation for students as well. The current tie in with social media may be a plus as well.

Oh, wait, can we program the computer to solve Wordles?