Tuesday, February 18, 2020

Working Through the Stages of Debugging

I found this Tweet by Katerina Borodina @ctrlshifti that claimed that the 5 stages of grief apply perfectly to debugging code

  1. Denial "The compiler is wrong" 
  2. Anger "Why the hell isn't it working?"
  3. Bargaining "If I use enough print statements I'll figure this out"
  4. Depression "I will never fix this bug"
  5. Acceptance "It's a feature"

We see students going through these stages al the time. Well, actually what we often see is them not making it all the way through. As teachers we need to help them through. Learning to deal with debugging is an important, if under acknowledged, part of the job.

Denial is where many students start to ask for help. After all if the compiler is wrong there is nothing they can do to fix it is there? Sometimes this is expressed as “my code is the same as [yours/theirs] but mine doesn’t work.” Of course the code is never the same but the student is not looking closely enough. At this point a teacher has to decide if they should point out the error or ask the student to keep looking. Or ask them to have another student look at it. We need to find that balance between promoting self sufficiency and letting frustration build up to far.

If we’re lucky they move on to anger. Yes, anger is not always bad. It can be motivating. We do have to keep an eye on it though and at some point help with some debugging suggestions so that they keep trying.

Bargaining is when a lot of learning goes on. We can show them how to use breakpoints in the IDE, make suggestions at where to look, and so on. Bargaining in this case is where the real effort comes into play.

Depression is where I think a teacher really needs to step in. In fact this is the point where I think automatized hint systems will never replace teachers. Students need encouragement. They need to know that they are not stupid and that many others have the same issues. They need to know that they just need practice and perhaps a bit more knowledge. And they need to know that they are not alone.

Deciding that it is a feature may, in rare occasions, be acceptable though it really is more of a standing joke than reality. I see acceptance as understanding that sometimes we all need help and that is ok. Helping students accept that programming can be a “team sport” is an important lesson. Getting the bug fixed is very satisfying. That leads to self acceptance which is where we really want our students to get.

Tuesday, February 11, 2020

Are Large Classes The Answer To a Computer Science Teacher Shortage?

Another teacher reported on Facebook that they were going teach AP CS Principles and that this was the first time they are teaching computer science and their students have no earlier CS class. I wanted to scream. Or cry. Or something. It’s happening a lot these days as we, those of us in the CS for All camp, continue to promote the need for more CS in schools. The shortage of qualified teachers in computer science is real. Catching up with demand is going to take a while.

But, hey, universities are running into the same problem. Can we learn from them? So far most universities seem to be coping by creating larger and larger classes. Listen (or read the transcripts) from interviews on the CS Ed Podcast (highly recommended) and learn about university CS classes with hundreds and even thousands of students. Whoa! And you thought 35 was bad.

Now my first hand experience with large classes is 48 years old when I took a one month intense world history course as an undergraduate. I credit reading the 1,200 page textbook twice with my A more than the lectures. While that seemed to work for me it was history and not computer science. I don’t think it would work for CS.

Now I believe that there are TAs and lab assistants who help university students outside of class but is this really a good way to teach computer science? I’m not so sure it is but even if it does work in university would it work in high school or middle school? I really doubt that. Our students are not quite that mature. And we’ll never get TAs and out of class lab time.

Amy Ko, University of Washington, expresses some concern about this scaling at the university level in a post called The false dichotomy of teaching and research. University administrators are interested in reducing costs and increasing tuition revenue so they probably like the large classes. And MOOCs.

I wonder what the difference is between a class of 2,000 students in a huge lecture hall is from a MOOC with 2,000 online students? I suspect not much beyond, perhaps, lab assistants and TAs in a campus computer lab. Seems like a lot of extra internal motivation is required in either case. I see a shortage of that in high school students especially in non-major courses.

So tl;dr I don’t think large classes or MOOCs are the answer. We really need to be preparing more teachers. And there are no shortcuts.

Tuesday, February 04, 2020

Iowa Caucus 2020–What Happens When Software Doesn’t Work?

It’s too early to tell exactly what went wrong with the Iowa caucus this year but I suspect it will wind up being a case study in several ways. Political Science will look at it for sure. So, I believe, will computer science and software engineering people. We’re hearing complaints that the app, used for collecting the results, didn’t work. As is often the case early on we don’t know exactly what “doesn’t work” means or where the fault lies.

The Iowa Democratic Committee made the counting more complicated for one thing. That may have driven the need or assumption of need for an app. Was that complexity part of the problem? It could be. If the app wasn’t intuitive (cue to HCI people) or the users were not trained well enough than complexity could be a problem.

Was the app itself faulty? Were the communications protocols not robust enough?  Was it the servers on the backend? Little about that is public yet. I guess we’ll find out eventually.

Eventually there will be results as there is a paper trail for all of the voting. Or so we are told. The biggest problem long term is trust. Trust in the Iowa Democrats to run a solid caucus process. Trust in the company who wrote the app to do a good job. And maybe even damage to trust in apps for reporting election results as a concept.

While some are content to make fun of the Iowa Democrats others are crying about conspiracy and about manipulating the vote. The political science people will have a field day with that I suspect. I tend to suspect incompetency over malice. Malice is hard to do in secret.

For us teaching computer science I think the lesson we need to take and to share is that there are big stakes in developing software. The consequences of the software working correctly are big but the consequences of the software not working can be even bigger. And harder to predict.

Monday, February 03, 2020

Check Out The CS Ed Podcast

I first heard about the CS Ed Podcast back when I wrote on debugging. Amy Ko of the university of Washington talked about teaching debugging in a recent interview. I listened to that interview, which I recommend, but did not take the time to dig into previous podcasts. Earlier today I read a post by Mark Guzdial which brought this resource back to my attention.

Welcome to The CS-Ed podcast, hosted by Dr. Kristin Stephens-Martinez at Duke University. This is a podcast where we talk about teaching computer science, with computer science educators, to learn how they teach and manage their classrooms. Find all of our episodes here, along with transcripts and helpful links!

So far there are four podcasts

I haven't been through all of these yet. So far just the Amy Ko and Dan Garcia ones. I read the transcripts for the most part and really appreciate that I can choose between reading and listening. Those of you who listen to podcasts may have a different preference. But I agree with Mark Guzdial's recommendation that these are valuable resources for anyone teaching computer science.

Friday, January 24, 2020

The System Knows Who You Are

True confession – give me an app that plays with interesting and personal data and I’ll play for a while. The amount of data available to us today is astounding and computer programming lets us do some really amazing things. Big data is all the rage. The US Social Security Administration has lots of data and it’s all more or less personal. So I guess is it not surprising that people do interesting things with it. For example, Guessing Names Based on What They Start With

It had some trouble with my name because even in the decade I was born in my name was not that common. As I added letters it was able to get it – not that surprising. Although for the decade my grandson was born it never did get it – Alfredo is a lot more common than Alfred. A sign of changing demographics which makes for an interesting topic of its own.

I’ve toyed with the idea of making this into a project for my students but I’m not sure I have the time. Basically because I would probably want to aggregate the raw data myself first and while I could write some code to do that I am not sure I want to. It still makes an interesting demo and I will probably use it that way when we talk about big data in my AP CS It’s a good example of how a system can make some assumptions based on limited information.

We like to think that we are pretty unique and in fact we really are. The fact that this name app can identify us is not really contrary to that. Yes, we have similarities with many people but we also have differences. This app made me think of an app I had students program a couple of times that uses demographic information from the school’s student information system (anonymized). I wrote about that a couple of years ago at Programming Projects Should Be Personal

That project took sex, birthday and zip code information to report on how many individuals in the school had that birthday and lived in that zip code? Could we combine the age guess and the name guess code to identify which student we were looking at? Maybe. Is that good or bad? Maybe. I can see this being a good discussion topic.

Increasingly companies collect more and more personal data about us. And they share this data with other companies. These app give a clue as to how identifiable we are even when we think we are not identifiable. It’s only going to get – is it getting better or worse? A lot depends on how it is used. Students need to understand the possibilities if they are going to understand the world around them. Let’s talk about it with them.

Thursday, January 23, 2020

Should We Use the Technology in the Classroom?

I confess that I would love some augmented reality device that showed me the name of the student I was looking at. I am horrible with names. I like to think that something like this would help me a) learn student names faster and b) establish better connections earlier. On the other hand there is some technology that I worry would hurt relationships more than help them.

For example, an AI and cameras that would tell a teacher who was and was not paying attention. Are Your Students Bored? This AI Could Tell You I can see where having an indication of where you start losing student attention could be helpful. On the other hand, maybe as a teacher I should be paying attention to the people in front of me. That is not impossible in a small classroom like a normal high school room. Maybe it is a lot in a large lecture room but that is an example of not building connections in the first place.

Or tracking students using their phones? Colleges are turning students’ phones into surveillance machines, tracking the locations of hundreds of thousands Sure I hate taking attendance and having the computer do it is tempting. Is that really the sort of intrusion that we want to get students used to though? I’m not so sure it is.

As with so much of technology, the question is one of balance. Do the down sides overshadow the up sides or not? This is not an easy question and I think wide open to debate. As technology grows our students are going to have to decide more of them as time goes along. The question is not “can we do it” but “should we do it?” Making those decisions requires understanding of the technology for sure. It also requires a solid ethical foundation and a willingness to question and discuss. Are these “soft skills?” Perhaps but they are becoming more essential rather than less.

Wednesday, January 22, 2020

Thinking and Teaching about Technology Policy Issues

What are the top technology issues for the 2020s? Brad Smith, Microsoft President, wrote an interesting post about a month ago called Dawn of a Decade: The Top Ten Tech Policy Issues for the 2020s

His list is:

  1. Sustainability - Tech’s role in the race to address climate change

  2. Defending Democracy - International threats and internal challenges

  3. Journalism - Technology needs to give the news business a boost

  4. Privacy in an AI Era - From the second wave to the third

  5. Data and National Sovereignty - Economics meet geopolitics

  6. Digital Safety - The need to constantly battle evolving threats

  7. Internet Inequality - A world of haves and have-nots

  8. A Tech Cold War - Will we see a digital iron curtain down the Pacific?

  9. Ethics for Artificial Intelligence - Humanity needs to govern machines

  10. Jobs and Income Inequality in an AI Economy - How will the world manage a disruptive decade?

I see a lot to agree with and a lot that requires some serious and deep thought. I wonder, for example,  how to square the concerns in 2, 4,8, and 9 with Microsoft’s businesses in China. It’s a topic well worth discussing.

OF course any of these issues, alone or in conjunction with others, are great topics for discussion in a class. Artificial Intelligence factors in with many, maybe most, of these issues. Are we preparing students for thinking about the reality of a world with AI is a major force in technology and eventually our daily lives?

Any way, I recommend the post.  It is long but worth the read. Maybe read it more than once. I plan to.

Monday, January 13, 2020

Having Fun With Computer Science

There is no question that there are a lot of ways to have fun with computer science. Some of them are inexpensive. Some of them cost a lot of money. You can do a lot for a little bit of money. But some interesting things cost more money for computer hardware (especially graphics cards and CPUs), for special software (not everyone offers free versions for schools) or special hardware (A Micro:Bit is pretty inexpensive but an Oculus Quest is serious money).

So what is a teacher to do? Well, there are grants out these. Often very competitive though. There is Donors Choose which is not an option if you are at a private school with a budget that makes public schools look rich. There is teacher spending their own money. Or there is just offering what your school can afford even is that is old hardware and free software.

Now you can do a lot on the cheap. No question. But what I wonder about, as with many things CS education related, is access. Who gets access to the state of the art, bleeding edge stuff and who gets to see “where we were 10 years ago?”

Who gets to program virtual reality stuff and who gets to program the next Pong? When we look at costs for computer science we tend to think mostly about teacher costs or finding room in the building or the schedule. Computers come next but someone who spends their who life on their phone or a web browser may not appreciate why students need a computer with a lot of memory, a fast CPU, and a late model graphics card. Maybe when today’s students become school administrators or school board members that will change but right now getting more money for hardware can be a tough sell.

We’re used to vocational students needing state of the art resources. Computers for reading diagnostics for the automotive students. The latest silkscreen equipment for the graphic artists. The latest medical learning tools (have you see the CPR training dummies lately?) for the medical prep students. But somehow we don’t always see the need for the latest for computer science students. Especially in comprehensive high schools. Some serious CS students might be better off in a career/technical high school for CS. Seriously, some of them are really good at getting the latest stuff for learning CS.

Which brings me back to access. CS is more than vocational. A lot more. How do we show students the real potential if they only have access to what is cheap?

Note: This post inspired in part by Garth Flint’s blog post (Computer Science on the Cheap does not always work), a comment on that post, and things David Renton is doing with his students and Virtual Reality.

Friday, January 10, 2020

How Do Teachers Without CS Experience Debug Student Code

My Programming Honors students are wrapping up their semester projects today. Actually they should all have been handed in by now but I’ll give them until the end of the day. In any case, my students have come up with some interesting and difficult to solve bugs. One involved a png file that had an unexpected transparent  section. The other was more confusing and I’m not sure I could have solved it without a good bit of CS knowledge. Even then it was not obvious. (Long story short – passing addresses can be tricky )

I wonder how less experienced teachers handle the really hard debugging tasks. I’ve been writing code since 1972 and teaching beginners for about 15 years. I have seem a lot of errors. A LOT! Often I can debug code without even looking at it. Some errors are that common. And of course I have developed a lot of ideas about debugging. The debugger in Visual Studio is very familiar to me as is how to use it to narrow things down. Students are very good at finding new ways to mess things up though.

I saw a Facebook post from a teacher who has been assigned to teach AP CS A but who has no coding or CS experience. No, really, I’m not making this up. How in the world will they be able to help debug code? And forget about teaching/modeling debugging practices.

Over the years I have had a number of teachers ask me to help with debugging student code. I saw a very interesting recursion problem once. Doing a stack trace was key to that one.

Debugging may be the single biggest reason to say that one week crash courses are not enough for professional development of new CS teachers. A full semester course would be a good start but without experience a new teacher is going to be just barely staying ahead of their students.

But how to you teach debugging? Have you ever had a course or even just a class on debugging? I haven’t.  How would such a course run? Anyone know of a syllabus for a course like that?  I’ll have to think about that one. In the long run though they is no substitute for experience.

Tuesday, January 07, 2020

What does “doesn’t work” mean?

Every computer science teacher has heard it “My program doesn’t work. What is wrong with it?” Sometimes they will show you the code without any more explanation than “it doesn’t work.”  One generally replies with something like “define ‘doesn’t work.’” Or you are told the program is giving an error. When you ask “what error?” you get a blank stare. The student has shut the error message away without reading it. Somehow you, the teacher, are supposed to know the answer without really knowing the question.

Debugging seems to be the hardest thing to teach students. To be fair, debugging is hard. One quote on my bulletin board is:

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

- Brian Kernighan

There are a few good, and easy, places to start though. One of them is actually reading the error message. For some reason that doesn’t seem to occur to many students. Of course they often don’t read the directions either so I probably shouldn’t be surprised.

Giving some serious thought to the error message is often enough. To be fair, I like to be fair, some error messages are less than helpful. Helping students to understand the error message is better in the long term than just telling the student what they did wrong. Why do you think the computer doesn’t think that variable exists? Did you spell it right? Did you declare it in the wrong place? Remember when we talked about scope?

Another helpful technique is to explain what the program is supposed to do, how it is going wrong, and how you think the code is executing. Many teachers use the rubber duck scheme and ask students to explain all of this to the duck. This works for some people and some errors. I don’t have a classroom set of ducks but do have students explain that to peers. Sometimes that is enough. Sometimes it is not.

When they explain things to me I often prompt with questions. Often students are wrong in their explanations. I remember one student telling me that of course the code did something because here it was in the comments. There was no code to execute what the comment described but the student thought the compiler actually read the comments. Sigh.

In all cases it starts with knowing what should be happening and what is or is not happening. The more detailed one can explain that the easier debugging becomes.

Thursday, January 02, 2020

A Brief Career Memoir

Blame Mike Zamansky for this one. In my last post I mentioned that I am planning on retiring from the classroom this spring. Mike wondered how my perspectives have changed over the years and through different aspects of my career. Now my career (so far) has four main parts. I worked in the computer industry, mostly developing software, for about 18 years. After a big layoff I went into teaching for about 9 years. Microsoft hired me away to work with educators. My job was to promote Microsoft products for teaching computer science. I spent 9 years there. Seven of them awesome. Management and priorities changed and I found myself leaving Microsoft and after a brief hiatus returning to the classroom seven years ago. It’s been a ride for sure.

During my first 18 years I didn’t see computer science as something for everyone. Education was important and I was involved. I was on the board of a private Catholic K-8 school for 6 years. I was twice elected to 3 year terms on the local public school system’s budget committee. I mostly saw computers and something students needed to be literate in. That meant applications. I believed, and still do, that computer applications can be powerful learning and teaching tools. I saw computer science mostly as vocational. It was, after all, my vocation.

After a layoff, the school I had been on the school board for hired me “while I thought about what I wanted to do” as a part time computer teacher. For the most part, in K-8, that meant typing and computer literacy. I picked up another part time role at a K-6 school and worked at those two schools for a year. My son was in a private Catholic high school and one night at parent teacher conferences I had a long talk with their computer science teacher. I started teaching there the next school year. I stayed for eight really goods year.

I was hired to teach HS CS in 1995 and it was rare for a high school to have one computer science teacher let alone two. But the administration believed that computers and computing was important. It was important to parents as well and we developed a good program. We still taught a lot of computer literacy and applications use but we were having some fun teaching real computer science as well. I still saw it mostly as an elective though.

We moved from a mini-computer (PDP-11 running RSTS/e) to PCs during my first few years there. I posted about many of the changes were were making to curriculum and tools to social media (mostly email lists of course) and caught the eye of someone at Microsoft. We were using Visual Basic for programming and Office for applications. This lead to some side gigs with Microsoft as I helped other teachers learn about teaching CS with Microsoft tools. I got a lot of training and previews of software during that time. Microsoft was developing the .NET Platform and the C# language both of which I adopted for my own use. In my eyes, C# fixed the things I didn’t like about Java.

Microsoft was forming a new group of what they called Academic Developer Evangelists whos job was to promote Microsoft platforms and tools to university professors.  Eventually they hired me on. Note that I joined Microsoft because I believed that Microsoft tools were good teaching tools.  My combination of technical knowledge and education experience was a natural fit for one of these rolls. Over time I expanded my portfolio from New England Universities (I joked that my territory was from Dartmouth to Yale) into high schools.

Computer science was growing in high schools and I really wanted to help make that happen. In my role at Microsoft I was able to give away a lot of software and help create free curriculum resources. I also met with teachers all over the country. The big lesson that I tried to bring back to corporate was that teachers wanted to teach concepts not tools. Curriculum had to be content and concept based not product based.  Sure you need to know the tools and I did a lot of workshops on using them. Using the tools to teach concepts was more important to me, and still is, than the tools themselves. I like to think that the resources we created and gave away were help in teaching more than the tools themselves.

During this time people were starting to talk about computer science as being more than vocational. Not so much at companies but by educators. Microsoft saw computer science as the environment that they lived and did business in. They saw promoting computer science education as not to provide them with more workers, they could get all they wanted, but to help their customers and prospective customers get trained people for their businesses. Still pretty vocational of course.

Others, ACM and the fledgling CSTA were starting to promote CS education as being more about understanding the world around them. I really wanted to be involved in CSTA and I was. I was lucky enough to serve on the conference committee for a couple of years. I have no doubt that my being at Microsoft was at least responsible for that but I didn’t care. I was involved. The conference was and is important.

When I left Microsoft I ran for and was elected to the CSTA Board. That was awesome!

Microsoft moved on in priorities but happily  they gave a lot of support to Kevin Wang and the TEALS program he created. My perception is that Microsoft’s support for K12 CS has moved from product based to supporting CS education more broadly. MS Philanthropies made a huge contribution to CSTA not long ago. I still wish they had someone in my old role but that’s life.

But I digress. 

Leaving Microsoft  and returning to the classroom was interesting. Over the previous years I had met, talked to, learned from, and made friends with CS educators all over the US. I was anxious to bring what I had learned from them into my own classroom.  I was also starting to see the need to computer science to move from the vocational to the core of a good liberal arts education. My years at Microsoft had let me see how teachers were doing more cross curricula learning. Bootstrap, perhaps being the best example – learning math and programming/computer science as mutually supportive. Emmanuel Schanzer is one of my heroes for his work at Bootstrap. So how do we make computer science relevant for everyone? And how do we get schools to make the learning happen?

Over the last decade I have been privileged to work on a couple of curriculum initiatives. The ACM/IEEE CS 2013 Task force which gave me great insights into higher education curriculum and the broad field that Computer Science has become. The  K12 Computer Science Framework which really opened my eyes to the possibilities of computer science before high school. I was also a part of committees who put together CS Teacher certification and K-12 standards for the state of New Hampshire.

It’s been a journey but I see computer science as a lot more than a vocational track in schools. With things like artificial intelligence, Machine Learning , virtual and augmented realty, big data, cloud computing, and the Internet of Things growing in importance in our daily lives I see understanding CS as being as important as understanding some basic physics, chemistry, biology, and yes, even math.

Wednesday, January 01, 2020

A 2020 Vision

Sorry. You may be as tired of the 2020 jokes and puns about the new year as I am. I’ll try to avoid them in the future. This is the time of year I look at the last year and think about what I should try to do in the new year. This year is a bit different. I am planning on retiring from the classroom in the spring. I’m not sure exactly how I will be filling my time after that. Part of me wants to find some other type of job. At the least I want to stay current with computer science education and help teachers and student where, when, and how I can. So this blog will continue.

I’m also presenting at this summer’s CSTA Annual Conference. I’m looking forward to that. The conference itself as well as my presentation. Looking at the program, I think I will be looking at different sessions than in the past though. Usually I would focus on sessions that have the most applicability to the courses I would be teaching in the next school year. This time it will be all about my personal interests without concern about specific courses. I have to keep learning.

Monday I go back to school. One more semester of teaching. I’m going to do my best to make it the best year yet. After that? Well, a lot of possibilities. Should be fun.  

Monday, December 30, 2019

Looking Back on Blogging

Both Doug Peterson (https://dougpete.wordpress.com/2019/12/30/10-years-ago-2/) and Mike Zamansky (https://cestlaz.github.io/post/10-years-blogging/) posted to their blogs about blogs from ten years ago. It was pretty interesting. Mike did some analysis of his blogging rates over the months and years. I took a look at my blog posts from ten years ago. I was posting on two sites back then. One a Microsoft owned platform which was my main blogging site at the time. I was cross posting some things to this site as well. Ten years ago this time of year I was posting about projects involving random variables, talking about Monte Carlo simulations, and roulette and slot machines.

Rather than look at ten years ago or do some sort of data analysis of the last ten years (complicated by two blogging sites) I thought I would look at this time as far back as I could. So 14 years ago at the MSDN site I posted a rather aspirational look at The Future of K-12 Blogging I wasn’t even close in terms of prediction.

I think more teachers and administrators are blogging. We’re not seeing anything like the expansion of computer science teacher blogs I was hoping for. I like to think I made a good case for it and that it is still a good case.


Every computer science teacher should have a regularly updated blog. Actually I would like to see every teacher have a blog but for the short term I will settle for computer science teachers blogging. There are several reasons for this.

  1. We need to build a community of practice in CS education. We need computer science teachers, who are generally alone in their building, communicating with their peers, sharing ideas, and supporting each other.
  2. The technology aware teachers need to set an example for the rest of the teachers. If they don’t use technology why should a social studies teacher?
  3. Most importantly, blogging is a wonderful way to share information with your students and their parents. Post links to extra resources along with a recap of a recent lecture. Give students an opportunity to comment on a current assignment or a recent test question. Expand the discussion and the learning outside the bell delimitated world of the classroom. Teach!

I'm really grateful to the CS educators who are blogging though. Mike Zamansky, Garth Flint, Doug Bergman, and Mark Guzdial have been particularly helpful to me learning and thinking. There are others listed at my Computer Science Education blog roll.

Friday, December 27, 2019

Looking Back on Computer Science Education 2019

Christmas break for me until 6 January 2020 and with Christmas over I have some time to think. 2019 was an intere3sting year in CS education. States continue to adopt more CS in K12. Teachers are still in short supply but so to are schools looking to hire them. Schools or perhaps school administrations and school boards, are slow to roll out more CS education. It looks like more schools are offering it which is great. But they are net requiring it so while they meet to checklist of offering CS it is still not for everyone. It’s going to take a while.

AP CS Principles continues to grow in enrollment. I try to get excited about that but it’s hard. AP courses attract too small a subset of the over all population. While there is much to like about AP CS Principles I can’t help but believe we need some more interesting CS courses. Something with depth and an interesting and motivating outcome. The Create task is not that.

Every year I think that the Internet of Things will take off in CS education. The mix of bytes and atoms seems like a natural to me. That didn’t happen in 2019. Perhaps because there is no one promoting it.  I plan on retiring from the classroom in the spring. Maybe after that I will have to time to really dig into it. Who knows, maybe I’ll come up with some good project ideas.

Cloud computing grew a bit in interest in 2019. Amazon Web Services has done some great work on this. Uptake has been slow but at some point it may take off. The problem with cloud computing, and perhaps IoT, is fitting it into the curriculum. It doesn’t fit easily in either AP CS course and too many teachers are working and teaching too many preps to adopt major new topics.

Artificial Intelligence took a jump in interest that surprised me a bit. There was a huge birds of a feature on the topic at last summer’s CSTA conference. AI for K12 has its own website, mailing list, and lots of people interested. See AI4K12.org for more on that.

What sort of Artificial Intelligence can you teach in K-12? Mostly how it is used, how to use existing AI tool and machine learning training systems. Developing real AI takes a lot of math that not many K-12 students have yet. Still, it is very important that students learn this much. The need to know what AI/ML is, how it is used, and discuss the ethnical considerations involved.

As always,the new year is full of potential. K12 CS is on a growing path that seems to have some momentum behind it.  I can’t wait to see what it brings.

Thursday, December 12, 2019

Explain This Confusing Code

My major task today has been finishing off the semester exam for my Advanced Placement Computer Science Principles students. They’re not happy about having an exam but that’s life. Writing a good exam is difficult. Fortunately I have some previous exams to work with. Some I wrote, some other AP CS P teachers wrote. I’m getting close to done. I want to have AP exam style questions to help my students prepare for the actual AP exam in the spring but of course the main purpose is to put a grade in the grade book. OK I’m half kidding. I seriously want to get a handle on what information they have learned and what I should review before we move on.

Coincidently someone posted a question for the AP CS A question bank on Facebook asking for help with explaining it.

How does this evaluate for Java: x / 10 % 2 ?

This is exactly the sort of question that had one of my APCS A students some years ago say there were a lot of examples of poor coding practice in the AP Exam. And this, in my opinion, is a terrible coding practice. I can understand why the question may be attractive to some. The whole order of operations thing. Students should understand it. But good coding practice is to avoid ambiguity and this code is loaded with ambiguity.

Is this integer division? 10 looks like an integer to me. Making it 10.0 would make it look like a floating point number of course. How do you make “x” look like a specific data type? This is not FORTRAN IV where it would be a double since it doesn’t start with a letter from “i” through “n.” And remembering the order of precedence between modulus and division? Who has room in their brain for that to be top of mind?

This makes a great discussion question. A great question to emphasis the need to use parentheses to remove ambiguity. There is no way it would pass code review in a professional development environment though. At least not a review I want to be part of.

Well, I should go finish writing my test and trying to avoid writing horrible questions.

Monday, December 09, 2019

Coding Without a Net

My Programming Honors students are struggling with creating classes in C#. They really wanted me to code up a project live (again) and have them follow along. But I’ve used my usual examples and samples and projects already. First message is that I need more but I had to come up with one for today. And I had writers block. About a half hour before class, with a bit of panic setting in, the other computer teacher suggested a reindeer class. For Santa’s sled. For data use a name, their position on the sled, and if they have a red or black nose. Ok a bit of a goof perhaps but simple and seasonal. Why not?

Now I don’t know about you, but I prefer to write demo code several times before writing it again live in front of an audience. Not an option today but how hard can it be? I’ve written classes many times before and my content knowledge is solid.

I honestly hoped I would make some mistakes. Hopefully the students would catch them. Great learning experience. And yes, I did make a couple of mistakes. I forgot to make the class data private right off the bat. I called for a string parameter in the constructor that should have been an integer. A student caught that one. Winning!

The hardest part for me is that I had only thought through writing the class but now how to test it. I had thought about the constructor (and prepared a data file with 8 normal reindeer and Rudolph) and using ToString (overridden of course) for testing purposes. I had to make up a test for various other properties on the fly. At least that meant students got to see/hear my design thoughts as they happened.

  I’ve also been thinking about a Santa’s sled class that would have an array of reindeer objects. That might be fun if I figure it all out.

Things went pretty well actually. I got a lot of ideas which doing the demo and I’ll be more prepared in the next semester. I need to come up with something seasonal for the spring though. A prom dress class perhaps?So many ideas.

Wednesday, December 04, 2019

Coding for Fun and Advent of Code

My friend Mike Zamansky is a big proponent of the Advent of Code – 25 days of coding problems leading up the Christmas. Since I have been thinking I want to write more code for my personal enjoyment I started in on it myself. Day 1 and Day 2 were interesting (to me) problems and I enjoyed doing them. Day 3 didn’t appeal to me. It looked like something I would want to be paid to write so I didn’t do it. Day 4 looks interesting so I plan on taking it one some time today. After all, it is not coding for fun if it isn’t fun. I’m not looking to prove anything to myself or anyone else at this point in my life. Mike has been blogging about the problems he has been doing from a teacher’s perspective. I highly recommend his commentary https://cestlaz.github.io/

The Day 2 problem was particularly interesting to me though. It is a very simplified computer simulator. Only 3 instructions – 1 for add, 2 for multiply, and 99 for halt. with each of the first two operators having three parameters – location of the two numbers to operate on and the location to save the result. It is potentially self modifying code if any of the addresses points to an operator later in the list of instructions.

The obvious enhancement is to add more operators – division and subtraction for sure. Having a set number of parameters makes things easy so having variable numbers of parameters adds some complication. The more I thought about expansion the more I found myself contemplating a more complete “assembly language” especially as I found myself thinking about literal data and pointers as different types of parameters. Maybe I spent too much of my career writing in various assembly languages. In any case, as a thought exercise I found myself going far beyond what I would want to assign to a beginning programmer.

So I am pulling back a bit. I’m thinking about several smaller pieces. The easy part of a simulator with a few more operators. But maybe, also, what would a compiler look like that would create input for such a simulator? How would it load data into appropriate places? That’s a more advanced project but maybe something for me  to write to make it easier to create input for the simulator?

If nothing else, looking at Advent of Code is giving me ideas for both students and myself. Now that is fun.

Monday, November 25, 2019

What’s In A Name?

Naming things seems to be a continual problem with programming students. I’ve written about this before (two years ago A Rose By Any Other Name Gives An Error ). I can’t seem to get a handle on it with students. I think part of the problem is that students are good with ambiguity and inference. If you call a student by the wrong name or a diminutive they don't’ use themselves you may get a correction (think warning in computer speak) but they know who you are talking to/about. Compilers are a lot more fussy.

Case-sensitive languages differentiate between “question” and “question.”  Forget about adding extra letters or misspelling a name.

Somehow students have trouble looking that closely at words. I’m not sure if that is because they are too used to filling in the blanks of misspelled words or something else? I do notice that I see a lot of typos and spelling errors in other written work they do. Even though there are spell checking tools built into editors.

Part of the problem may be error messages. Well, that students don’t always read the error messages is part one. But even when they do the messages are not always helpful enough. “Variable does not exist in current context” is pretty meaningful for an experienced programmer. We understand things like scope for one thing. We also know to look for spelling differences. Students sometimes have trouble parsing that all out though. It is something that comes with experience.

Unclear error messages have long been a problem. I think that maybe it is because the people who write the messages have too much knowledge and so assume too much knowledge on the part of programmers. Then again most development tools are designed for experienced programmers and not beginners.

I wonder if smart IDEs will one day help beginners. Perhaps artificial intelligence modules will look at code and ask “Did you mean ‘Question’ and not "’question?” or “did you forget to declare this variable?” Or even “this variable is outside the scope of where it was declared.” This is the sort of hint that teachers give now.

All in all I think the answer is to make the tools more relatable to the people who use them. Teaching computers, which can be very difficult, seems, some days, to be a lot easier than teaching high school students.

Friday, November 22, 2019

Coding For Fun

As with so many things, it started with Doug Peterson. Doug recently posted about something called 100 days of code. This got me started about the need I feel (some times) to do more coding for fun. Or at least coding projects for my own interest and not for “work” purposes. Next up was Mike Zamansky (yet another good idea fairy whose blog I follow) Mike posted about some text based projects he was introducing to teachers during some professional development he has been running. Links below.

Now I love messing around with textual data. Love it. And I’d been thinking about that already and posted about one project recently. Mike’s most recent post reminded me of something I did “back in the day” when we used markup languages to feed into word processing systems (i.e. before WYSIWYG editors) I created my own concordance of the Bible. It was pretty cool to be able to do something like that. I may have to look for tools to do something similar. Maybe with HTML? We’ll see.

I also have a number of “things” that can be programmed sitting around at home.

The trouble is time. Well, honestly, not so much time as prioritization. There are other things to do. School stuff for example. Grading, lesson planning, and all that. And home stuff like the tables I want to build and the hydroponics system I have the materials for but haven’t built yet. And books to read. I need to be exercising more. And, well, you get the picture.

I suppose I could be coding and not writing this blog post as well. Sigh. I wonder if I wrote a scheduling app to help me out?

How about you? Do you code for fun or for learning (which is fun too) or is coding not part of your definition of fun? IF you do like to code how do you prioritize it? Does 100 days of code appeal to you?

Related Blog posts:

Thursday, November 21, 2019

Teachers Helping Teachers For Free

I understand the appeal of sites like Teachers Pay Teachers. Really I do. Some teachers are awesome at creating resources and the idea of getting paid to share them is attractive to underpaid and over worked teachers. Even Amazon, never one to miss a chance to make money, is getting in the business of supporting this idea (Amazon Starts Marketplace for Teachers to Sell Online Educational Resources) . For some reason the idea of asking poor under paid and under resourced teachers to pay for stuff that I have developed for my own use just doesn’t feel right.

I have no problem with teachers who decide to ask other teachers to pay for resources. I have no problem with people who make creating and selling resources in order to make a living. It’s a free country. I hope they have no problem with me giving stuff away for free.

I made a comment to this effect on Twitter and Mike Zamansky replied with “When I was starting out I only survived by the good graces of more senior teachers who mentored and just as importantly SHARED materials (free of charge). This shows the disconnect between capitalists and educators.”

I think that has been the experience for many of us. We survived and continue to survive because others share resources with us.

I’ve been pretty lucky myself. The first real resource I shared online was a pair of project books for Visual Basic and Visual C#. I got paid to write the first editions. By Microsoft not by other teachers. Teachers got them for free. I subsequently updated and expanded them several times as the software was updated but while the books were still free I no longer got paid to write them. I was and am ok with that. I got plenty of use from those projects myself. The feeling of helping other teachers is a reward in itself.

In full disclosure, I have a couple of self-published books on Amazon now. Mostly because creating hard copy books to give away is more than I can spend. But I haven’t turned down teachers who request PDF versions.

I have also benefited from resources shared by others. PowerPoint presentations, video demonstrations, project ideas, and a host of other resources that people have shared over the years have greatly benefited my teaching and learning.  I am very grateful for those who have generously shared those resources.

One day maybe teachers will not be under resourced and under paid. For now though far too many are. That’s why I think we should do as much as we can to support each other.