Archive for April, 2014

Programming quizzes – You think I would learn.

April 29, 2014

I gave what I thought was an easy quiz last week.  Four questions.  Two asked for a short program.  Two gave a short program and asked for the coding mistakes to be corrected.  All with pencil and paper.  After giving the quiz I made the key.  After 30 years of doing this you would think I would remember a cardinal rule of quizzing – make the key, then give the quiz.  Yes, the quiz was easy, especially after I sat there and thought for a minute or two.  The difficulty is the difference between programming with a pencil and programming with the IDE up and running in front of you.  When I code I tinker as I go.  I stare at the ceiling or doodle some notes of issues I see.  I try something, see if it works and if it does I then look for a possibly better solution.  Taking a quiz is not the same as writing a program.  With a quiz there is usually a time factor involved and a pressure factor.  Both have a tendency to mess with my programming skills so I can imagine what it does to the kids’ programming skills.  In real life I have never had to look through a program on paper to find errors.  Coding errors are indicated by a number of things.  The program does not run, the program runs but gives the wrong answer, the equivalent of the blue screen of death occurs or, given the language, the IDE flags the error to indicate your typing ain’t so hot or your understanding of the syntax is wanting

Giving a quiz where the kids have to write a quick script by hand just seems so logical to do, especially to a math teacher like me.  It should test knowledge of the language, program design, algorithm development, and a couple other odds and ends in there.  After deep consideration I think a quiz of this type does very little of the above.  Maybe it tests quick knowledge of the language.  At this stage (first and second semester) the kids are still not at the comfortable stage with the language.  How good were you in the first semester of French?  (Is there a correlation between learning a foreign language and a computer language?  Sort of, especially if you talk to those that want to classify computer programming with the foreign language department.  Gurk.)  Do I really care about quick knowledge of the language?  Not so much.  I want them to be able to solve problems with the language and speed really is not that big a deal.  Program design is next.  Program design should take some time and some tinkering.  I usually do not get a well designed program until after I have gotten something working and sit back and look at it.  Then I get the “I wonder if” brain cells working and start experimenting.  That is what I want my students to do.  Tinker.  Is there any algorithm development in 10 line quiz scripts?  Again, not so much.  More like “how did I do this last time?”  I think I am going to bag hand written quizzes.  I will give quizzes where they can use their computers and their previous programs for reference.  It still will not address what I think the goals of a programming class should be but it keeps the kids honest.  A quiz does require they do their own work.  It eliminates “collaboration”.   Of course I promote collaboration when they are doing programs so there is a bit of a contradiction there but the quiz does catch those that are just along for the ride.

Does a pen and paper quiz/test fit in to a programming course at all?  I can see them for things other than coding problems but I am just not a fan of the time factor that is usually part of a quiz.  Now if I can just remember this the next time I feel the need to give a quiz.

Still alive

April 21, 2014

I made it back from Moab alive.  Three days of incredible riding.  On day two I fell over and got a little bang on my elbow.  On day three it was still hurting.  By the trip home I was in serious pain.  My arm looked like one of Popeye’s arms.  The little bang got an infection and now my elbow is a very unhappy camper.  The Doc gave me some antibiotics but no result yet.  It is amazing what you can and cannot do when the elbow is not working.  I cannot scratch my nose with my left hand.  Next time I am going to wear knee and elbow pads.

Now it is time to get back to the teaching of programming.  The class has been working with a text file of Shakespeare’s Sonnets.  (Trying to throw in some culture here.) They have been doing simple things like counting letters and words in a sonnet.  No biggie, they are cruising through with no major problems.  Being oh so clever I gave them a little extra from the original assignment I stole the idea from.  The sonnets are all numbered in the following format.

end of sonnet

23.

start of next sonnet

The user input is the number of a sonnet.  The output is print the sonnet.  This is not a trivial problem for the kids.  They still have problems differentiating when something is a string and when it is a number.  The input is a string although it looks like a number (Python inputs are strings), the number in the sonnet is a string with an added period. The fun part comes when deciding where the end of the sonnet you want to print is.  Do you look for the next blank line or the next number?  If the next blank line then the code has to ignore the blank line right after the desired number.  Oh yes, and blank lines are really not blank, there is a end-of-line character in there.  If using the next number then the entered string number has to be converted to a number number (got that?), incremented by 1, then converted back to a string number so it can be located in the text file.  Neither method is complicated, it just requires the kids to realize what the have to do and what the issues are with each method.  They have to think and that is just so much work!  Poor kids.  I just love this job.

Spring break is on the way.

April 3, 2014

No computer science or programming in this blog today.

The week after next is our spring break.  This year we have a full week off (9 days) where usually we get a 5 day weekend.  I and a friend are heading to Moab, Utah to mountain bike for 3 days straight.  Mountain biking is what I do in the summer.  I used to be a dirt biker all summer but an excessive number of broken body parts made me switch to mountain bikes.  I still break body parts, but now it is just at a slower speed.

If you are not familiar with Moab it is a mountain biking Mecca.  Moab has miles and miles of incredible trails, almost all of which are very technical or very fast or very scenic and usually all three.  Mistakes can lead to more broken body parts or at least some very conversational scars.  I have been going to Moab since the early ‘90s when the place was just starting to get known as a cool place to ride.  Back then you could find camping right at the trail heads and not see more than 4 or 5 tents.  Now you had better have a reservation.  It is interesting to see the transition from a backwater unknown to a Mecca.  Not good or bad, just interesting.  Missoula has miles and miles of mountain biking trails but they are presently under 2 feet of snow.  Hence Moab.

The friend I am going with is about half my age and is an absolute physical wonder.  What I can do with experience he more than makes up for in athletic ability and power.  I am hoping I do not kill myself trying to keep up with him.  It does not look good.

This trip we are camping.  When I went down with 3 friends last year we rented a condo with all the amenities.  This trip is a budget run.  Camping does have certain advantages.  Of course as I sit here thinking of advantages to list I can only come up with one, it is cheap.  That works.  A nice thing is the camp ground is in the middle of town and the brewery is in walking range.  With two beers before bed I hopefully will not notice the aches and pains and the fact I am sleeping in a sleeping bag on a pad.  Maybe three beers.

The week we are going is also Jeep Safari week.  There will be a thousand Jeeps and Jeep-like vehicles running all over the back roads.  I have been to Moab on Safari week before.  It is a blast.  It is a bit crowded but there is just something about watching a $50,000 Hummer flip upside down on an ugly climb.  With the Jeeps all over the place the mountain bikers to not have to worry about running out of water, tools, air for flat tires or beer.  Those Jeepers know how to travel.  When we get tired we can just sit on a rock and watch the Jeeps try to climb something almost impossible.  Lots of fun.

Sharing code. How much is too much?

April 3, 2014

I think my Python students are sharing a little too much.  There are some students that are definitely doing unique work but out of 18 I would say 12 are relying on others to “lead the way” so to speak.  It is actually a little difficult to tell because the programs are fairly short and there are only so many ways to code them.  Usually the dead giveaway is the programs that have a list of numbers or words involved have identical lists.  It is hard to accuse some of cheating because I know there are students that collaborate on their programs so they are going to end up with identical code.  It is the students that wait for a finished program then just cut and paste that I have issue with.  The obvious solution is to give each student a unique problem to code.  Coming up with 18 unique coding problems that have the same learning objective is going to be a little difficult.  Earlier this year I gave each kid a different Taylor series (sin, cos, tan, etc) to program in Small Basic.  The only input was the number of terms to compute.  I think I will try that again for Python.  The code is simple, pretty much just for loops, but figuring the logic is the goal.  The real fun comes when I have to grade 18 different programs.

Giving more quizzes is one solution but I really do not have a good method for the kids to turn in quizzes done on the computer.  One of the many things I have to solve to get this programming class to work the way I want it.  Doing hand written quizzes is a solution but that is just not real.  How picky do I get in grading?  If a colon is missing does that count as points off?  If the kid were typing the code that missing colon would be something the IDE would pick up.  I know how I code; type in what I think is the solution then go back and fix all my typos the IDE has caught.  I have read a couple of articles on how beginning programming classes should not use IDEs; it allows hacking in code with the IDE making the corrections.  I kind of liken this to math without calculators; it can be done and has advantages but they are out weighted by the disadvantages.  An obvious solution for the quiz grading is to have the kids program in pseudo code.  That has its own syntax issues but easier to handle than the code.

This is one of the fun things about teaching programming.  There are just so many ways of doing it.  With math at the end of each chapter plan on a test.  Usually a nice traditional test that the students can study for, the right answer is pretty much the same for the whole class, and, if pressed for time, there are the canned tests in the book’s teachers’ manual to run through the copy machine.  With programming the book chapters (if using a book) are really not the end of a block of concepts, programming is extremely cumulative, studying is a bit difficult because memorization is not a major factor and there is no such thing as a canned programming test.  Oh, then there is the really smart kid that looks on-line and finds a different strategy for solving a problem that uses syntax the teacher has never seen before.  (I have on of those.  For almost every assignment he turns in I learn something new about Python.  I know his work is original.)

I figure in a couple more years of teaching Python I will have built up a collection of problems I can hand out that will help reduce the excessive sharing.  Right about when I decide to retire.