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.