Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Wednesday, September 23, 2026

Programming Languages as Common Ground with AI

A few days ago I had a little problem. I had a text file with a lot of lines I didn’t want. Specifically, it was a computer generated transcript with timing on just about ever other line. It made reading the document harder and didn’t provide me with information I needed or wanted. So I decided to clean it up.  Obviously, I could write some pretty trivial code to do it for me.

This being the age of AI, I thought I would let AI write it for me. I use Visual Studio (the full blown version) and GitHub Copilot is available to me there. I thought about asking it something like this:

Create some code to read a file and create a new file that doesn't;t include lines containing a user specified word or string.

That's the sort of open ended instruction I might give students.I might use something like that in Advanced Placement CS A if I were still teaching it. It's fine as far as it goes. More on that prompt later in the post by the way.

I wanted something a bit more specific. Something that worked the way I like to work. That meant a Windows Forms application. I decided to give AI what I would include as scaffolding for a student project. Some easy steps to provide a more gentle path for students. Or in this case, something particular I wanted to see.

What I gave GitHub Copilot was:

Create a C# method that:
1.    Uses a dialog box to request and save an input file name
2.    Uses a dialog box to request and save an output file name
3.    Copies a string from a text box
4.    Opens the input file and output file
5.    Reads the input file and copies lines that do not include the saved string
6.    Closes both files when finished reading the input file
7.    Displays the message “Completed” in a message box 

This gave me exactly what I wanted. That’s not a surprise really. AI tends to be good at simple projects like this. The thing I realized is that the prompt worked well and I got the results I wanted because I knew what to ask. I easily broke the task down into specific steps and was explicit about what I wanted. Yea me.

After I got my file cleaned (the reason I started this) I went back to make the program more flexible. For example, what if I wanted to keep lines that included a specific string rather than skip it?

The AI in Visual Studio was very helpful here. Or rather it tried to be helpful. It suggested all sorts of code based on the assumptions it was making about my intent. It got things wrong as often as it got things correct. Maybe it would have done better if I gave it specific prompts but maybe it wouldn't. One thing is clear though. I knew enough code to know that it was wrong and how to fix it. Experience matters.

Coming back to my initial prompt. The AI did a very good job. It does everything I asked an more. All sorts of error checking (file exist?) and even asks if the user wants the comparison of stings to be case sensitive or not. As with the other prompt, the code is nicely commented. It created a console app which is not my favorite way to work but is the way many, perhaps most, student projects are created.

I can’t help but think about what all this means in the context of CS education.

Could students use these prompts to have AI write code for them? Absolutely. Would the results be obvious to someone grading the work that the code was not student written? Also, I think, pretty obviously. The comments alone would be a good clue. The error handling, something we tend not to cover very well because of time constraints would be an even stronger clue. Yes, I have had students add error handling but when they do it tends not to be unexpected. We’ve all had those students who do more. Often they have experience prior to coming to class.

So what is an educator to do? Ban the use of AI! Have you met today’s students? They are past masters of getting around the rules. I had students from China who laughed, literally laughed, at the attempts of a national government to limit what people do on the Internet.

I think we can ask students not to use AI to complete projects. Some will listen. Some will not. In either case, I think it is up to us to make the case that they need the experience of writing their own code. Every professional developer I talk to knows that their prior experience allows them to use AI more effectively.  The people making the most effective, productive results using AI have written code on their own.

Here is what I think is the most important skill in software development today. Being able to analyze a problem and break it down into its component pieces. Compare the two prompts I used above. Admittedly, this is a simple problem and it is easy to break down. Which one is easy to produce code for? Which one is more likely to solve the problem in a way that the user wants to operate?

If a student cannot break down a “toy” problem like those we  tend to assign in early courses how can they be expected to break down larger problems professionally? Or even non-professionally to solve problems in their career.

Circling back to the tweaks I made to AI generated code for a minute. Being able to read and understand code is key to understanding where code went wrong. AI tools have their own assumptions and they are not mind readers. Communication, between user and AI just like between people, requires some level of common understanding. Programming languages are the languages of computer science.

I am reminded of stories I have read about people with tattoos in languages they don’t understand later finding out that the tattoo doesn’t say what they wanted it to say. We had better keep current and fluent in computer languages unless we want computers to get totally out of control.

Wednesday, July 15, 2026

CSTA 2026 Day Three

Today's opening keynote was all about the new PK-12 Computer Science Education Standards. A lot of work went into these new standards. I really want to dig into them. I did download the PDF but I think it may be easier to use the website. The PDF is 218 dense pages. It sounds like most the curriculum vendors have been tracing the development of the standards so you can probably expect any third-party curriculum to be up to standard soon.

Before the keynote, one of the Impact Fellows spoke about excluding students for a number of reasons, behavior being one, by having CS as a reward and withholding it as a punishment. This is going to lose us a lot of potential.

My morning session was probably my favorite of the conference. It was titled “Physical Computing + AI Literacy = Physical AI with MakeCode” We were al give a micro:bit and charging station to use and keep. They we used the website createAI.microcode.org to program our micro:bits. First we trained the micro:bit to recognize specific movements. Next we programmed the micro:bit to do specific actions when it recognized the trained event.

The session was high energy, lots of fun, and highly informative. I think that sort of active would go over very well with a wide range of ages. There are lots of opportunities to learn about good and bad training data. With so much focus on LLMs I think some machine learning knowledge is very useful. Check out resources at microbit.org/createai 

After lunch I sat in on a couple of flash talks. One of them was particularly interesting. It was about a school that has created a pair of computational biology courses. It it co-taught by a biology teacher and a computer science teacher. It seems really exciting as they use create and use computer programs to analyze biological data like DNA. They are looking to develop more cross curricular courses with subjects like art, chemistry,, and physics. This is a great way to make computing relevant to more students while increasing their knowledge of both subjects.

Well, its been quite an interesting week. I’ll have some final wrap up thoughts tomorrow.

Sunday, June 21, 2026

My Favorite Software Development Role

I think it is fair to say that I have had an eclectic career in computing. I’ve worked for some of the largest computer companies in the world and I have spent a good bit of time in the classroom teaching. For about a fourteen of those years I had what I would call pure software development roles. Though I have written code for every job I have had for some jobs that was the main purpose of my work.

I spent some of my early career writing custom business software. Interesting, often fun, but it was a tough environment back in the 1970s. For about ten years I wrote and documented software used for testing large (think $10 million per system) computer systems. For about two years though I was part of an operating system development group.

Operating systems and the development of those systems was different in the 1980s than it is today. While I suspect that the Windows team has something like 1,000 people the RSTS/E development time was about 100 people. Windows has people whose job is to test software that other people write. Other people write original code while a different group fixes their bugs. I suspect that another group works on fixing bugs that customers report in released software. Maybe. Not sure. Back then members of an OS development group did it all.

While my main role was to write the user interface for a brand new, developed from scratch print and batch system I had other responsibilities. I had to look into bugs reported by customers for a number of different utilities. For example, if someone reported a bug in the backup utility or the login/logout utility I had to look into it and hopefully fix it. I was also responsible for making modifications to several utilities to support the major changes we were making to the OS. Oh, and I was the release engineer.

The release engineer was responsible for building the complete OS and packaging it for installation. I suspect that is a dedicated person (in not group) in most OS development groups today. As I said though, things were simpler back then.

Getting to my main role though. One of the things we were doing with this new version of the OS was to add layers of privileges. Previously, a user either had very limited privileges or unlimited privileges. That was increasingly seen as insecure and other operating systems had all sorts of privileges that could be set for different users. Pretty standard today but this was new for this OS.

This sort of thing has to be deep in the system. It complicates everything. So we were building a new system for printing files and running batch jobs (jobs that ran in the background without user interaction once started). My bit was the command line interface. The commands for starting, stopping, monitoring and generally anything the user was allowed to do. Oh,  and writing the help file as well.

The manager of the team was a great guy. One of the best managers I have ever had. One thing he insisted upon was that we completely design the system before we started coding. And design we did. We had all sorts of flow diagrams, data structure layouts, and lots of though being given to the security of the system. We spent longer on design than any other sub group. The overall manager started to get worried that we would not make our timeline.

Long story short, we did make out timeline. Not only that but for years after the product was released I tracked bugs reported on the OS and none were reported for our part of the system. I am convinced that the time we spent on design is why we both finished on time and without reported bugs.

The design helped me to build my test suite as well. As I said earlier, we did not have other people testing our code. Each developer was responsible for testing their own work. I know that there is a theory that people should not be responsible for testing their own code. Theory being that they will avoid, subconsciously if not consciously, testing things that are broken. I don’t buy it. I think that people who have pride in their work will want it to work and will test it thoroughly. I think that the developer also has a better idea of what code paths there are and that need testing. Unpopular opinion perhaps but I believe that trusting code testing to someone else leads to sloppy work. Especially if someone else is going to fix your mistakes.

This was my favorite development job for several reasons. One is that it was a great team with smart people who were always willing to help each other. Another was a good boss. A boss can make a job feel great or feel like punishment. They set the tone It was also very cool to be part of a major software project.

I had access to all the source code for the OS and that was an amazing learning experience. Yes, I know that source code is available for open source OS today but that wasn’t the case back then. Being a part of the design for a major new release, working with the key people, was a unique experience.. It was also a great job because I knew that hundreds of thousands, perhaps millions, of people were using software I wrote to get things done. It’s a great feeling.

I wrote a lot of code over the years and I am proud of much of it. But that time at RSTS/E is one of my fondest memories.

Tuesday, March 03, 2026

Computer Programming or Software Development

My friend Pat Yongpradit has a post on LinkedIn that got me thinking. It starts with a key statement “Computer programming (coding) is not equal to software development.” Now I tend to think of those as similar if not identical but Pat points out that “Computer programmers and software developers are codified differently in the BLS data” BLS is the US Bureau of Labor Statistics BTW.

Interesting. So what is the difference? Computer programmers write code. The BLS describes computer programmers:

Computer programmers write, modify, and test code and scripts that allow computer software and applications to function properly.

Software Developers do more. The BLS describes software developers as follows:

Research, design, and develop computer and network software or specialized utility programs. Analyze user needs and develop software solutions, applying principles and techniques of computer science, engineering, and mathematical analysis. Update software or enhance existing software capabilities. May work with computer hardware engineers to integrate hardware and software systems, and develop specifications and performance requirements. May maintain databases within an application area, working individually or coordinating database development as part of a team.

‘A lot more words in that second job description. The BLS projects growth in the need for software developers and a decline in the need for computer programmers. I’m not so optimistic. My read on many of the layoffs in tech companies appear to me to be more about declining numbers of software developers. I could be wrong and maybe there are/were a lot more people just doing computer programming than I think. The industry keeps changing.

In my very first software jobs, back in the late 1970s, I would characterize my work under the software development description. While I did do some programming from specifications and design documents written by others (computer programming) I rapidly moved into meeting with users, analyzing needs, and designing and developing software and utility programs. Job titles may have been different but that was the work.

What may happen is that software development involves less coding than it has in the past because of AI. At least coding by humans. So BLS is probably right about a decline in the need for computer programmers. At the same time, if software developers spend less time doing actual coding they may have more time for higher level (if that is the right term) thinking and involvement in design. Unless AI starts doing more of that. So maybe we will not need more of them. Or perhaps AI will make it possible for more people to be software developers who wouldn’t be that now. We’ll see I guess.

My undergraduate degree is in Systems. One of the goals of the program was to train people to interface between most people and computer systems. In other words, to understand the needs that people/businesses have and translate it into what computer programmers need to know to write software. For a long time, that sort of work involved two sides and sometimes three. That is to say, sometimes there was a user/client, and analyst, and a programmers. Sometimes the latter two roles were one person.

Knowing how to write code was always essential because code is the language of computer science. Not knowing how to code was seriously limiting for someone trying to design software. I think that is always going to be the case at some level. So I think software developers, even those who prompt AIs, will always need to know some coding. More than just coding though, I think that students, anyone who is going to interact with computers and that incudes, of course, software developers, needs to have a background in computer science.

Computer science is not just coding but having an understanding of how computers work. What is computer logic? What is computational anyway? AIs have a lot to learn and people with a computer science understanding are who AI is going to learn from. We need to think of K-12 computer science as computer science – foundational ideas and concepts – and not just a class in how to write code. We need to prepare people to be software developers not computer programmers.

Mike Zamansky has a couple of recent posts on why CS still matters in schools that I think are worth a read:

Interested in seeing what the BLS thinks of employment changes because of AI? Check out Incorporating AI impacts in BLS employment projections: occupational case studies

Monday, February 23, 2026

Who Is Driving Changes to Computer Science Education

There are a lot of Changes happening at code dot org The Slashdot article linked there lists several of them. While the changes include a number of people changes including President Cameron Wilson stepping aside, Chief Academic Officer Pat Yongpradit leaving to join Microsoft, and some staff layoffs the change in direction, to AI, may be the most concerning. From Hour of Code to Hour of AI? Some interesting comments follow that post.

The questions top of my mind are "who is driving the direction of CS education" and "is CS education moving in the right direction?" A lot of people believe that industry is pushing CS education in the direction of being vocational. The new focus on Artificial Intelligence often feels like a vocational direction.

My involvement with computer science education predates code.org and even CSTA so I have seen a lot of changes. In my first teaching days computer science teachers were pretty isolated. There was SIGCSE which accepted K12 teachers though welcomed sometimes felt like aspirational rather than actual. ACM, of which SIGCSE was and is still a part, was doing some support for CS education. Cameron Wilson was a huge part of that and worked policy.

CSTA was developed by some wonderful people in and around ACM. This started the real movement towards expanding K12 CS education. CSTA helped train and organize teachers to push for more more CS education. Code,org came a bit later and brought something new to the effort.

Code.org brought money and industrial production values. From the first set of videos that went viral to some very good curriculum resources as well as connections to industry and political leaders. Getting policymakers to push for CS education stepped up.

We’ve come a long way.

Coming back to my earlier questions. Is industry driving the directions that CS education is moving? A lot of people think they are. Industry has money and it has funded a lot of the work by code.org and CSTA. The modern Golden Rule is that the people with the gold make the rules after all.

Industry has some motivation here. I spent a few years working at Microsoft myself where my job was to promote the use of Microsoft tools for teaching. I didn’t get much in the direction of what to teach. I always felt that teachers should decide what to teach and I just wanted to help teachers find ways to use tools to teach those concepts. Teaching computer science as vocation was always there though. Senior mangers often told me that industry needed more people to know CS because there were jobs that needed to be filled.

CS as vocation has always been a selling point for CS education of course. It’s what helped sell school boards and other elected officials. Among teachers that was usually a secondary motivation. For a lot of teachers, including me over time, CS education became more about understanding how the world works. We don;t teach physics because we want to make more physicist. We teach it so that students understand the world around them.

People who are not working for tech companies often have to use computers and make decisions about computing. From spreadsheets to databases to internet searches. And now AI. People in all walks of life use computers. Understanding computer science can make those people more efficient. Computers are an important part of our world.

It seems like all the big tech companies are betting huge sums of money on AI. There is a lot of pressure to move the direction of CS education into AI. Is the industry push vocational in intent? Is is all about helping these companies to make money? CSTA and code.org are both pushing AI these days. Is this because of industry (gold making the rules?) or would it be happening independently?

That leads to the second question – are we moving in the right direction? I think that question may be different for K12 and for university. Personally, I still think CS education in K12 should be about understanding and not vocational. Someone else can address higher education but K12 should be about preparation for life and not for vocation at least in comprehensive schools.

So is AI the right direction? I think it is indisputable that AI is important to learn. Students should learn prompting and they should learn what AI can and cannot do, They should also learn how to think about what AI should not do. They need to know something about how AI works and that is core computer science.

I think that computer science, in the old analogy, is the dog and AI is the tail. The tail should not wag the dog. Making AI the focus at the expense of basic  computer science would be a huge mistake. We do have to teach the basics that make AI possible. Students need to understand where AI comes from and where it might go. Understanding code is an essential part of that understanding.  There is always going to be more to CS than just AI. We didn’t stop teaching arithmetic when calculators were invented. We should not assume that AI code writers mean we don’t have to stop teaching basic computer science.

CS in K12 should not be just vocational. Is industry driving CS education? I fear they may be. Are we moving in the wrong direction? Maybe. If so, it will be up to educators to provide some course correction. 

Wednesday, January 28, 2026

Are AI Code Assistants Getting Better or Worse

A friend of mine sent me a link to an opinion piece in the IEEE Spectrum - AI Coding Assistants Are Getting Worse –> Newer models are more prone to silent but deadly failure modes

Are AI code generators getting worse? The tl;dr  in this article is “Yes” because companies are letting poor programmers train the AI. You should read the article though.

It’s not deliberate of course. It’s just the way the internet works. AI software is not checking to see if the information it is getting is good in absolute terms. It is just checking to see if the user is happy. In the user is happy because they don’t realize that what they have is bad how is the AI to know?

The term GIGO - Garbage In, Garbage Out may not be repeated as often as it used to be but it is still true! We have to be careful about who and how artificial intelligence is trained. Do an internet search for “Chatbot goes bad” sometime and you’ll find a large number of cases where AI chatbots have been trained badly. Sometimes trained maliciously. Sometimes just trained on poor data sets.

TO me this trend points out a couple of things that we need to teach beginners. In the words of Ronald Regan, “Trust but verify.” Students need to test their code. Students need to be able to read and understand code. Programmers have to be able to determine if AI it taking shortcuts like leaving out error handling, data validation, and other errors of omission.

We also need to prepare students to think about how AIs are being trained so that they learn how to train AIs well themselves. Even if coding is dead, as one of my former students claims, people will still have to train AI, ask AI good questions, and be able to understand if they are getting the value from AI that they want, need, and think they are getting.

Monday, January 26, 2026

RotWords–String Manipulation Project

BlueSky is the microblogging site for me these days. That is where I am getting ideas and information about teaching computer science among other things. I recently saw the following message.

It’s an obvious possible coding project in my eyes.

  1. Read a word from a wordlist
  2. Remove the last letter and place in in the front of the word
  3. Determine if the new string matches an actual word.
  4. Display both old and new word, if found
  5. Repeat

It’s probably easy coded by an AI of course though I suspect students might come up with interesting implementations on their own as well.

As was pointed out in replies on BlueSky things get more interesting if they lead to a discussion about the nature of words. For example, a lot of words that end in “S” and plurals of words. Is there a way to strip plurals from a data set programmatically? (I’ve been thinking about that for my Wordle solver program as Wordle doesn’t use plurals.)

And what is the usefulness of word lists if they have words that are not really words? Or that are not in common use?

We don’t tend to talk about data integrity, data validity/validation, normalization of data, or any kind of data checking all in K-12 CS classes. We probably should discuss it though. A project like this might be useful in getting that conversation going. Just a thought.

Saturday, January 24, 2026

Dice As a Design Problem

The other day I ran into an interesting programming exercise on BlueSky.

The project description is at 2D Dice Grid Scoring Algorithm - 101 Computing It’s a cool project. I decided to code up a solution myself. Now there is sample starter code at that link in Python. I do my fun programming in C# so I started from scratch.

The first thing I had to do was to think about a Die class. I’ve written classes for dice projects many times before. It was a favorite item for me to use when teaching students about designing classes. Just about everyone is familiar with dice. I also brought in some samples to use as visual aids. I had some binary dice with only ones and zeros and some role playing dice in a variety of shapes and numbers of sides.

Students generally come up with the idea that they need to have a face value for the die. They generally also easily come up with the need to display that value and methods to change it to a random value. What they don’t always remember right away is that no all dice have six sides. Some dice have many more than six sides. Eventually they come up with two sided dice which we sometimes call coins.

I had a couple of example Die classes from other projects but I decided I wanted to be a bit more visual. So I created an object with the ability to display images. For this particular project I also added an extra method. I added a method to return if the face value was even – a Boolean value – true for even, false for odd. You know, just to make things interesting. Right now it is a method but I want to change it to a property to avoid unneeded parentheses.  I am not a fan of parentheses.

I did cheat a little. I had Copilot create some of the initial work on the code. Copilot, like my students, assumed a six sided die with values from one to six. I didn’t specify much so that’s understandable. It’s not really satisfying for me though so I will be putting some extra work into things to make the class more flexible. I will add constructors that let a program use different images and numbers of images. After all, just as not all die have six sides not all die have numbers or pips on them.

What would/do you add to die objects to make them more interesting or useful?

My project looks like this BTW.

Monday, January 19, 2026

Funding for CS Educational Tools

Mark Guzdial posted a link to an interview with Jens Mönig. Jens is the main person behind Snap! which developed out of Scratch (which Jens worked on). It’s a great interview and I recommend it. The story of Snap! is an interesting one. I think it is great that SAP is funding the team behind it. This blog post, which sort of rambles a bit (sorry) was inspired by that interview.

There are basically two and a half ways that software for teaching programming and computer science are funded. One is research funding. Usually by universities but sometimes by research groups that are part of major companies. The later is the half I refer to. The other is commercial products. I.e.. products that actually make money for companies.

The problem with commercial products is that they are really designed for professional software developers. That means a number of things that are great for professionals but harder for beginners. Complexity is one of those issues. Visual Studio, which I use for my own development and used for years in the classroom, using a number of different files for every project for example. That’s just the beginning. Development on professional tools adds features for professionals but often subtracts features that are helpful for beginners. I first ran into this when Visual Basic became Visual Basic .NET and arrays of controls when from intuitive to complex with extra code necessary.

Commercial software often has free versions which is the only way schools can generally afford to use them. Simple versions that work on a school’s limited resources tend to go away over time though. They don’t pay for themselves.

I have seen other cool tools from commercial tools, or tools commercial companies provided for free, disappear over the years. Corporate research projects generally last while the principle investigator remains interested and can keep getting funding. If the research doesn’t wind up in a commercial product that doesn’t help with funding.

App Inventor is an exception. Originally developed at Google, App Inventor had an academic sponsor (It resides at MIT these day) and Google provided some seed money to get the open source version started. It phased easily from corporate research to university research.

MakeCode (largely a Microsoft Research project)  is still going strong. It appears that industry/ academic cooperation is helping keep that going. That combination seems to be key in keeping some projects going.

University research projects tend to last longer than corporate research projects. As long as someone can get grants, usually tied to graduate students coming up with good research topics involving the tool, they keep going. I wonder how well some these will continue when the principle academics lose interest, retire, or pass away. Some projects have depth of involvement which is helpful.

 Alice out of Carnegie Mellon has been going strong for 30 years even though it’s originator, the great Randy Pausch passed away in 2008.  External funding, required for most academic tools has stayed strong for Alice. That takes a lot of work to maintain of course.

Most of the long lasting tools have some level of corporate sponsorship. Oracle helping with Greenfoot and BlueJ are other examples.  There used to be a lot of NSF (US National Science Foundation) money around. Somehow I suspect there is a lot less of it these days. It’s risky to depend on it as well given the rapidly shifting state of US Federal funding.

And then there is Artificial Intelligence to think about. That’s sort of the elephant in the living room these days. If funding agencies (government, non-profit, industry) decide that coding is dead because of AI what happens to funding for the tools educators are using today?

I don’t believe that coding is dead but I know that some people have decided that  it either is or soon will be. Computer science education is going through a change caused by the winds of AI. Industry seems to think that they don’t need inexperienced software developers. Development of developers has to start somewhere though. One can’t go from zero to experiences expert without starting somewhere.

I believe we need good teaching software. I hope we can keep seeing good things supported and developed in the future. We live in interesting times.

Note that Mike Zamansky wrote a riff on this post. Recommended at Funding for CS Educational tools - C’est la Z

Friday, January 09, 2026

Binary Math–Subtracting by Adding

Some of my readers who have been teaching Advanced Placement Computer Science (APCS) will remember the BigInt case study. It was a case study involving mathematics using large (very large) integers. As released by the College Board it supported adding, subtracting, and multiplying large integers. You will notice that division was not included. In fact, asking students to implement division was part of the exam.

BigInt introduced the idea that multiplication was actually multiple addition. By extension, students were to figure out that division is multiple subtraction.

Computer science really requires understanding how mathematics works at a deep level. It becomes obvious (one would hope) when trying to understand how Binary, Octal, and Hexadecimal work. We don’t often spend much if any time trying to understand subtraction though.

Recently, on BlueSky I can across a message by Andrew Virnuls linking to a blog post titled Two's Complement and Negative Binary Numbers that explains subtracting by adding negative numbers.

Let me draw the two previous notes in this post together with some history of mine. Back in my university days I worked on a course connecting some test hardware to a computer. The computer was a Digital Equipment PDP-8. Now the 8 was an interesting machine. It didn’t have a hard drive and it was programmed in assembly language entered in Binary. Where as most computers we use today use hexadecimal representation (base 16) the PDP-8 used Octal (base 8). The word size was 12 bits. Not 64, 32, or even 16 – 12.

This word size places some limits and one of those limits was the number of machine language/ Assembly language instructions. There was no multiply, divide or even subtraction instruction. We had to write code to do those things similar to how code was written in BigInt for those operations. We also had to write code to do subtraction. There was an instruction to create the two’s compliment of a number though. That was handy. So we wrote code to find and use the two’s compliment of a number in order to do subtraction.

We used the subtraction routine to implement division. Though to be honest, we tried to avoid having to do multiplication or division in our project to keep performance reasonable.

I think we’re all glad that today’s computers have a lot more layers of abstraction than the PDP-8 had! Of course, and a lot of students do not realize this, most powerful assembly language instructions are actually the result of what is called microcode that works transparently behind the scenes.

We keep moving up the path of abstraction. Hal Berenson addressed this recently in a post called 98% of Developers can’t program a computer which is actually a bit of a success story including how artificial intelligence is helping with higher levels of abstraction.

Saturday, December 27, 2025

AI Written Code and Making Assumptions

I’ve been writing some code for my own amusement the last few days. I have happily using Microsoft CoPilot to help me out. One really has to be careful with prompts though. CoPilot loves to make assumptions about what the developer desires. Often, it assumes correctly. Often enough, it assumes incorrectly.

I spent a good bit of time trying to figure how where it was doing some things I didn’t want done at all and other places where it got my intentions backwards. For example, we both had different ideas about what a variable called _defaultColor should refer to. That took me a bit.

I could have tried to ask CoPilot to fix the problem for me but if I had a better idea of how to express what I wanted it would probably have gotten things right, for my definition of right, the first time. So I fixed it myself.

I also made some assumptions about what certain methods were doing. I mostly assumed correctly but mostly is not really good enough when dealing with code. I really should have spent more time reading the code and making sure I understood it before trying to modify it. Yes, I said it before knowing how to read code is more important than ever.

Reading code on a screen can be painful though. One tends to get a sort of tunnel vision looking at little bits of code at a time. Many years ago I worked with a developer who had a terminal that was originally developed to typesetting at newspapers. It was tall and could hold a lot of lines of code. It was great for reading code. I don’t have anything like that. For me, the answer is printing listings out on paper. Maybe its just me but that is what has worked well for me for over 50 years of writing code.

I have more modifications I want to make to my program. I’ll spend some serious time reviewing the generated code before I try to make those modifications.

Related read: "Source code is the literature of computer scientists." https://www.cs.uni.edu/~wallingf/blog/archives/monthly/2025-12.html#e2025-12-26T18_28_37.htm A post by Eugene Wallingford

One other note, CoPilot added a lot of helpful error handling code to what I asked. That’s awesome in a lot of ways. I think that spotting a lot of error handling code may be something that tips off an educator that a student used artificial intelligence to write their code. Keep a look out and be sure to ask the student to explain it all.

Monday, December 08, 2025

How Much Debugging Knowledge Do CS Teachers Need

Mark Guzdial's blog is number one on my “must read” blog list. If you are a computer science educator it should be on your list as well. Mark had another particularly interesting post recently.

Dr. Tamara Nelson-Fromm defends her dissertation: What Debugging Looks like in Alternative Endpoints | Computing Ed Research - Guzdial's Take

In it, Mark talks about some of the work by his student, Tamara Nelson-Fromm. interesting stuff and I hope to read her papers when they come out next year. One question from Mark’s post really hit me:

“[W]hat does a K-12 teacher need to know about debugging?”

A partial answer given is “maybe it’s enough to just have checklists.” of things to check. Now “maybe” is a big word. I wonder how far it goes? That is to say, how often is a checklist enough? What happens when it isn’t enough?

I’m reminded of Kernighan's Law:

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it?

Students write code that is as clever as they know how. If a teacher is more experienced and more knowledgeable than their students they maybe able to handle any problems the students have. The word “maybe” comes to play again. Over the years I have had a number of teachers approach me with a student program they could not debug. I’ve had to get help myself from time to time. Debugging is hard.

[As an aside, I love debugging code. It may be more fun for me than writing original code. I may also be weird.]

Experience helps of course. I have debugged student code without looking at the code. Lots of teachers have done the same. We do see a lot of students making the same errors year after year. Students are good at coming up with unique bugs though. They’re clever that way. (See Kernighan's Law) That’s where checklists are likely to come up short.

Why is this a problem? After all, students do, generally, fix the problem. Sometimes on their own and sometimes with help. For different definitions of “fix the problem” of course. There are always workarounds. That is especially true of the type of projects assigned to beginners.

My concerns start frustration levels. The cognitive load of learning to program is high already. Spending a lot of time on a bug can be very frustrating and that can be a turnoff for students. A demotivator. Worse, if the teacher can’t solve the problem what chance does the student have? Maybe programming is too hard!

Circling back to the teacher, if they don’t have a good plan for debugging than they are not likely to be able to teach students how to debug. Sure they can share checklists and that’s not a bad thing. Like most things, students will learn more by watching a teacher model debugging than from reading about it.

Now when we are teaching, most of us try to avoid making mistakes or creating code with bugs. Generally, we practice demos multiple times to make sure we can demo the code error free. Yay us, looking like we are amazing. The occasional error, planned or otherwise, is a teaching opportunity that should be welcomed however!

Circling back to the question asked earlier, how much should a k-12 CS teacher know about debugging? It’s hard to come up with a definitive answer. Probably more than is covered in most professional development though. Arguably, it should start with technical knowledge a good bit beyond staying a chapter ahead of the students. So more than a lot of teachers who have been voluntold to teach computer science have.

They should also have some solid experience reading code. Now a few years of teaching will give you some good experience reading code. It will give one a lot of experience seeing errors as well. That’s not much help for a beginner teacher though.

I’m not sure what the answer is and finding time in the already far to limited time for training that new teachers have now is a struggle as well. I am uncomfortable with the idea that “it’s enough to just have checklists.” though.

Saturday, November 29, 2025

Teaching Reading Code–More Important Than Ever

Thanks to Facebook memories and a link that was almost a dead link I reread a post on my old blog – How To Read Code. It got me thinking about Artificial intelligence writing code. What? Let me explain.

If students are going to use AI to write code they are going to have to know how to read and understand it. There are several reasons for this. One is that AI almost never write 100% of the code necessary for a project. Without being able to read and understand the generated code students will be unlikely to be able to take the project to the finish.

Reading code for understanding can also be helpful to learning more about computer science. Not just coding but computer science. Code is the language of CS but there is a lot more to understanding computer science than just writing code.

AI systems have been trained on a wide variety of code samples from a wide variety of developers with a wide variety of coding styles. That means that students reading AI generated code, potentially, have exposure to more styles and techniques than their instructors are likely to show them.

Having students read explain the code they read can be a powerful tool for their learning and for teachers to use for evaluation. Keeping students from asking the AI to write the explanation is probably a good idea though.

All of this makes me think about code reviews (Archived blog post on that - The Art of the Code Review)  Organizing code reviews may also be a good teaching tool. Reviewing student code, AI generated code, or perhaps publicly available code examples on the internet. If AI can train on other people’s code why not students?

I am wondering what having an AI explain student code would look like. Would it help students understand their own code better? It might. I have seen a lot of students tossing different code snippets into a project hoping it would work but not really understanding what the code was doing. Would it also help them understand the process of reading code? Interesting idea I think.

Wednesday, November 26, 2025

Monty Hall Problem and the Problem of Artificial Intelligence

I’m always looking for interesting projects. The other day I ran into the story of the Monty Hall Problem. The brief version of this logic/probability problem is based on a famous game show. In the hypothetical, a player is trying to win a car. Behind two doors are goats with a car behind the third. The player picks one of the doors. Before opening the door the show host opens a door, a different door, and shows that there is a goat behind it.

The player is then given a choice – stay with their first guess or switch to the different door. What’s the best option? The answer from Marilyn vos Savant who has the highest recorded IQ was that the player should change their guess.

This answer was highly controversial with many experts in probability and math saying she was wrong. Computer simulations showed that she was right though. There is an explanation for this in the Wikipedia article linked to at the top of this post.

If you know me at all, you can probably guess that I had to write a simulation myself. Trust but verify! I think it makes a good project to assign students as well.

There is a little fly in the ointment for me though. I crated a project with the name “Monty Hall” and with almost no other hint than that and Copilot in Visual Studio started writing code for the simulation!  Well, that was a surprise.  I have mixed feelings about the help. It made writing the simulation easier for me but it kind of took some of the fun away from it as well.

Copilot’s code assumed form objects that I had not created as well. It didn’t create those objects automatically. Fortunately for me, I know enough about Visual Studio and Windows Forms that I could add them easily enough. I am also experienced enough that I added other code and objects to make the project more me.

Also, as an experienced programmer, I was able to easily understand the generated code. The code generated is a little different than what I would have generated. Better? Worse? Really, just different. No big deal for an experienced programmer.

What about students? As teachers, we probably don’t want students having AI write 90% of their code for them. Copilot can be turned off and doing so is a very good idea in classroom and school lab situations.

Will students understand the generated code? In many cases, probably not. In this case, the generated code used the the ternary conditional operator. This is a perfectly valid operator in C#, Java, C++, and several other languages. It’s not often taught to beginners however. It also used a break statement which a lot of software purists do not approve of and strongly teach against.

So determining if a student used AI to write their code may, in some cases, be easy to determine. Not something you want to bet on though.

Circling back to the assumptions that Copilot makes – like objects and variables not defined automatically – students may struggle with adding the missing pieces. I would expect that in some cases trying to add what AI leaves out may be more problematic than writing code on ones own. Frustration is a common problem for students already. Artificial Intelligence may, in some cases, exacerbate the problem.

As I have noted in several blog posts, AI often creates solutions different from how I would code them. That has been a learning experience for me. I love seeing different solutions, different language features, or features used differently.

It is potentially a learning experience for students as well. My concern is that without a solid knowledge base will students be able to really understand and learn from AI generated code? Some will. Many will not.

We’re all trying to figure out what artificial intelligence means for software development and especially for teaching software development. It’s going to be a wild ride for a while.

Monday, November 03, 2025

Flag on the Play AI Let Me Down

My latest coding involves an attempt to memorize nautical signal flags. I’ve played with this idea in the past but never had the time to really dig into it. I’ve had images of the flags for years. I’d even started created a class to hold the data.

Image _flag;
String _mnemonic;
String _shortName;
String _morseCode;

Yes, at some point I want to learn Morse Code as well. Always plan for additions. Semaphore is in my thinking as well.

Once again, Copilot, the AI in Visual Studio, has jumped in to help. Or to try to help. It was pretty helpful with some tedious coding. Specifically, with a couple of lines entered it figured out how I wanted to add images and what not to the individual flag objects I wanted to create. Hitting tab and return was pretty easy compared to typing whole lines in.

A = new Flag(Flag_Host.Resource1.alpha, "Alpha", "A", ".-");

I had already added the image files to the project of course. Copilot was not always so helpful though. I created a couple of additional forms for the project and wanted to pass the array for flags objects to the new forms. Copilot struggled to code that properly and there were several false starts.  I used to do that sort of thing regularly but it’s been a few years. I guess my memory isn’t what it used to be. I finally figured it out. Honestly, this should have been easy for Copilot and for me.

I have heard from a number of teachers about how Copilot is showing up in their classes. One teacher uses MonoGame and tells me that Copilot is so unreliable with MonoGame that his students turn it off. My suspicion is that there is not enough good MonoGame code loose on the internet to properly train Copilot.

That leads to a major concern I have about using AI for coding. It’s usability and reliability depends on the quality and quantity of the code used to train it. Programmers love to reinvent the wheel so there is a lot of code available for doing common things in coding. I would expect AI to handle most common data structures pretty well. Some things that are not as common may not have as much code to study. I wonder how well AI will handle new programming languages?

I also wonder how well AI will handle new and unique problems. Will the AI be dependent on very detailed prompts from user developers? I think that is likely. I also think that some person is going to have to do a lot of verification of said code. We are still going to need people who can read and write code.

In a related note, several times while writing this post, I have dipped into raw HTML because I didn’t like how the program I use, Windows Live Writer, was formatting the text.

Friday, October 31, 2025

Unexpected Help With Coding Projects

Fair warning, this is a post in two parts. First a project idea and second musings on the tools I used to create it.

I really do like to write code for fun. Nothing complicated (been there, done that, got the T-shirt - literally) but just little things to "scratch an itch" as they say.

Lately as I played Wordle I was wondering which letters appeared most in each place in the five letter words in my word list. A couple of nights ago, I wrote some code to find out. I had my code output a comma delimited file so I could use Excel to look at the results. That’s what the image to the side shows.

Now this sort of thing is highly dependent on the word list of course. But for my list, S is the most common letter in the first and fifth location. Not surprising as S is used to make plurals. Wordle doesn’t use plurals so I note that the second most common fifth letter is E with Y a close second.

The letter A is the most common second and third letter. The letter E is the most common fourth letter.

If I were ambitious, I could probably use this information to make a smarter Wordle solver. I’m not quite that ambitious though. I am toying with gathering some other statistics though.

I develop using Visual Studio – the full blown version. That means that Copilot jumps in to help. That’s not something I anticipated when I started but I confess that I found it surprisingly helpful. I did specifically ask Copilot to write one specific method – generate a string array of two character combinations – but it jumped in on its own with a couple of small bits of code. I was surprised at how well it anticipated what I wanted.

The implications for teaching programming are something to think about. On one hand it’s scary that AI tools can so easily write coding solutions to simple programming assignments. That turns our process of evaluating learning on its head a bit. At the same time, I am not ready to blindly trust AI generated code. I do not want students to blindly trust it either. So asking students to test generated code seems like a reasonable thing to assign. Yes, I suppose some students will ask AI to generate test cases but if we can’t trust AI to write the code in the first place we can’t trust the generated test cases.

We could ask students to explain the test and related tests. Could be quite a recursive rat hole.

We can also ask students to explain the generated code. We should probably ask them to do that either verbally or by writing manual in class so they can’t ask AI to do it for them.

What I keep coming back to in my own thinking is a focus on abstraction and top down design. Can we ask students to break the problem down to component parts and have them prompt the AI to implement various methods and code pieces. A focus on design rather than writing code. We could have students submit the design document and the various prompts that they use. Add to that some serious examination of testing and verification.

Students are going to have to work with artificial intelligence. They can’t let it do all the work for them because AI is not I enough yet. I don’t think it ever will be either.

Sunday, October 26, 2025

User Interfaces and Microwaves and Artificial Intelligence

It seems like just about everything has a user interface these days. It is sometimes hard for me to question them. What sort of decisions go into their design? Microwaves are one such thing that I keep thinking about. My current microwave defaults to pushing a number button running that many minutes. That’s great when you want it to run in whole numbers of minutes. What about fractions of minutes?

For fractions of minutes there is a button that is pressed first to let the microwave know you want to enter the number of seconds. So far so good. It can get complicated though if you don’t have the default whole minutes option.

My previous microwave did not default to whole minutes. If you enter 100 is that one hundred seconds or 100% of a minute? i.e 60 seconds? How is the decision made on something like that? What is intuitive to the user? Actually, I don’t know what my current microwave would do if I asked to seconds and entered 100. I think it would do 100 seconds as 90 does run for a minute and a half. I should try it I suppose.

It’s a computer related question of course because there is a little microprocessor in there somewhere and someone has had to program answers to these questions. I wonder how artificial intelligence would make UI decisions about things like this. It largely depends on the instructions or prompts given to the AI. People are going to have to have some input there. Right?

Will AIs have access to research on things like that? Will they be able to design and run human factors research? Will they think research is necessary or even desirable or just assume they know what is best for us?

Thursday, September 04, 2025

An Interesting School Year in Computer Science Education

Mike Zamansky is Looking at the start of school for 2025 on his blog C’est la Z He’s thinking about phone bans and AI in schools. I have been thinking about both of those as well. I spent some time recently with the teacher who is now teaching in my old computer lab. He’s also a former student of mine. We had a great conversation.

We talked a little about the cell phone ban in schools that was passed into law in New Hampshire among other places over the summer. It is not clear how it will be enforced and what sorts of consequences will be in place for violations.  For a while, I taught with AppInventor which meant that phones were an active and essential part of the class. I wonder what these bans will mean for all the many teachers and students using AppInventor and similar tools.

Phones were a distraction but teaching in a computer lab with computers in front of every students means the Internet is still going to be a distraction. Classroom management is hard enough without computers and cell phones.

Artificial Intelligence is going to be even more interesting this year. How much to allow? How to check for its use? What to teach about it? All interesting questions that teachers and schools will struggle with this year.

My son, a school administrator, find AI tools very useful. So do many others both in and out of education. Clearly, students need to be taught about AI. That debate is, I hope, over, What and how to teach it are still largely to be determined.

Students are going to use AI to write code for them. It would be foolish to deny that. They still need to understand the code that AI is writing for them. Talking to my teacher friend I used the example of HTML. I write these blog posts using Open Live Writer which builds the HTML that gets posted. It does a great job but I still find myself jumping into the HTML to do some fine toning. In this post, for example. I went into HTML to edit the text for the link to Mike’s blog. A small example but knowing what to do saved me a small amount of time.

To be honest though, students using AI to write their code is not my most serious concern. Ethical concerns around AI use is my biggest concern. There are all sorts of issues around copyright for example. The use of books and art to train AIs to create without giving credit to original creators is an important discussion topic. Taking credit for AI output is another. I want students to think about these sorts of things. There is a lot more and more issues will be showing up.The old question is not so much what can we do but what should be do.

So, yes, we want to teach students how to prompt AI. We want them to be able to evaluate to AI product as well. There is a real risk of AI having a negative effect on people actually thinking. Teachers need to find ways to encourage students to think about what AI is, how it can be used, and most importantly how it should be used.

This year is going to be an important one in the future of AI in education.

Thursday, August 14, 2025

Reading Code For Fun and Learning

For some time I have been writing up information about some historic, and simple compared to modern, cryptonymic algorithms. They are collected in book form (a PDF actually – new release coming soon) that I have made available on my website. One algorithm that I have struggled with has been the Playfair Cipher. I don’t know why but for some reason I’ve had trouble with the algorithm. Mostly, I have struggled with how to code it up. Recently, I decided that I should work on that.

First step was to use something called Notebook LM. More on that in a future post. It’s pretty amazing. In any case, that tool helped me find a coded implementation of the Playfair Cipher. Great! Maybe I can learn from that. It turns out that I can.

The code was in Python and I am not very experienced with Python. Still with well over a dozen languages under my belt, figuring out the code was not hard. After reading the code I feel like I have a better handle on things.

I also learned more than I expected about how Python does things. So double the win. I do believe that reading code is a great way to better understand a programming language. It’s especially valuable if it helps you learn the idiom of the language.

So I now had a console application that worked and that I could play with. Now to me, a console application is so late 20th century that my next step was to convert to C# so I could use Windows Forms. Since I was already using “artificial intelligence” (that’s in quotes because I don’t completely buy that these tools are actually intelligent.) I asked Copilot to convert the Python code into C#. It did so quickly and easily. It wasn’t the way I am used to doing things though. Maybe that is why I was struggling with my own code? It’s a possibility.

The old joke is/was that a good FORTRAN programmer can write a good FORTRAN program in any programming language. Apparently, Copilot can write a good Python program in C#. Yes, the code looked a lot more like the Python code than I had expected. More than I really wanted as well. But along the way I learned that C# could do some things in some ways that I didn’t realize. There have been a lot of changes and updates in the language and I have clearly not kept up with all of them. Well, more learning is a good thing I guess.

Once I had the converted code I built a nice Windows application and have had some fun with it.

I am toying with messing with the C# code to make it look more like what I am comfortable with but that may not be the best use of my time. I might be better off experimenting with the new (to me) features of the language. Either way, learning is a good thing.

Monday, June 30, 2025

Teaching Computer Science in the Age of Artificial Intelligence

An interesting article was posted on Facebook recently. (https://archive.ph/Jwd7m) Carnegie Mellon is spending some time over the summer rethinking how, and probably what, is taught about computer science. It’s an important topic.

A lot of people seem to think that the need for teaching computer science, or at least, programming is past. I’m not so sure. Yes, the job market for software developers seems to be in a steep decline but I wonder if that will last. Is it a reverse bubble that will pop at some point? Maybe. A lot of people use computers and even write code, even if they don’t think of it as coding. So we still need to teach computer science but we probably also need to think more about what and how we teach.

I do think that some basic programming knowledge is still needed. People have to be able to read code at some level. But learning how to deal with abstraction and how to break problems down to manageable pieces is going to need more attention than we have traditionally give it in K-12. Oh, we pay lots of lip service to it but we have students spend most, if not all, of their time on projects that don't require as much of breaking down into pieces and building blocks as students need. We assign projects that could be prompts to an AI and act surprised when students feed them to an AI.

Ultimately, we have to change the way we teach. I've been thinking about things like assigning different routines to different students where the routines have to fit together to create a larger program. Students would have to do some work to make sure that interfaces worked to communicate properly with other routines. Maybe that would help.

I agree that we need to teach something about artificial intelligence of course. We need to teach prompting, the ethical use of AI as well and the ethics of training AIs. Part of that education needs to include testing and verification of what AI produces. A lot of what we are getting from AI is worse than useless. Students been to learn about limits and verification. Blindly trusting AI leads to bad things.

Regardless, we have to do a lot of rethinking. Kudos to CMU for seeing that and doing something about it.