Tuesday, June 06, 2023

Conversations on AI in Education

Pat Yongpradit from Code.Org tweeted an image of what they are seeing in conversations about AI and Education. (The link on the image below goes to that tweet)

Now I am not having the detailed conversations with policy makers that Pat is but these boxes pretty much match what I am seeing in my social media these days. That bottom right hand box is where I’d like to see myself and others but it feels like people in power are more on the left hand column.

The usual tech bros are touting the AI can replace teachers line. We’re a long way from that and I am not sure we’ll ever be at a point where that is a good thing.

Lots of teachers are afraid of cheating. That’s not an unreasonable fear. There are pundits, some of whom are teachers, saying “just change the way you teach and all will be well,” I see a shortage of detailed information about just how to teach differently to avoid AI cheating. I think some of those people are fooling themselves if they think they have all the answers. Students are very good at finding new ways to cheat no matter what the assignments are.

The right hand column is where I think we need to be but there are more questions than answers there. Frankly, I think the technology is still to new and experience with it is to little to answer these questions with any strong level of confidence. We really need teachers to experiment with these tools in actual classrooms. That takes some freedom that doesn’t exist in as many places as we would like. Government and administrators in too much of the US are more interested in constraining what teachers do in the classroom than giving teachers freedom to develop new ways to teach.

The question is, are schools going to still look the way they did 100 years ago, as they do today, or are we going to see real change that uses technology to the fullest?

Monday, June 05, 2023

Let’s Try it and Find Out

Facebook memories reminded me of a frequent conversation I had with students. They would ask me what would happen if they tried something and I would answer “I don’t know. Let’s try it and see.” Students often expect teachers to know everything. Well, if they believe their teacher is a real content knowledge expert. Of course there is more to be known than can ever be known. This is especially true in a subject like computer science.

Too many students expect teachers to find answers to questions they have. That’s not the best way for them to learn. Trying things for themselves is a lot better. That’s why I loved to suggest that students try things for themselves. Encouraging students to try things for themselves and to experiment helps them grow more independent as learners. It also helps them develop their creativity.

This is similar to another exchange I used to have with students. I might say “One of us should look that up. You’re the student so I think it should be you.” Again, students who look things up for themselves remember information better,

Thursday, May 25, 2023

Coding With AIs Prompts Are Important

Last night, when I could not sleep, I got up and wrote some code. I added some features and data checking to my Wordle solver helper program. When I finished I felt good about my work and myself. I think that made it easier to get to sleep and I slept well.

It got me thinking this morning. When I was in university and still learning how to code I would occasionally get frustrated and feel less confident. So I would write some simple program to help me feel like I could actually code. I must have written code to display the multiplication table from 1 times 1 to 12 times 12 at least once a semester. It worked for me.

Now that is a trivial program but it involves nested loops (for me anyway) and I am not sure I would assign it to students today. It’s really a meaningless program in today’s world when everyone has a calculator app on the phone they don’t leave the house without.

I did wonder how an AI would write the code. So I opened the chat option in Bing and asked it “Write some C# code to display multiplication tables in a list box” It gave me some code that displayed this:






Not what I wanted at all. The problem is ambiguity! So I tried again with “Write some C# code to display the multiplication table from 1 times one to 12 times 12” and got this:

Not what I wanted either. So I specified at grid format “Write some C# code to display the multiplication table from 1 times one to 12 times 12 in a grid format”

This reply required a dataGridView object and the program did not work. Looks like I need to set up the dataGridView object in ways the AI did not explain. Now there is a problem worth thinking about. I asked Bing what settings I needed for the dataGridView and it gave me several. Program still did not work. At this point I gave up on the dataGridView option. It sort of feels like overkill anyway.

So I tried another prompt “Write some C# code to display the multiplication table from 1 times one to 12 times 12 in a grid format in a list box”

Finally I got what I wanted even though I am not thrilled with the formatting.

I’ve got a number of takeaways from this. Yes, students could use  these AI tools to get code for typical school assignments. On the  other hand, I think it would be fairly easy to tell when they do. The use of features that are not typically covered in class lectures or demos would be one clue.

It’s not always easy to provide the right prompts to the AI. Sometimes it takes some iteration. I think though, that teacher have to reduce ambiguity in assignment descriptions in many cases. Arguably some amount of ambiguity is helpful to allow for creativity. It can be a fine line,

As noted, I didn’t like to formatting so I did modify the code to get closer to what I wanted. I think programmers are going to be needed in a lot of cases to finish off what AIs generate. Both providing the right prompt and finishing off will be important skills for some time to come. Finishing off is going to require some serious skills in many cases BTW. Programming is not dead yet.

Saturday, March 18, 2023

Finding Words With All The Letters Programming project

Does anyone else lay in bed in the morning thinking about coding projects or is it just me? I’ve been playing around with a Wordle solver helper for a while now. It helps me find words based on what I know after each guess. One of the things I like to do is see how many possibilities there are based on different hints. Yesterday I had most of the letters but not in the right place. So this morning I was wondering about words that had the same letters but in different orders. Seemed like something I needed to write some code about.  

A key method is to compare all the letters in one string with the letters in a second string. At least the way I was thinking of handling it. It struck me that that is a great assignment for students. I don’t have any students handy so I asked ChatGPT to write that function. This is the prompt I gave it:

Write a C# function that accepts two strings and returns true if all of the letters in the first string are included, in any order, in the second string. Return false if any of the letters in the first string are not included in the second string.

That is a lot like what I would assign a student. ChatGPT gave me some very nice code. It wasn’t exactly like what I was writing in my head. It used foreach and ToCharArray which is probably the best and easiest way to do this. I was coding before either of those became common so my mind goes to for and while loops and the string SubString method. This was a good reminder for me.

I left the rest of the program, which wasn’t a lot of code, to myself.

Once written I had some fun with it. For example, the letters in Alfred also makeups the word flared. The letters in face are also used in café. Some groups of letters do not make up any words of course, This seems like it could be a fun project to give students. It was fun enough for me.

Tuesday, March 14, 2023

Book Recommendations for CS People

tl;dr Book recommendations:

Overnight Code was recommended to me after I recommended Code Girls on Facebook. Overnight Code is a truly inspiring story of a woman with two strikes against her (female and Black) whose hard work, determination, and talents helped her do some revolutionary work in naval engineering and integrating hardware/software systems.

Debugging code is arguably a lot harder than writing new code. Raye Montague was amazing at debugging code and integrating disparate systems. But also a good person who helped mentor and advance others. She was given tasks that others had said were impossible to complete. Talent and hard work (Raye had a lot of both) allowed her to accomplish beyond expectations.

There is a lot of good career and life advice woven into this story as well. Advice for everyone. I could have benefited from this book early in my career.

"Code Girls: The Untold Story of the American Women Code Breakers of World War II"  was recommended by several people in a Facebook group dealing with a Kindle Challenge that Amazon is running. The idea about code breaking sparked my interest right away. This book was more than just that though.

There were plenty of insights into code breaking but the look into the lives of these amazing women was the highlight. It was a different time and women would not as respected as they should have been. Yet, these women put their considerable talents into working for the war effort and their country.

Code breaking is a fascinating subject in itself of course. I enjoyed reading about the “bombe” machines, how they were created and used. I also found the difference that code breaking made in the conduct of the war (World War II) to be interesting. This is not the sort of thing many history courses cover.

It’s easy to label these books as books for Women’s History Month or the Raye Montague book as being for Black History Month but that would be a mistake. These are books for all year long. I recommend them to anyone interested in the progression of computing in society. Code Girls is a great read for cybersecurity or cryptography students. Overnight Code is a powerful read for anyone not just computer science people. It is just that inspiring.

Thursday, February 23, 2023

Does It Run in the IDE?

I was reading a tweet from a person saying they lost points a program written with pen and paper because the teacher thought the code would not run. When the student asked the teacher to write the code on the computer it ran.

The Twitter discussion was on the wrongness of code assignments on paper but I am not sure that paper coding assignments are necessarily wrong. I suspect that the problem in the Twitter user's case may have been a teacher who is experienced. I could be wrong of course.

The real problem is a teacher putting too much faith in their own mental execution of the code on the paper. I have found it a good practice to enter code I was the least unsure of into an IDE and run it on the computer. I’d almost always check code I thought did not work. Students can be very clever and write code that doesn’t look like it will work but does work. Or code that does look like it works but doesn’t.

This all points to problems with testing computer programming in general. Writing code for evaluations is problematic in a number of ways. Yes, I know the AP exams do it that way. I’ve only graded the AP A exam once but I can tell you it’s not that easy. Handwriting can be hard to read for starters. I’ve already mentioned how clever students can be. I loved the 10 line code answer for a guestion that was looking for a one line return statement. I could have saved myself a lot of time if I could have verified it by running it.

Asking students to write code in an IDE offers logistical issues for starters. There is also the issue of students being able to look at each other’s screens and sharing files. Some object to students using autocorrect, error checking, and help files. All the sorts of things professional developers use. Some teaches do prefer code turned in electronically because it allows for auto graders. I’ve discussed them here several times. Basically, mixed feelings.

Evaluating student knowledge is one of the more difficult tasks programming teachers. It’s a problem with no easy answers. For now, I think, the best policy is to use a variety of assessments.

Tuesday, February 14, 2023

People Are Bad At Giving Instructions

One of the things that make me sure that programming will be around for awhile even with better and better artificial intelligences is that people are bad at giving instructions. Well, that may be unfair. They are reasonably good at giving instruction to other people but that is not the same as being good at giving instruction to the literal minded.

The most famous instruction, I first heard it from Grace Hopper almost 50 years ago is the instruction for using shampoo “Lather, Rince, Repeat.” There is a lot left out there. Most obviously, repeat how many times? It also doesn’t say if one should wet their hair first. In computer terms, an infinite loop without setting initial conditions.

I recently bought a new cover for a light switch. The first instruction was to turn off the circuit breaker for the switch. Good advice. On the other hand, the instructions did not say to reset the circuit breaker when finished installing the cover. A literal minded installer would never have a working switch.

Of course, people figure these things out. We are aware of the larger context and are good at filling in missing pieces. Computers are not that good at any of this.

Part of what we teaching when teaching programming is how to give instructions. Not just how to translate those instructions into code but to fully understand and describe the steps needed to complete at task. I believe these are necessary skills. I think they will translate to other fields. Not that I have proof but it seems logical. In any case, we’re going to have to get good at giving instructions if we are going to tell AIs what code  to write.