Tuesday, June 15, 2021

Getting Excited for CSTA 2021

As a member of the CSTA Conference Committee, I attended the first of two presenter training sessions today. Wow! CSTA 2021 will be good. Now I have read most of the proposals for presentations and helped select them so I had a pretty good idea this is going to be a great conference but today brought home a couple of things for me.

The big one is the shear number of online tools that teachers are using to make online (and probably in-person) teaching more interactive and engaging.  I taught online last spring and in a mix of online and in-person this spring but I never had the time to lean about all of these tools. That is mainly because I retired at the end of the 2019/2021 school year and didn’t spend last summer learning about teaching online. I kind of wish I had though.Never say never even about returning to the classroom. But that aside, I am really looking forward to learning at the conference this summer.

CSTA 2021 is going to be awesome! Hope to see you there. So much to learn!

Friday, June 11, 2021

Exploring the Ternary Operator

I’ve never had a lot of use for the ternary operator. Until recently, I think I under appreciated it. I Don’t recall ever using it in professional development though that may be largely related to using languages that didn’t support it. I never taught it to beginners either. Between time available and topics to be covered it never rose to a high enough priority for me. I’m starting to rethink that. But first, what am I talking about?

In C-style languages the syntax is:

(expression-1) ? expression-2 : expression-3

There is a Boolean expression inside the parenthesis, followed by a ? and a value for a true case, a : and a value for a false case. For example:

(Player == WHITE) ? "White" : "Black";

Other languages have different formats. For example, in Python the true option comes before the Boolean expression.

[on_true] if [expression] else [on_false]
>>> x, y = 5, 6
>>> print("x" if x> y else "y")

We actually see this sort of thing in spreadsheets though I never really thought of it as a type of ternary operator. This example from Excel is really a ternary operation

=IF(G10 <  G11  ,"big","small")

Back in the day we had something not all that different in FORTRAN. There was (probably still is) an IF statement in FORTRAN that branches to one of three lines depending on if an arithmetic value is less than, equal to, or greater than zero.

IF ( N ) 10, 20, 30 

But enough history. What really changed my mind about this operator? As is typical for me I revalued it when I found a good use for it. I have been writing a version of the Reversi program in .NET and C#. I borrowed a bunch of Java code from my friend Tom Indelicato (read about that program here) Steal from the best is my motto and Tom is an outstanding programmer. Along with the syntactic changes moving from Java to C# I wrote a lot of code to make the game work in a graphical user interface. I made some different design decisions as well which changed how some things are handled. I created a user control class for the game squares for starters. As part of this I used three different integer values to indicate whether the square held a black disk,a white disk, or was empty.

In the past I have often used a Boolean value to indicate which of two players was the current player. Switching players is pretty simple with a Boolean value.

currentPlayer = !curentPlayer;

That wasn’t going to work if my player indicators were integers. I decided to use the ternary operator because I didn’t want to write multiple lines of code for something that simple. So I wrote:

Player = (Player == WHITE) ? BLACK : WHITE;

WHITE and BLACK are defined constants. The next thing I knew, I was finding uses for this operator in all sorts of places. The really cool thing (ok for a geek like me) was that I could use this statement inside other statements.

message = “No legal moves for " + ((Player == BLACK) ? "Black" : "White");

I guess this old dog can learn new (to him) tricks. Do you use/teach this operator? Are there other language features you have ignored until one day you realized they would be just right for something you were doing?

Thursday, June 03, 2021

Trip Report: Teaching as a Long Term Sub

Well, this is not actually a trip report but its something like it. I spend the last couple of months teaching at Phillips Exeter Academy as a long term substitute. It was an interesting experience for many reasons. Not the least of those was the pandemic precautions.  Everyone wore masks inside and out, there were clear dividers between all of the seats around the table (more about that table in a minute), and for most of the time faculty were tested for COVID twice a week. I was fully vaccinated before I started there and the school ran vaccination clinics for faculty and students during the term.

Phillips is different from most other schools. It is the literal definition of an exclusive New England boarding school for a start. With a very competitive admissions process one is not surprised that the students are smart and highly motivated. Many of the students I talked to were looking for more academic rigor than their local schools. Needless to say classroom management was never even close to an issue.

As I alluded to earlier, classes at PEA are taught around a table. It’s a big table but class size is limited to about 13. None of my classes were larger than 12 and two sections were 10 students. Yes, that’s wonderful for a teacher. Between the small class size and teaching around a table it is not easy for a student to get lost. Teaching around a table forces a more conversational method of teaching. Its very interactive. I really enjoyed the format.

Another part of the system there is something they call METIC. I forget what that stands for but basically what it is is a mid-term check in. Students in the class are given some time without the teacher present to discuss what was going well in the class, what is not going well, and what students and teacher can do to make the rest of the term go better. Now this can be hard on the ego for some teachers especially if students are hard on them. My students, and from what I hear  most students at PEA, are very respectful and honest. Following time without the teacher, the teacher returns and the items the students brought up (written on the white board) are discussed. For me as a new comer to the particular school environment this was extremely valuable. This is something I wish had happened earlier in my teaching career. I think it would have made me a better teacher.

Everything was not all smooth sailing of course. I took over the course in the fourth week of the term and my students had two other teachers in the first three weeks. Figuring out what students knew and didn’t know took me a while. I also had to figure out a plan for the rest of the term. Fortunately, other members of the CS department were incredibly helpful and supportive. I was give full access to curriculum from a previous time these two courses had been taught. This saved immeasurable amounts of prep time.They were also always available for my many questions about the courses and the school’s processes.

As I alluded to in my earlier post (Back in the Classroom Again) I had to reacquaint myself with Java and learn my way around two IDEs (Eclipse and Processing) that I had never used before. Its tough answering questions about IDEs when you have no real experience with them. Fortunately I am good at exploring menus and looking up things on the Internet. I’m far from expert at either IDE but I’m not totally lost either. I found Processing and its graphics library fun and interesting. My old experience with XNA from years ago helped me out there. Though I do wish Processing had some built in collision detection. Probably good for students to figure out and code that for themselves but I’ve been spoiled by .NET. I would use Processing again for Java.

Overall, I had a great experience. I learned a lot, got to work with great teachers, and teach some awesome students. I’m not unhappy about getting back into retirement though.

Thursday, May 27, 2021

Othello/Reversi for After the APCS Exam

My good friend and former teaching partner, Tom Indelicato posted about his end of year project for his AP CS A student recently. With his permission I share it with you.

I said goodbye to my seniors today (last day of classes for them). We wrapped up the post-Exam project (I gave them the framework for a Reversi / Othello game, and they wrote an AI for it) by having them play against each other. I put up a randomized tournament bracket, and awarded a $10 Dunks card to the winner.

An incredibly good class of students, they told me that they thought this was the greatest final project ever! I'm gonna miss them.

Tom also generously shared his framework code at https://1drv.ms/u/s!AmXKuaTMPmyCpVBNCyiB0h3t5uWi?e=j9Gv1N

Interestingly, a similar project was in the Nifty Projects session at the CSTA Annual conference in 2018. Unfortunately the GitHub code repository that was associated with it seems to have disappeared. There are other related and useful resources still there at https://sites.google.com/.../roger-jaffe-othello-competition

Most likely Tom's framework would fit along with it with a few minor tweaks.

Tuesday, May 18, 2021

Learning From My Students

Being back in the classroom has been a learning experience for me. For one thing I have had to learn a bit of Processing (the IDE) as students had been using it prior to my coming in as a replacement teacher. That’s been fun actually. And learning Processing has been on my to-do list for a while. It’s a pretty useful tool and makes graphics programming in Java almost as easy as C#/Visual Basic and the .NET library.

I have had to get reacquainted with Java as well. That’s more of a refresher than a new learning but students have given me some fresh insights into using it. One of the disadvantages of having programmed for so long is that my mindset is, to some extent, stuck in old ways of thinking. Take for loops for example. I am rather stuck in the idea that the comparisons in a for loop are just simple single Booleans when of course the Boolean expression can be a lot more complicated than that. My students are not as stuck so they suggest various options. That has been helpful in broadening my thinking.

CodingBat is a web site I have come to appreciate as well. I’ve known about it for a long time of course but never used it before because I wasn’t teaching either Java or Python. It includes a lot of very good projects that make for great homework being web based. It’s a little like Code Hunt, which sadly no longer exists. CodingBat is easier for beginners to use though which is a plus.  I found it very useful and recommend it to other teachers.

For one course I have had to review my knowledge of some data structures. Again, a refresher rather than all new learning but I think I picked up some things I either forgot or never knew. (Memory is a fickle thing)

I’ve also learned some things about teaching but that will be another post at a later date.

Thursday, May 13, 2021

Which Sort Do You Use?

My algorithms class is studying sorts this week. I felt like we needed a little hands on sorting to get an understanding of how some sorts related to the types of sorting people do. I had a number of decks of playing cards and their easy yo hand out and to sort. I don’t have one deck for each student and watching others sort is boring. You really want to avoid boring this close to the end of the year so I decided that I could split the decks by suit and have enough small decks for each student. Faster is often better anyway.

My students had been assigned some reading on Insertion, selection, and bubble sorts. I was interested to see if they would relate any of these to their chosen sort methods. Not bubble sort though. I wonder if we should even teach that one. But I digress.

The students were asked to sort their deck which they all did pretty quickly. Than I asked them if they used a selection sort or an insertion sort. About half of the students choose each one. This led to a good discussion of the two methods. It made for a good exercise introduction.

As a side issue, I had my beginner class separate the decks into suits. This was part of a discussion about While loops and the need to properly plan for data storage (the four output files), That it meant I didn’t have to do the separation was a nice side benefit.

In both classes, we had a brief talk about parallel processing and breaking a problem up into parts that could be run in parallels by separate processors. I take my lessons where I find them.

Sunday, April 25, 2021

Back in the Classroom Again

“What would motivate you to come out of retirement to teach during a pandemic?” That was the question I was asked during an interview for a long term substitution position.  My retirement last June had been planned for a year or more. I was very content in retirement. I wasn’t bored, COVID restrictions were not being particularly hard on me.So why was I considering this opening?

My wife and I were fully vaccinated so going back was not as scary as it had been but that just made the decision possible. There were really two reasons I was open to the idea. One is that the schools was Phillips Exeter Academy.  They have small classes (I am now teaching two classes of 10 and one of 12) and they teach around a Harkness Table. I’ve long been curious about that style of teaching. The other reason was that they really needed someone in a hurry. The person they initially hired to fill in for a teacher on sabbatical resigned after a couple of weeks into the semester. I guess I am a sucker for that sort of problem.

So what is it like for me? Well, I feel good about the COVID precautions. There are Plexiglas partitions around the table, students and faculty wear masks everywhere, and faculty are tested for covid twice a week. I believe students are tested often as well. Teaching with a mask is awkward and sometimes it is hard to tell which student is talking because I can’t see anyone’s lips move. But teaching more conversationally around a big table is pretty nice.

I have two students attending via Zoom which takes some getting used to but the students are good about it.

The hardest part is jumping in to without a clear idea of what students already know or don’t know. And figuring out how to move forward. The classes are in Java using Processing and Eclipse as IDEs. Both IDEs are new to me and it has been a while since I taught Java. AP teachers may remember the Marine biology Case Study? That was when I last taught Java. Catching up on the IDEs has been interesting. Returning to Java makes me appreciate C# and .NET even more. But we’re managing. Having smart, motivated students and small classrooms helps a lot.

So, how is your school year going?