Tuesday, February 27, 2024

Alphabet? What alphabet?

I used to start a talk on internationalization of code with the question “How many letters are in the alphabet?”  Once I had several people say “26” I would ask “Shouldn’t you ask ‘what alphabet’ first?” I would then discuss some different alphabets and how many more or fewer letters they had. Then briefly mention that not all alphabets look the same. That’s is why ASCII is not good enough.

Today I ran across the following graphic. I wish I’d had it back in the classroom.

Who knew there were so many diffe3rent scripts? I suspect that are many more not on this list of course. Let’s not forget that some them are read left to right and not right to left.

Are you discussing multiple scripts and alphabets with students? It can bring up some interesting questions. And widen ones experience. If you are lucky enough to have students who are familiar with these non-Roman script languages ask them to explain how sorting of words happens. I had Chinese exchange students who were happy to explain how Chinese words are sorted. Short answer is by the strokes that make up the words.

Sunday, February 18, 2024

AI Debuggers?

A meme was posted (by Doug Peterson I believe) asking why if the computer knows there is a semi colon missing that the computer doesn’t add it? It’s a good question and I think it gets asked pretty often. The answer is that the computer doesn’t always know where exactly the semi colon belongs. Or if there are other possible answers to the error.

Compiler parsers aren’t always helpful as we’d like. There are several parts to most compilers or interpreters. Parsing is the most visible of these parts. Typically, compiler developers seems to spend the most time and effort on the backend part that generates the actual executable code.  There has been amazing progress in backend code generators. It is unlikely that even the best assembly language programmer can do better than compilers except in rare cases.

The front end, the code parsing that shows syntax errors has not been as big a focus. That seems to be changing and I expect that the inclusion of artificial intelligence may help improve things.

I experimented a bit this morning using Visual Studio. I entered some erroneous code and looked at the results. The code I used was a missing semi colon and a loop with no executable code.

for (int i = 0; i < 10; i++)

I was given the expected “; expected” but I also received a message that “
Error    CS1525    Invalid expression term '}'  “

This is a case of one mistake creating two different errors. This can be pretty confusing.And is less than helpful. Visual Studio did give me a couple of options to deal with this error. Or two. Some of the options didn’t make the errors go away. The one that did was not to add a semi colon but rather to add braces. Of course, either adding a semi colon or adding curly braces leaves one with a a for loop that doesn’t do anything. A warning about that would be nice and I have seen that warning from other parsers.

I would think that a good AI that understands compiler errors would be a lot more helpful. Microsoft is talking a lot about adding artificial intelligence to more products. Will that include compiler/parsers? I think that is likely at some point.

So far the attention has been focused on using AI to generate code. People seem to think that will mean no need for human programmers. People also think that AI will generate perfect code. Or at least code without syntax errors. I think those are somewhat mistaken assumptions. We have lots of great tools for generating websites for example. There are still many cases where human editing of HTML files is needed to get all the desired results.

I expect that human coding for fine tuning of AI generated program code will be necessary for many years to come. As long as AI generated code is “taught” from Internet available code I expect syntax errors to still show up. Some of those errors may not even be caught by parsers. Different versions of compilers can have different rules about what code is acceptable. We will have to see how things progress.

Syntax debugging will be the easy part relatively speaking. Logic errors will be harder still. We live in interesting times.

Monday, December 18, 2023

How Much Hardware Knowledge Do CS Students Need

Back to the basics! Get students close to the hardware! Really? Just how much hardware knowledge to students need today? This post was prompted by a post getting some attention in Facebook this weekend. The Decline of Hardware Knowledge in the Era of Cloud Native Compute

Now I have been around for a while. I programmed using punch cards and paper tape. I spent some time in an operating system development group where I analyzed crash dumps, wrote code in assembly to traverse stacks and queues to understand what was going on. Great fun. In hindsight anyway. But do high school students need to get that close to the computer today? Probably not.

Would it hurt them? Also probably not. Most students don’t really need assembly language or detailed hardware knowledge. Once upon a time, for example, it was important o know exactly how data was stored on a disk with block sizes especially important. For solid state “disk” that is less important if it matters at all.

It’s a mistake to assume that the way we were taught and the things we were taught should still be taught in the same way.

Typical instruction about hardware today is about the parts of the computer – CPU, memory, maybe some talk about cache . In some schools students disassemble and reassemble computers but that is getting harder to do as parts get smaller and more tightly integrated. I don’t want to mess with my laptop at all if I can avoid it.

That is probably enough at the high school level. Now in university I would like students to have some knowledge of things like how micro code is used to code today’s CPU instructions, pipelining, caching, and yes, maybe a little assembly programming. The latter more as a unit than a full course. Let the students who want to take more advanced assembly or micro coding course work.

One big problem with expecting the sort of deep in the woods course work in high school is the lack of teachers who can really teach it. We have enough trouble finding teachers who know Java or Python. Finding teachers who can teach assembly language, explain the inner workings of an OS or the machine hardware? Good luck!

Be sure to read Mike Zamansky’ related post Low Level CS in HS - C'est la Z (cestlaz.GitHub.io)

Wednesday, December 13, 2023

Looking Forward to Computer Science Education in 2024

“Prediction is very difficult, especially if it’s about the future!” --Niels Bohr

My track record at looking forward in CS education is a mixed bag. I kept expecting a big jump in internet of things courses and those never developed. Sad really. I think it would be a good idea. I keep predicting growth in cybersecurity courses and the past year seem to show a lot of growth there.

Cyber security is getting a lot of press so I see more of these courses in 2023. I hope they are real in-depth courses and not just how to stay safe online. Teacher interested in this should follow the Cybersecurity Educators group on Facebook.

I predict that Artificial Intelligence will be a big deal in CS education in 2024. OK, that’s easy. How will it play out? Well, that is a different question. Certainly teachers are going to be concerned about AI tools helping student cheat. Some, the better teachers, will find ways to use AI tools. For example, having students evaluate the generated code. Does it cover all the conditions? How can prompts be better for better results? It the generated code any good? What does “good code” even mean?

There will also be a growing movement  to teach about AI. How does it work? What are it’s limitations? What are the ethical and social impacts of AI? So much the teach and learn for students and for teachers. We’re only getting started.

Another easy prediction – Python will continue to grow in use.AI libraries will drive some of that for sure. A lot of teachers seem to prefer it to Java though so there is that. Will it replace Java for APCS A? I doubt it. IT will be interesting to see how the JavaScript/Python balance develops in AP CS Principles though. Keep an eye on it.

Unfortunately, I predict continued growth in the number of unprepared CS teachers. I wrote about this in my looking back post and I have no expectation of improvement anytime soon. Looking Back on Computer Science Education 2023

One big thing I wonder about is DEI in CS education. Will the politics and demonization of DEI impact how CS it taught? Diversity, Equity, and Inclusion are pretty important if we’re going to really make progress in computer science. Having a white and Asian mal monoculture has not, in my opinion, led to a good CS ecosystem. We need diverse thought in CS. I may have another post just on that subject.

At the same time, we need to be careful in PD and conferences that we don’t only talk about DEI. I’m not seeing a lot of disagreement on the idea that we need to have diversity in the industry and our classrooms. Teaching equitable is also a no brainer. And inclusion? We’ve pretty much agreed on the need for that in education. Do teachers need to be beaten over the head to see the need? Not the ones I know. At some point too much preaching to the choir is going to result in a backlash that we can ill afford. Let’s not assume that teachers don’t understand the problems. Let’s focus on solutions.

I’m really looking forward to the annual CSTA conference this summer. It’s going to be greet. This summer we will hear what teachers have learned over the last year or two. Being in-person means a lot more interaction.  I may have to make a mid-year post about the 20224/2025 school year after the conference.

So what to you see happening in CS Education in 2024?

Sunday, December 10, 2023

Looking Back on Computer Science Education 2023

I’m posting this early this year. My thinking is clear so why wait?

For many, 2023 was the year that Artificial Intelligence, ChatGPT and other tools, really toss a stick in the wheel of CS education. Suddenly students could use an AI to write code for their programming assignments. People were in a tizzy. The CollegeBoard made last minute changes to AP CS Principles and teachers online could talk about little else for a while.

Things have calmed down some since earlier in the year but educators are still grappling with what it all means for how there teach. This is true not just in CS of course. I am skeptical of those who claim to be experts in AIs impact on education. No one has the depth of experience with AI in the actual classroom yet.

While not really CS, Steve Dembo has been using ChatGPT in interesting ways. He chats with Vicki Davis about it at The Great Student AI Writing Experiment with Steve Dembo (coolcatteacher.com)

That is not to say that teachers haven’t learned a lot. A lot of so called experts are saying things like “just change how you teaching ways that make ChatGPT not useful”. As if! There is not a lot of discussion about what sort of change they mean.

The other big thing I have noticed this year may be even more concerning to me. There seems to be a rapid growth in unqualified teachers teaching Computer Science. Now this has always been something on a problem but the rapid growth of requiring CS education in more schools has exacerbated the problem. We are seeing teacher, who are probably great teachers in other areas, being asked to take on CS classes without adequate preparation. I am seeing teachers ask questions online that I would expect their students, after taking their class, to be able to answer.

Frankly, it scares me. For years university faculty complained about incoming students being poorly served by poor CS teaching in the high school level. I can only see those complaints increasing with more validity than in the past. Fixing this is going to take a lot of work.

I don’t blame the teachers. I blame administrators. I also blame legislators who fail to provide the funds and programs for training teachers in this rather technical subject.

OK, those are my two big takeaways from  2023. What have you seen?

Sunday, October 29, 2023

Spelling Bee Solver Project

My wife loves word puzzles. She is amazing at them. Me? Not so much. On the other hand I love programs and programming projects that involved string manipulation. So when my wife started playing a new (to her) word puzzle – the New York Times Spelling Bee – my thoughts went to solving it programmatically.

If you are not familiar with the game, it involves seven letters for the player to make words from. Anny of the letters may be used but only letters from the list can be used. Oh, and there is one letter, shown in the center of the letters, that must be used in every word. Words much be four letters long or longer BTW.

NY Times Spelling Bee image

I thought this would be a fun project to code up so I took a pass at it. I think it would be a fun project for use with students as well. It involves a number of interesting and important concepts.

For one thing, you’ll want to open and read through a text file. There are many word lists available on the interne BTW. So that part is easy. You want want to check through a list for any words that are not school appropriate (that suggests other interesting projects now that I think about it).

Looping is obvious of course. As is parsing strings to find if a given letter is or is not included in a word. One method I wrote for my solution was to build a string of letters that were not included in the list of allowed letters. I searched any possible word to make sure that no unallowed letters were part of it.

Have you tried this or a similar project? Would you use this one? If you do, let me know.

Edit: Should of known it had been done before. Useful information at Nifty Assignments.

Tuesday, October 24, 2023

Last Call for CSTA Conference Proposals

The CSTA Call for Proposals is coming to an end October 30, 2023 11:59 PM PT.

Presentations are what makes the CSTA Conference is what makes CSTA the best conference for K-12 Computer Science educators.  It’s also a wonderful; audience for CS educators to present their good ideas. If you have a good idea that you have been using successfully in your classes you should think seriously about presenting to CSTA.

So think about what you have had success with and think about submitting a proposal. But act fast!