Sunday, January 13, 2019

Python first lesson - Peanut Butter Jelly Time!

The first week of the semester is in the books.  Students have been reminded of expectations, and have settled into the new semester.  I changed the grading percentages around a bit in several classes: adding an effort grade to my entry-level classes and for my AP class increasing the percentage that tests count towards the grade and decreasing the percentage for homework/programming assignments.  The effort grade is something that our art teachers do.  It is a good way to remind freshmen to remain on task and take an entry-level elective class seriously.  Increasing the percentage of tests in the AP class is in line with what our other AP teachers are doing and also what I have read in the APCS A FaceBook group.

The code reading/welcome back activity from last week's blog went well and the students enjoyed it and felt that it was helpful.  They have asked for more of this, so my plan is to alternate between subgoal labeling and code reading to introduce new topics for the second semester.

Peanut Butter Jelly Time

This week is one of my favorite weeks of the year!  The Exploring Computer Science class is beginning its nine weeks of coding.  I tell students how my first programming class in high school (Apple BASIC) got me hooked and led to a college major that I thoroughly enjoyed and then to a
fulfilling career that took me all over the world.

But before we start programming I take a day to introduce some terms and concepts by having the students write instructions for making peanut butter and jelly sandwiches.  The students work in pairs so they can begin seeing what paired programming will feel like.  Inevitably, the first confident pair reads their instructions and correctly remembers to take the plastic tab off of the bread bag but forgets to untwist the closed bag.  I let the pair make one change "on the fly".  At that point, the bread slices are out of the bag and on the plate and the next typical error is that students instruct the computer to turn the peanut butter jar lid counter clockwise.  But without picking up the jar first the lid simply spins the jar around and around on the table.  They have fun and we learn several different computer terms that we use the following day.

Students learn that making the sandwiches has instructions and that some of the instructions operate on things.  We talk for a bit about Python being a language that has instructions and that some of these instructions need parameters.  We pick up a jar and unscrew a lid.  I don't show these as instructions like pickup(jar) and unscrew(lid).  This may be an idea for next year.  We also talk about the idea of iterative development and that as we learn new things and figure things out we go back and refine programs and make them better in the same way that we made a better set of instructions that got us closer and closer to that peanut butter sandwich.  As students get close and think they have the full set of instructions, someone runs into a problem and exclaims "But that isn't what I meant!".  This is another good stopping point to remind that students that with programming many things can be intuitive but sometimes instructions don't always work the way we think they should.

Python print() and numbers

The first day of instruction and practice is easier having doing the fun activity first and introducing many of the terms that we use.  We use Idle to enter in instructions and see how they run and begin with print() instructions.  We print strings first and spend time making sure everyone can find the parentheses and quotation marks on the computer keyboard.  Then we move into numbers and talk about keys that represent the operators.  It takes time to make sure that everyone can find all of the correct keys.  We put the operators together and do a quick refresher on PEMDAS and discuss that computers follow the same operator precedence that we do.  We finish off the instruction by having the students learn that the comma can be used to print more than one string or number or operation.

I use the website to have the students practice.  Snakify is divided into theory, steps, and practice.  I prefer to walk through examples with the students instead of using the theory section.  But I have students complete all of the steps and then work in pairs to complete the practice problems.  Then I finish off each lesson with a small project.  For the first lesson we typically use ASCII art with sets of print() statements.

After the first lesson, it is usually fairly easy to see the students that are hooked, and then it is time to try to add to that number.

Royalty Free images from

Sunday, January 6, 2019

Ice Castles and Code Tracing / Reading

Dillon, CO Ice Castle
It's the last day of Christmas break before tomorrow's work day and students' return on Tuesday for the new semester.  It was a wonderful break of catching up with family and friends as well as some fun activities.  Last night was a great final trip to Dillon, CO and a walk through an full scale ice castle ( with friends.  The ice castle was beautiful with lights coming through the ice making it glow in different colors.  The end product was beautiful, but it was very slowly built up from a set of scaffolding with lights built in and then layer and layer of water turned to ice.  It is  a good metaphor for the building up of skills needed in the AP Computer Science A class.

Also, over break I had the opportunity to do some reading.  One very good blog post from Austin Cory Bart was a CS1 Literature Review (  This blog post is a look at what I want to do with one of the topics from the literature  review:  Code reading and tracing. 

Starting the new Semester

I plan to start the new semester with a review activity that covers all of the topics we visited during the first semester with a special look at some of the most complex or difficult parts for the students.  In the non-AP version of programming that I taught in previous years, I did this as a code along activity where we wrote code together to go through these concepts.

Enter the Literature Review...  One of the early topics covered was the importance of code reading leading to good or better code writing.  Code reading is not something I have emphasized.  The concept makes sense.  Students who are good writers also tend to be those who read a lot.  The same concept can be true for Computer Science as well.  Reading code can lead to better writing of code.  Extending that idea, reading good, well-written code is important.  In the same way that reading abbreviated text messages or poorly written text does not lead to good writing skills.

I plan to combine the code reading assignment with think/pair/share which is something I use fairly often in my lower level classes.  The Literature Review also covered the importance of collaborative experiences which is an important soft skill in the working world of IT.

Code Tracing and Reading

One of the confusing points for me was references to Code Tracing and Code Reading as two different things.  So I went back and read one of the research articles, Relationships between reading, tracing and writing skills in introductory programming by Mike Lopez, Jacqueline Whalley, Phil Robbins, and Raymond Lister (  To me, code tracing is the equivalent of knowing the meanings of words and code reading equates more to the idea of reading for comprehension.

Code tracing is the ability to read a line(s) of code and explain what it does:
a = 4;
a += 5;
Add 5 to the current value of a which is 4 and set a to the new value of 9.

Code reading is the more advanced concept of looking at a block of code and being able to explain what it does.
sum = 0;
for (int i=1; i <= 10; i++)
     sum += i;
Sum the values 1-10 and print out that sum.

Beginning of the Semester Activity

With those definitions in mind, I see that my students have plenty of opportunities to trace code but not that many opportunities to read larger amounts of code for comprehension. Students can read small blocks of code such as the example above, but not many opportunities to read an entire class and runner for comprehension.

The code example that I am using is Rainfall.  The class stores the name of a city and an array of monthly rainfall totals.  The class processes the array to calculate min and max months, total and average rainfall and a standard deviation.  The runner class reads in CSV lines from a file and then processes the lines using the comma as a delimiter.  Students will also have the opportunity to review code again that does formatted printing as it is a topic that still confuses several.

The methods in the Rainfall class are things like get1(), get2()... and several variables are set to x and y.  Students will be assigned methods to read and review.  Then they will work with a partner to compare and together assign new method and variable names that are descriptive.  After that I will have the students discuss their assigned methods with the class.

Here are the classes and data file that we will use:

Sunday, December 30, 2018

Why I teach

I use Flipboard to consolidate news stories that I am interested in.  Of course, education and technology are two of the topics that are checked.  A couple of days ago, a story from the Wall Street Journal showed up in my feed: Teachers Quit Jobs at Highest Rate on Record.  The economy was one of the reasons listed -- teachers are receiving small or no raises and are finding better paying jobs outside of education.  And the story ended by quoting someone who felt that the American society does not value education and students -- and by extension those who work in education teaching students.

I certainly cannot fault a teacher for wanting a bigger pay check, and realize that there are many fields where teaching degrees and skills can be put to good use outside of education.  Working in the field for my fifth year, I am grateful for the skilled, energetic, and joyful teachers that work at my school.  Each of those educators has a unique reason for teaching and staying in the profession.  I have also been saddened to see some excellent educators leave the field.  There truly is a need for good educators!  As a result I want to add my thoughts about why I teach.

There are many well-written articles and blog posts about the reasons that people teach, and I am adding my perspective as someone teaching technology and teaching as a second career.  Over the summer I completed my training for a CTE endorsement and as a final activity, we completed a three sentence reflection activity on why I teach.  This is an expanded version of that reflection.

I teach technology because the future is now

When I was a senior in high school (1982-83) I took the very first BASIC programming class taught at my high school.  I was hooked!  That lead to a college degree in CS and Mathematics and a 26-year career at IBM.  Over that career, I programmed, trained, consulted, and ended in technical sales,
Placing that hook!
and along the way had the opportunity to live and work in Rochester, Minnesota; Guadalajara, Jalisco; and Denver, Colorado.  It was a long, wonderful career and I also had the opportunity to do some volunteer work with at-risk youth.  That volunteer work gave me the interest to move into teaching.

When I transitioned to teaching from IBM, I got my secondary teaching license in mathematics -- thinking that high schools would need multiple math teachers and few if any computer teachers.  I was pleasantly surprised to learn that teaching CS in high school is needed and in many cases with positions left unfilled.  Over the past several years I have gradually moved from math to computer science and have been delighted with the move.  Now I have the distinct privilege to introduce students to computer programming and hopefully hook a few more students to a career that I so enjoyed.

The CS field continues to grow, and so many other fields rely on or have connections to technology and coding.  I find myself excited about available careers in full stack web development, machine learning and artificial intelligence, cyber security, as well as the ongoing needs of operating system, middle ware, and business application development.  There are so many directions my current students can head, and I am envious of the future that they are headed into!

I teach high school because youth are our future

At times I am asked, do I miss IBM -- I worked with great people so of course.  Other times I am asked, wouldn't I rather teach at a community college or university -- there are definite perks to that.  However, teaching at the high school level is something that I am enjoying immensely.

In the Exploring Computer Science class, most students are placed in the class as a freshman or sophomore elective.  The students are very honest about whether or not they "like computers" and if they think that computer science is "too hard".  I do my best to show these students that technology in general and coding in particular can be enjoyable and something that is very doable for them.  Others feel that there is very little for them to learn in a CS class since they are already experts using their phones, getting around firewalls, and persisting with whatever the latest game is.

I walk the line between providing enough scaffolding so students thinking CS is too hard can feel comfortable finding some of those little used keys like (), {}. [ ], < >, &&, ||, etc., and keeping my advanced students challenged and extended enough to keep going and learning new things.  But at the end of the day, these students are going to be the ones designing websites, writing software, and running systems that keep society going when I am out of the working world and enjoying retirement.  I want this world to be running smoothly with all of the technological wonders continuing to flow in the future run by these students.

I teach with joy because attitudes are contagious

Honestly, this last reason for teaching is more aspirational than a statement that I can support on a daily basis.  I fully recognize that attitudes are contagious.  When I look at my coworkers I see the ones that are filled with joy every day.  Their energy is something that I want to be around and also something that I project -- on my best days.  Admittedly, I too often get frustrated with lessons that have gone wrong, students that aren't as interested as I hoped, and either the students or the teacher just having a bad day.

On the positive side, I feel that as a second career teacher, I can look at education with a wider perspective.  I know first hand the opportunities and the challenges that will face my students going into the CS field.  I also don't have the worries or the ambitions that teachers beginning a career in education have.  As the article I linked at the beginning of this post stated, there are many reasons that teachers leave the profession, and happily none of those apply to me.  I am happy with this field and the students I meet every day.  And that's a good thing, indeed.

* Images from

Sunday, December 16, 2018

Web Design Reflections and Subgoal Labeling (Arrays)

We just finished the last week of classes at The Pinnacle and are headed towards finals week for semester 1.  My Exporting Computer Science students have turned in their final projects for the web design unit.  And my AP Computer Science students took their last set of notes on Arrays using subgoal labeling.  If you are mainly interest in subgoal labeling, skip to the end.

Web Design Reflections

This is the second year of teaching a 9-week unit on web design to the Exploring Computer Science class.  I was so impressed with the 3-4 page websites that my students produced.  Some students have a good eye for color and building a website with complementary colors that look good on a page.  They mastered building a set of web pages with a cascading style sheet.  The pages used a common grid layout and navigation bar to move between pages.  All of the students selected topics for their sites that were of interest to them.  Topics ranged from music to anime to sports, and as with all student projects they were of varying quality.

Here are some examples of their work:

Last year I was primarily focused on getting through the material (and honestly, making sure I fully understood how to use HTML and CSS).  This year I added additional opportunities to practice a skill before having students create a project.  As I look back at the end of the unit I am seeing places that need improving for next year.


Many of the students taking this class do not have a great deal of keyboarding experience, and even those that do are not familiar with the keys needed for HTML and CSS.  So the first area that I want to add and improve on for next year is to have a section on finding some of those keys that are not often used in normal typing but come up frequently in HTML and CSS:

  • angle brackets for all of the HTML tags < >
  • slashes  used in ending tags / (and distinguishing them from back slash)
  • braces used in CSS files { }
  • semicolons used in CSS files for the end of each attribute ;
I was talking with one of our ESL teachers and she gave a great suggestion -- why not make a simple Google assignment where students type in the tags along with all of the special characters 3-5 times so they get accustomed to finding these little used keys in a separate activity.  Thanks Taniuska Worsham (if you are interested in learning about what she does teaching English as a second language as a second gig with VIP Kids check out this link and use referral code TANUI0001)!


I gave students a Do Now activity to look at the which has a great section on colors, color schemes and how to use the RGB values in a website.  Most of the students recorded a color scheme in their journals, but this Do Now was early in the unit and at that time they didn't have a good idea on how all of the different colors would be used in a website.  My thought is that students do need to have a lesson dedicated to selecting colors and that it should be near the end of the unit.  I think it will be a nice light lesson to put in between setting up a grid layout and before setting up a navigation bar.


Although we discussed citations in class, I can see from the final products that most of the students did not use royalty free pictures and did not provide citations to where they got their material from.  Similar to colors I have a note that I need to make this a full lesson as well.  Again, I think this will be a lighter lesson that can be inserted between some of the heavier HTML heavy lessons.

Grid Layouts

The section that caused the greatest amount of difficulty for students was setting up a grid layout.  For practice I had students add the text of a grid section to the HTML document and then practice adding a new section to the CSS file, changing the layout, and then adding in the text for the section to an HTML document.  The completion rate on this assignment was not 100% and it did show in some of the final products.  This lesson needs to be improved and I have added a note that I need to have a second set of practice exercises for this lesson.

Subgoal labeling (Arrays)

First, thank you to Alfred Thompson for giving me a plug in his very popular blog!  I was wondering why the readership of this little blog suddenly spiked.

My learning about subgoal labeling continues.  In the set of notes for Arrays, I continued to use the major labels at the top of the notes and then provide the subgoals in each section.  For this set of notes I repeated the subgoals for the second section and had students complete this section after following the steps with me the first time.

The students gave positive feedback that they liked the idea of having a practice on your own section before they were set loose on the practice on the labs.  The full set of completed notes are at this link.  As usual I give my students the file with most of the code removed and we write it together.

I continue to fine tune this, but feel that I have a pretty good format now.  Thanks again to the original CS ED Research conducted by Margulieux, Guzdial and Catrambone on Subgoal Labeling and Worked Examples.