Wednesday, May 31, 2017

News Flash! School and Industry Are NOT The Same

Computer Science cheating has been a discussion lately. Not just in the NY Times article I referenced the other day (Cheating In Computer Science Class) but on Facebook, on Twitter, and other social media. One sort of rebuttal to the concern over cheating was a blog post - Computer science students should learn to cheat, not be punished for it  - that also got a lot of attention. I see industry people nodding their heads in agreement. The problem is that the rebuttal author doesn’t seem to really understand the issue. There are some common misconceptions that I think need clarification.

Misconception: The goal of a school project is a working program.

That is what the goal is in industry. Make it work to spec and make the user happy. That is not the goal, or at least not the main goal, in a school project. The goal in a school project is to demonstrate what a student knows. Not what their friend or their parent knows but what they know. It is a diagnostic tool for the teacher to see how much learning is taking place. An imperfect tool to be sure but all we have are imperfect tools.

We also want them to practice and use what we are teaching. Cut and paste is usually a poor substituted for figuring out how to solve a problem and properly use the tools that are being taught. One learns more by doing than by simple copy operations.

Misconception: Students who copy code have to understand it to use it.

Oh if only that were true. Any teacher will tell you that students use code acquired from others without understanding it all the time. If a student finds a snippet of code, understands it, and uses it in a project most teachers would see that as a win. The student learned something. Wonderful! We’re happy. Using code without understanding it helps no one.

But it is not just snippets that are involved in cheating. Nothing so remotely borderline as partial borrowed code. Sometimes a student will hand in a full and complete program that they found on the Internet. And they will do it without understanding a bit of it. Who does that help? No one. Remember that in school the goal is gaining knowledge not just handing in something that works.

Misconception: Teaches don't want students searching the Internet for help

The internet is a wonderful learning resource. I know teachers who explicitly recommend sites like Stack Overflow to students and encourage them to look there for help. Some of us actually recommend reading the documentation online and even using sample code. As long as the student understands what they are using. Teaching is not just about covering the limited material but helping students learn how to learn. We’re thrilled when students use outside resources to go beyond the scope of the class. But we do want students to understand what they are doing.

Misconception: Programming for school and for industry should be the same

No. In industry the goal is a working program and in school the goal is learning. Industry expects employees to know things. School assumes they don’t and strives to teach things. The goals are different so the methods must be different.

I have heard the argument that schools should teach the things that industry needs using the tools that industry uses. It’s the old trade school mentality. And that works great for trade schools which serve a valuable purpose. Computer science education has to be more than just the tools of the hour. It has to be on concepts that last for a career. And that process is different from short term goals.

Sure using industry tools can be a good thing. And using things like Git and other source code repository/source code control tools is a good thing. Guess what? Many schools do teach those things. In fact arguably more CS departments teach more of the professional skills, especially soft skills, than many outside of education realize.

Misconception: Computer Science and Software Engineering are the same thing

Computer Science is more theoretical and software engineering is arguably more practical. One should not criticize one for not being the other. At the high school level we are not trying to create professional software developers any more than we are trying to create professional physicists or biologists. Rather we are trying to give students a conceptual basis for understanding the world in which they live. Links to more reading below.

I’ll conclude with one more point which I think may be the most important one. We need computer science professionals with integrity. We need professionals who are honest, who are ethical, and who are dependable. Educators care about cheating in its various forms because we value those traits as  much as we value the technical knowledge students gain in our classrooms and labs.  If a student cheats in school will they not also cheat the companies they later work for? I think so. And that should concern industry people. It should concern them a lot.

On Becoming a Better Computer Science Teacher

Andy Ko, Associate Professor at the University of Washington iSchool and Chief Scientist & Co-Founder @answerdash has posted a blog and slide presentation from a talk he gave called How to be a great (CS) teacher. It’s the best thing I have read on the topic is quite a while. If ever. The article is very good but I recommend you read and save to re-read the slide presentation.

I wouldn’t say that all or even most of the ideas in it are new to me but they are explained very clearly and backed up with references. That is especially cool in that we often adopt ideas without real research behind them. Research is good.

Over the years I have learned a lot from great teachers. Many years ago Carnegie Mellon ran summer workshops for CS teachers where one of the goals was to help us learn how to teach to a more diverse (i.e.. female students and other non traditional) student body. The 6APT program was a game changer for me.

When I was at Microsoft I was able to travel and visit a lot of teachers around the US. And attend a lot of great conferences (SIGCSE, CSTA, and more) Since I returned to the classroom I have tried to adapt many of the things I learned in those years to my teaching practice.

This summer as I put my plans together for next year the ideas in Andy Ko’s work will be a regular reference as I look to how I can improve next year. Always be learning.

Tuesday, May 30, 2017

Cheating In Computer Science Class

An article about cheating in CS classes from the New York Times (As Computer Coding Classes Swell, So Does Cheating) has been all over my social networking feed this last weekend. Harvard’s famous CS50 is the big name example in the article. I wonder if this points to a problem we may be crating inadvertently. Are we creating an environment where taking a CS course is seen as the end product rather than actually learning computer science?

Has taking a CS course become the cool thing to the point where students without real interest in the subject take the course (or courses) more as a resume builder than as a real attempt at learning something valuable for the sake of using it?

The article points out that a CS class can involve a lot of work. This often leads to cheating in many subjects. After all the end goal of taking a class for many students is to get a good grade. Oh sure there are courses where a student may really be interested in the topic and wants to learn as much as possible. But there is only so much time in the day so if a few corners are cut for the sake of a good grade outside the student's real interests what’s the harm? (Or so the rationalization goes.)

My experience is that other students get very upset when their peers take shortcuts. It’s unfair if someone gets grades they don’t deserve. It makes me wonder if grades hurt more than they help. The same motivation seems to lead to cheating as often as it does hard work.

It’s actually somewhat more complicated in computer science though. There is a fine line between collaboration and helping ones peers and actually cheating. Where is the line to be drawn? Once in industry the motto I heard often was “steal from the best” and code reuse was touted as a very good thing. Of course one was always expected to really understand the code they reused. And one usually learned from it. A course is a shorter term thing though and one can sometimes borrow code without understanding it.

What is the answer to cheating? For some it is better detection of cheating and swift, firm, and noticeable punishment. An other option is projects that are more tuned to student interests. It can help if the student becomes more interested in completing the project and learning what they need to know to do so. But it is hard to come up with projects that motivate every student. Especially in a huge auditorium course like CS 50. High school teachers may have it easier there. BY degree at least.
Maybe part of the answer is less focus on grades. That’s hard though. High school students are told over and over again that good grades get them into a good university which will get them a good career. Not good learning – good grades. The words we use matter.

Clearly I don’t have a final answer. No teacher does and we have been dealing with this issue probably as long as we have had grades that matter. For now I find that semester projects of a student’s choice work best. They don’t eliminate cheating. But I think they reduce it. And that at least is a step in the right direction.

FWIW here is a contrasting view - I reply to it at

Wednesday, May 24, 2017

Interesting Links 24 May 2017

It’s been a while since I posted one of these collections. And I’ve been blogging a lot less lately. Call it a sort of blogging vacation. I just needed to prioritize other things for a while. We’ll see how things are going forward. In any case I felt like I had a lot of things I should share so here we go.

I know a lot of people are using Python these days and with summer coming you may be looking at projects for next year as I am. So I thought I should share this Collection of free Python lessons (Shakespearean Insult Generator, Magic 8 ball, Sorting hat, Mad Libs, and more) I’ve used similar projects with students in other programming languages and they work well with students.

Announcing Microsoft MakeCode for Circuit Playground Express – From Microsoft Education. The really cool thing about this online development tool is the variety of interesting and inexpensive hardware it can be used with. Combining programming with “making” opens some really interesting possibilities.

Speaking of making – this look at what Doug Bergman is doing with his students is really impressive. A spirited teacher reshapes the computer science classroom for 21st-century makers He has a very interesting computer lab with movable tables, lots of interesting hardware (think several kinds of robots plus Kinects) and really lets students get creative.

Researchers unveil new password meter   - security is getting more and more attention lately so this information about good passwords may be a good discussion starter. The source code for this password meter (it’s in JavaScript) is available.

The ACM Code of Ethics, Draft 2 is now available for comment. Deadline for Input Is June 5th, 2017. This update is designed to make sure that the code is current with the technology. I plan to have some discussions about ethics based around the final document with my AP CS Principles class. I will at least bring it up in the rest of my courses though. Ethics is VERY important and getting more important to teach all the time.

From the UK there is a new edition of Hello World magazine out *now*. Download via   Brought to you by Raspberry Pi, CAS and the BCS Academy. Lots of awesome in this edition. Things are really moving in CS education in the UK and the rest of us should take advantage of the resources.

Check out the Computational Thinking Interview Series from  CSTA “The CSTA's Professional Development Committee is gaining perspectives on computational thinking by meeting with leaders in the field. In this interview series, we are asking, ”What is computational thinking?””

Designing a Computer Science course with constraints  by Mike @zamansky is a good look at how teachers often have to deal with constraints outside of their control when designing a course.

Three Computer Games That Make Assembly Language Fun – They’re not free but they’re not all that expensive either. Some interesting possibilities for some classrooms I think.

Acer Windows Mixed Reality Headset Developer Edition is one of two mixed reality headsets offered by the @MicrosoftStore Available in August when birthday comes. Seeing these inspired a blog post of mine. A post with some ideas and questions I am still looking for feedback on.

Using Virtual Reality for Teaching Computer Science

    Thursday, May 11, 2017

    Using Virtual Reality for Teaching Computer Science

    Maybe you can help me? My gut tells me that virtual reality or even mixed reality can be useful for teaching computer science. How to do that is the question. I don’t want it to be just another device that students program. That’s not really innovative. I want to think of ways that help students learn computer science. I want them to “see” things that can not ordinarily be seen.hololens-military

    My first thought was a virtual tour of a computer. While I do show students mother boards and other pieces of computers wouldn’t a “walk through” of a virtual computer be better? More interesting? On one hand a video, perhaps just an animation, can do that fairly well. On the other hand virtual reality is the opportunity to take different paths through the computer to trace things the way a student would like. A mixed reality tool would label items as a student looked at a physical device. Taking the tour would be more fun though.

    How about following instructions as data through the pipeline in a CPU? That could be fun and make things more real to students. In fact a general walk through a CPU could be good. The improvement over a simple video would be the ability to travel non linearly. IS that enough? I’d like to find out.

    How would virtually tracing the path of code in a program work? Could we set things up so a student could follow (visually) a variable through code to see what happens to it? Perhaps watching the variables as they appear (are instantiated) and disappear (as their scope expires)? The idea of being mixed in with the code ala TRON or The Matrix has a certain appeal to me.

    Do these ideas make sense to people? Would they help? Do you have other ideas?  Is this even possible with current technology? Putting this together probably requires some talent, time, and even money. Who will do it first?

    Monday, May 08, 2017

    Pseudo Random Numbers Are Confusing

    Random numbers are really useful in computer science. We use them a lot for simulations (or games – pretty much the same thing) and to make programs more interesting. But they are not as simple as might appear. First off they are not really random and secondly there are often timing issues. And then there is the whole testing situation. randomnumber_wordle

    Let’s start with the first of these. Those of us who understand random numbers in CS understand that it is impossible for computers to calculate truly random numbers. Cryptography which really relies on true randomness uses all sorts of tricks and tools to generate groups of random numbers. No serious cryptography person would use a standard library for use in cryptography. But for most things we do  in high school computer science built in library random number tools are just fine.

    Where things have gotten complicated for my students lately is with timing issues. The libraries we are using use time from the computer’s clock as a seed value for the generator. If you instantiate two different random number objects at the same time, or rather within a single clock interval, you get two lists with the same values. Whoops! This is pretty much the opposite of what students really want. They’re generally better with one variable than with two but that is not obvious to many beginners. After all if one is good two is better right? And even if you have one variable if you instantiate it over and over again in a tight loop you can also get a lot of duplicates. Various languages have various ways around this (static variables for example) but hardly obvious to a student who just heard (or read) about generating random numbers.

    And then there is testing. Oh my. Seldom a student strong suit. After all if it compiles isn’t it right? The special problem with random numbers is how does one test if the data is different all the time? Visual Basic has a Randomize statement that makes things “more” random. If one doesn’t use it than the program will use the same random numbers every time. In other languages (libraries really) one can use a fixed seed value to get the same set of random values for each run. How ever one does it, it is useful to have a known set of data for testing purposes. Talking about this is an important part of the larger issues of understanding random numbers AND of testing program.

    One of my tasks for this summer is going to be trying to document this better for students. I realize that I need to cover this in more depth if students are going to really be able to use random numbers effectively. I can only talk so much in a single semester course. Perhaps if I provide supplementary reading for homework it will help. It’s a theory.

    Maybe I’ll bring into the mix. Looks like some interesting tools there.

    Monday, May 01, 2017

    Punch Cards, Comments, and Learning From the Past

    Doug Peterson, whose blog always makes me think, had a post last week about internal documentation. Specifically things like comments which a lot of the popular block languages don’t really do that well. Of course this made me think about my code and what I teach.

    Punch CardsThe image to the right is some code I wrote in university. Yes, I have a 45 year old deck of punch cards and yes, that is a FORTRAN program. I ran into it while cleaning up this past weekend. Doug’s post had me looking at the code. And the comments.

    The comments  are great. They really let me know what is going on. That’s good because my variable names are horrible. What ever was I thinking? I’d do things a lot differently today. And in fact I do do things differently today. I have written programs like this one several times and in several different languages over the years. The variable names are much better. We’ll talk about comments in a moment.

    The first time I dug out this deck of cards was some years ago when I tried to rewrite this program in Visual Basic. The comments, one in particular, was critical for me making things work. I use this as an example for my students of why they should comment their code  in fact.

    My most recent iteration of this program has been in TouchDevelop. I’m pleased to say my variable naming is MUCH better now. My commenting? Not so good. Part of the problem is the nature of the language. Comments are supported but somehow I never seem to think of them the same way as I do in other languages. This seems typical of block or drag and drop programming languages. (Doug brings this up which made me really think about it.)

    Of course lack of commenting is not unique to drag and drop programming. Students have pointed out that some sample code I wrote and gave to them to learn from could use a lot more comments. BLUSH They are quite correct.  I really need to fix that. Perhaps I’ll take on as a summer task to well document the demo code I show students. I really should be modeling what I present.

    I do worry that we are losing the focus on internal documentation these days. There is this theory that well written code with well chosen variable names and identifiers should be understandable without comments. Like many theories that doesn’t seem to work as well in practice though. Well, I’m off to comment some code.