How I Grokked OOP

Time to get back to CS and CS Ed related blogging.

Last week, in Garth Flint's post about his summer plans, Garth mentioned wanting to get his head around Object Oriented Programming and possibly taking a course to help him get there. I thought I'd talk a little about how I got my head around OOP here and some of the difficulties I faced then and what people might face now.

Nowadays, kids are faced with OOP pretty early on. If they take APCS-A they're using Java which is Object Oriented. Same if they start at a college using Java. If they start with C++ or Python they may or may not see objects early on. In any event, the nature of that first course doesn't really lend itself to really grokking OOP. Even if a student takes a class prior to APCS-A or it's college equivalent, they're pretty y raw. Small programs with just a few constructs don't really show the uses of OOP. Both inheritance and interfaces can feel forced in a first year course and when the examples are artificial and wonky and their are easier ways to accomplish the same task, it's hard for a student to really buy into the paradigm.

Now, in all fairness, I'm not a big fan of Object Oriented Programming and it's usually not the first tool I go to. That said, it's a useful tool and it has it's place.

I cut my teeth in the 1980s. I went to the Courant Institute at NYU. The core language back then was Pascal which had a number of limitations including only supporting single file programs. Somewhere along the line I taught myself C which most professors were happy to accept assignments in. I never heard of OOP in my formal schooling. Some time near or soon after I graduated I had heard of this C++ thing but hadn't used it.

After working my way through school I spent some time as a developer at Goldman Sachs. I was the only guy on my team doing Windows 2.1 development. Windows 2.1 was built on top of DOS. It's big improvement over Windows 1.0 was that it supported overlapping windows. Pretty cool.

Windows_2.1.png

I learned to program Windows like everyone else:

pw1.png

It was all done in C. The big project I was on was for Global Equities. Specifically, supporting trading of Japanese Warrants. I had to write a trading system and in doing that implement among other things a mini spreadsheet in C from bare metal.

This was probably going to be the most complex thing I designed and built from scratch to date. I had a bunch of cells that were associated with either rows or columns or both and all sorts of complex interactions. I needed a way to manage complexity and even though I didn't use the term at the time, manage state.

C doesn't have a lot of fancy in language constructs to help and I was somewhat on an island - I taught myself C and there weren't any experienced C / Windows programmers in my group or on my floor so I had to figure things out on my own.

Here's what I came up with, or rather something like what I came up with – it was close to 30 years ago and I don't even remember 100% of what it was supposed to do.

I decided to create a single file for each concept -

  • cell.c / cell.h for cells
  • row.c / row.h for rows
  • sheet.c / sheet.h for
  • etc.

In each, I would do something like this:

/* sheet.c */


/* things declared here are "global" but limited to this file **/
struct sheet *sheets; /* an array of the sheets */

/* functions that will be made available to other files */

/* return a pointer to the named sheet */
struct sheet sheet_get(char *name){
/* implementation */
}

/* create a new sheet */
struct sheet *sheet_create(char *name, int rows, int cols){
/* implementation/
}

/* functions that will only be used internally */

struct sheet *allocate_sheet_memory(int rows, int cols){
/*implementation*/
}


/* etc */
/* sheet.h */

/* 
   Note that only the headers for the exterrnally available stuff is included
*/


struct sheet *sheet_get(char *name);
struct sheet *sheet_create(char *name,int rows, int cols);

The idea is that everything about a sheet is in sheet.c and only a few functions are made available to the rest of the program via the header file.

Shortly after I designed the program, I started to delve into OOP at the encouragement of some colleagues. I read Meyer:

3328934.jpg

and the first edition of Booch:

0805353402.jpg

I realized that in a way I was implementing singleton objects in C. The file declared the object. The functions I exposed via the header files were public, the other functions private and the "global" variables that were local to the file, private class variables.

There was no inheritance but it did help me encapsulate functionality and state.

It turns out I saw something like this when I briefly looked at Ada. I think it was called Object Typed Programming - objects with only a single instance and no inheritance.

The books gave me the official names for things but the project I was developing gave me the context to where it all made sense. I had a problem to solve that didn't lend itself to a low level imperative language but you work with the tools you have and this is what I came up with.

Unfortunately, it's harder for beginners as projects are smaller and while there are good small example of OOP there's also so much going on in a course like APCS-A. It gets more convoluted when you're using Python or C++ as you might be shown Objects in a C++ class while professor is really teaching C with Objects rather than doing things the C++ way.

One thing that helps is using a language or tool where objects make sense. NetLogo - used in Stuy's intro course is a nice one. Turtles and patches - the inhabitants of the NetLogo can be viewed as objects. I'd draw heavily on NetLogo analogies when teaching APCS at Stuy. There are also tools like BlueJ which is tied closely to objects and is probably terrific at giving structure to help objects make sense but I don't like those types of tools for other reasons.

At the end of the day, it is just a tool and to be honest, I'm not really a big fan of OOP. I'll use it but it's not my go to paradigm.

I'll leave you with this video which talks about why:

Giving control of NYC's specialized schools to a political appointee

Yesterday I shared my thoughts on Bill de Blasio's plans to "fix" the selection criteria for New York City's specialized high schools. If you haven't read the post, you can find it here.

I was going to get back to CS and CS Ed related blogging today but there's more to the story.

In spite of what BdB stated, it's not enough for him to switch to another measure - the middle school state exam along with some modifiers. This is about ending the exam altogether and not replacing it with anything better. Here's a link to information on the proposed legislation for New York Assembly Bill 10427 including links to the actual text.

There's a lot of beurobabble but the end game is to basically allow the chancellor (not sure if this means city or state) to do whatever they want.

Here are some of the key points:

  • Seats would ultimately go to the top 5 to 7 percent of each middle school's class.
  • These students would have to also be classified in the top 25% city wide.
  • Top is defined by a composite score of multiple measures as determined by the chancellor which means anything goes.
  • Remaining seats will be filled by lottery of all students with a 3.7 GPA or greater.
  • It's not clear how the students would be allocated to each of the specialized schools.

So, what does this all mean?

Multiple measures could mean the state test + average. It could mean average + recommendation. It could be shoe size + favorite color. The chancellor also decides how to weight these multiple measures.

This means that the politicians can do whatever they want to paint any picture they want regardless of how their ideological and political games hurt kids.

Any teacher, in fact, any rational adult will tell you that middle schools are not interchangeable. The top students at one middle school are typically not at the same level as top students at another one. I'm sure you can cluster middle schools in terms of the students they graduate, what the students know and can do and the clusters will likely fall on economic lines. This is the problem that BdB should be addressing not how to rig the specialized school admissions stats.

Even if this is done right, you're assuming an even distribution of top gifted students across all the middle schools. If one school has higher concentration of gifted students, they're out of luck. The end result is that if you attend an SP or other gifted program for eighth grade you'll likely be locked out of the specialized schools. What if a particular middle school is attractive to all of our top math team talent? Only a couple will get in to the specialized schools under the new system since each school is allocated a fixed number of slots.

I guess this does make sense if you don't believe in gifted students or gifted education but then why not just get rid of the specialized schools to begin with rather than playing these games. This "solution" will result in parents having to decide - do I send my kids to the gifted middle school program and hurt their chances to get into a specialized high school or do I try to find the lowest performing school I can find and have my kid stand out. This is pretty messed up.

At the end of the day, though, you have to remember that any change to the process can help one group and hurt another. Stuy, for example has 46% of it's students on free or reduced lunch and is about 70% Asian. If in the new system you're increasing the percent population of an under represented group, you're likely reducing the percentage of Asian students. So, you're creating opportunities for a number of as of yet undetermined students (who might not be properly prepared for the experience) at the expense of economically disadvantaged Asian students who have proven to be prepared for the experience. Wouldn't a better solution be to fix the opportunities presented at the middle schools rather than rig the system of high school acceptance.

Going further, a response on another blog noted that BdB probably refused to do anything with the admissions criteria of the non big three because they all had numbers that he would consider more diverse. The commenter provided the Black / Latino percentages, I added the free and reduced lunch numbers:

School Percent Black / Latino Free / Reduced Lunch
Brooklyn Latin 28% 61%
HSMSE 26% 46%
HSAS 17% 25%
Queens Sci 12% 64%

All the more reason to run some tests or analysis there. Of course, if you look further you'll note that HSAS only has 25% of its students on free or reduced lunch so is it really doing better than Stuy or Sci with ~45% low income students each or Brooklyn Tech which supports 62% or are we to say that there's low income and then there's the right low income?

Certainly the education system needs work but the proposed legislation is not a solution. It's taking a flawed but objective measure and replacing it with essentially chancellor's discretion.

If the legislation passes, by the year 2022 we will have admissions to what used to be some of the nations finest high schools determined by a political appointee rather than an objective test.

It's a shame. It was very important to my wife and me to have our kids go to public schools and I was very happy to have been able to navigate the system with them from first grade through high school graduation with only a few bumps along the way. With this nonsense from the political left and the privatization push from the political right (or actually both sides) pretty soon there will be nothing left.

Changing Admissions to the NYC Specialized High Schools

Yesterday, Bill de Blasio, the current Mayor of New York City outlined how he would "fix" our specialized schools. The schools he was referring to were the "big three" of Stuyvesant, Bronx Science, and Brooklyn Tech and then five additional schools - The High School for Math Science and Engineering at CCNY, The High School for American Studies at Lehman, Brooklyn Latin, The Queens Arts and Science High School at York College, and Staten Island Tech.

All use a single SAT style test, the SHSAT, for admission. The Big Three are locked into that system unless there are changes made by the state legislature. The Mayor can make changes to the admissions criteria of the other five on his own.

The problem, as stated by Chalkbeat writers Alex Zimmerman and Monica Disare is that:

The city’s specialized high schools — considered some of the crown jewels of New York City’s education system — accept students based on a single test score. Over the last decade, they have come under fire for offering admissions to few students of color: While two-thirds of city students are black or Hispanic, only about 10 percent of admissions offers to those schools go to black or Hispanic students.

I normally don't write about things like this but given my history at and with Stuyvesant I thought I should.

Before getting started, my biases - I believe in public schools, not charters, I also believe that a system should have gifted programs and magnet schools and also a mix of large comprehensive schools and smaller niche ones. Additionally, while I do believe in gifted programs I'm not sure at what point it makes sense to start offering them. When we were looking at elementary schools for our own kids we opted for a neighborhood public school rather than applying to the district gifted program as we felt it offered a better overall education. On the other hand, had our kids not made Stuyvesant, I'm not sure what we would have done. Part of that was due to the fact that the Bloomberg administration destroyed just about all the large comprehensive schools so, other than that large test schools and LaGuardia, good luck finding a school that was strong in the humanities, sciences and offered a robust music program.

The overall picture

For reference, here are unofficial cutoff scores for the specialized schools from 2018 along with the NY State data on free and reduced lunch for 2017. Note that there's overlap between the schools. I separated out SI Tech since geography probably affects it's numbers more than the other schools and I separated the big three from the remaining four because I think the three are all substantially larger. The free and reduced lunch percent is important because I believe an entire school qualifies for Title I funding if the number's over 40 so while these schools are not populated entirely by low income students, all but HSAS has a substantial number and there's a chance, some say a good one that at best BdB's plans will merely shuffle which low income kids get in rather than actually solving the root problem.

School Lowest Score admitted High Score Pct free or reduced lunch
Stuyvesant 559 698 46
Bronx Science 518 637 45
Brooklyn Tech 493 668 62
HSMSE 516 616 46
HSAS 516 633 25
Brooklyn Latin 482 555 61
Queens Sci 538 542 64
SI Tech 519 660 40

The plan

Part 1 - test prep

There's idea here is that test prep is rampant for SHSAT and that the test can be gamed. This may or may not be true but if it is then it's safe to assume that a lot of low income kids are doing test prep either by prioritizing test prep programs in family budgets, working off of an SHSAT test prep book or by attending a middle school that has some form of prep.

There has long been a program on the books called "The Discovery Program" which has a free city run test prep component and also a summer component. The summer component is for low income students who score within "a few points" of the school in question's cutoff score. At the end of the summer, I believe the students retest and in general make the school in question.

This program is a good thing and should be reinstated but I don't know if it will result in the changes that BdB is looking for. More likely Stuy will get its discovery kids from Science and Science from Tech. As there are already many low income students at all of the schools there's no indication that this would increase the number of under represented groups which is BdB's goal.

It's also worth noting that there's a sizable chunk of Brooklyn Tech students that don't perform particularly well on regents exams. Everyone knows I'm not a fan of standardized tests and I don't believe that students that score a "few points" lower on the SHSAT are any less qualified to be in a specialized school but at the lowest performing end of these schools, one has to ask how specialized is it really?

Part 2 - use state test scores instead of the SHSAT

This could be a very good thing with one major caveat.

Twenty one middle schools produce over half the students that ultimately are accepted to the specialized schools. For the rest, there are a few reasons

  • Many students don't take the SHSAT.
  • There have been stories of schools steering kids away from the specialized schools.
  • There's no culture in those schools of striving for specialized school acceptance or attendance.
  • The academic programs at those schools don't prepare students for the SHSAT exam for reasons that we're not going to delve into here.

All students already take the NY State middle school Math and English exams. Yes, it would further raise the stakes for those exams but it would ensure that the specialized schools are on the map for everyone,

The big question here is "do the current state exams cover enough material in enough depth to select and differentiate for gifted programs." I don't know the answer to this question. If they don't then using state test scores will be a disaster. If they do, then they could be a suitable alternative.

Part 3 - admissions from every middle school

This is the third part of BdB's proposal - guarantee admissions to the top 10% of students at every middle school.

This could be a real disaster either for the students or for the schools. There's no question that students coming out of different middle schools are at different levels of preparedness for the specialized schools. Arguably the most obvious difference is that some middle schools offer algebra and others don't.

For better or worse, the specialized school's curricula, classes, and overall programs have evolved hand in hand with the exam. If you all of a sudden end up placing a large number of students with a different and arguable weaker academic profile into these schools one of two things will happen. Either the students will struggle immensely or the school will have to lower its standards. There's no two ways about it.

If you set standards for academic preparedness for the specialized schools either by making a hard cutoff on an exam score be it state or SHSAT and then spread those acceptances across all the schools maybe it could work. If not, you're setting up students with high grades at schools with weak programs up for failure.

Another problem is what to do with non-public school students - private schools, charters which take public money but act as private schools, parochial, and home school students. Where do they fall in to this equation?

Is one measure bad?

So there you have my thoughts on BdB's specific proposals but I also want to address his contention that a single measure is bad and makes the comparison to colleges where they by and large use multiple measures. This is a ridiculous comparison. Yes, colleges look at multiple measures but after watching decades of Stuy students go off to college, it's clear to me that the process is by no means fair or consistent. Elite schools can easily game their acceptances and they still can have 100% of their applicants with off the charts SAT scores.

A single test might not be ideal but it can only be gamed by test prep and test prep can be as cheap as buying a test prep book.

As to other measures that come up from time to time - interviews, portfolios, essays - who does that help? The low income kid or the well to do one?

If you're going to add another measure for admission it has to be something that can't be gamed or politically influenced,

Alternatives

Should the city address the fact that there are groups that are under represented at the specialized schools? Certainly, or rather, the city should address deficiencies in opportunities that are like the causes of this under representation.

Should the city be doing things differently? Also yes. Here are some thoughts on what the city can and should be doing.

Do the experiments in the non-big three.

There are five specialized schools that aren't covered by state legislation. Why not run your experiments there. You've got the big three as a control group and what's more if you look at the "acceptance score windows" in the table above, you'll see that there's enough overlap that you can probably get some real data out of these experiments.

Why not change the admissions criteria for one or two of them and see how it goes before jumping in whole hog. Figure out if anything works first.

Check existing data

We've got SHSAT results and State Test score results along with student grades for years. Why not study correlations between them. Rather than making a specious claim about middle school grades in NYC Public Schools vs state tests vs the SHSAT, run the numbers. Take a look at student high school performance based on these predictions. This shouldn't be guess work and city should have the data to do better.

Fix the middle schools

This one is more pie in the sky because no politician really wants to take this one but you've got to look at what's going on in the middle schools and why.

I tweeted this the other day:

The truth is that if you did this, the high performing school would probably continue to be high performing and the low performing one would still struggle. There's only so much a teacher can do. A school with a disadvantaged population needs the resources to succeed - lower class sizes for a start. Add wraparound services, extensive after school and weekend opportunities - make the schools a part of the community and maybe we can get somewhere.

Another question relating to our schools in general is to look at attrition rates to private schools - how many students in our under represented groups are being siphoned off to private schools on scholarship. I don't have any data for this. It could be an insignificant amount or it could go a long way in explaining the downturn in the numbers over the decades.

So where are we

There are a lot of changes I'd love to see in our public schools and I do believe BdB's heart is in the right place. I'm concerned that some of the solutions that he and other politicians come up with will hurt the current low income students at the specialized schools and unintentionally advantage the well to do while not helping those that at least BdB may honestly want to help.

He should enact Discovery and research the State Tests but proceed with caution. The test schools have always been and continue to be a gateway for poor and immigrant students and any changes that are proposed should be weighed carefully and tested before taking steps that could real harm when good is intended.

The Tech or the Teacher

Every morning one of the first things I do is quickly glance at my emails and other notifications. I really should wait until I'm more awake but old habits die hard.

As some of you know over the past couple of years I've been making a series of videos and related post on using my editor of choice, Emacs. I've done 48 videos, have over 2500 subscribers on YouTube and people seem to find some value from the series.

This morning one of my emails was a new comment on one of my videos:

Thanks for not describing a single key combination and how that fits into basic usage of org mode. I was going to subscribe but if all your videos are going to be about showing off how fast you are at typing emacs commands on your annoyingly noisy keyborad, then no thanks!

My first reaction was "you know, you could have said something like 'if you slow down an actually say the keys it would be much easier to follow and would be more valuable' and it would be much better received" but then I started to think about instructional videos in general. I started to make these videos for my students. I thought they might be helpful and then found that the Emacs community by and large liked them. They're not teaching anything deep or complicated just how I use a programmable editor. Even so, I was reminded by this comment about the limitations of videos and ed tech in general.

Videos provide some nice features - you can watch them at any time, you can pause and replay, and in some cases you can watch at super speeds. What you can't do is slow the video down and most importantly you can't ask questions or interact with the instructor. You can leave comments if the video is on a platform like YouTube but that's pretty limited.

On the other hand, if this was a class, we would have been able to interact and I as the instructor would have had a much better chance to make sure this "student" was up to speed.

Of course, this wasn't a class. I don't have the time to teach tools like Emacs in class and since it is a mechanical skill, it can be offloaded to a video. The video has the ancillary benefit of living on and being discoverable and viewable by the public at large. This is a good thing. Videos are tech and tech scales. Unfortunately, good education doesn't.

Videos are tech and tech is the rage. Lots of people are working hard to get more tech in front of our kids - usually at the expense of having a great teacher. This is something we don't need. Technology is nice but I'd rather have my kids in a small class with a knowledgable teacher and a piece of chalk than all the tech in the world.

As a computer science guy and a computer science teacher I think it's good to remind myself that tech is cool but a good teacher is way cooler.

Teaching recursion early? Make sure to use a good tool.

I replied this tweet yesterday and thought I'd expound a bit.

We introduced recursion very early in our intro course at Stuy and I think it worked well. In that course we started by using Racket (nee Scheme) as the first programming unit. Originally we started the kids out first using NetLogo or StarLogo and followed with Scheme but after a few years we switched the order.

I wouldn't always recommend Scheme for a first course and in fact frequently don't but given how the Stuy course was introduced and developed it made sense and worked.

Was it worth doing things this way? I think so. Prior to that intro course becoming a requirement I got to see students coming in from different pathways to APCS. Some came in raw with zero formal experience, some self taught, some through that intro course and some having taken another more traditional intro programming course or experience. The kids who started on Scheme had no more difficulty mastering loops and iteration but had an easier time getting to the more advanced recursive techniques. This wasn't a surprise - it wasn't their first rodeo. This also jived with reports I read at the time that felt that when students did recursion first, iteration was just as easy but when they did iteration first, recursion was harder.

You can of course make a strong case that recursion isn't necessary for a kid that isn't going to study more CS. I'll merely argue that what we did at Stuy worked with that population and I wouldn't change it. At the same time, I've helped a number of teachers design classes and programs where we agreed that recursion first was not the way to go.

In any event, it wasn't that I specifically wanted to do recursion early but rather, there were a number of things I wanted to do with the class for which Scheme made sense and recursion was just one of them.

Some reasons to like (or for some, to dislike) Scheme early:

  • It's functional – everything is a function. While this is technically not true, we can fudge it a bit at this level. You put things in parens so instead of add(a,b) you write (add a b) or really (+ a b). You can also do (+ a b c). Things that would be statements are also functions: (if Booelean TruePart FalsePart) is the if statement. For example (if (>= a b) a b) returns the larger of a and b.
  • Because it's functional it avoids the issue kids have with = being for assignment rather than comparison.
  • It has great support for list processing.
  • Recursion is much more natural.
  • It's a super simple language with simple rules and a simple, small syntax

Of course, Scheme isn't perfect and some people dislike the above reasons. It's also easy to come up with a number of other good reasons not to use a language like Scheme.

On the recursion front, it makes things much easier. There are no loops so recursion develops as a natural form for repetition:

(define f (lambda (x) 
	    (* x  (f (- x 1)))))

This defines a function that takes one parameter and returns x*(x-1)*(x-2).... It repeats, but never ends. This leads to adding a base case:

(define f (lambda (x)
	    (if (< x 2)
		1
		(* x (f (- x 1))))))

Which is your basic factorial function.

Since this use of recursion for repetition develops naturally as we introduce language concepts it's easier for kids to get their heads around it as opposed to when they've seen loops already and have an "easier" alternative. You can make the case that you could introduce recursion this way in a language with loops like Python but once loops are available and particularly when loops are idiomatic, students will find them and getting them to think recursively will be more difficult.

Scheme and most other functional programming languages also have strong support for lists and list recursion. This means you don't have to limit yourself to mathy problems. Think about a todo list:

  1. Go to the market
  2. Buy a gallon of milk
  3. If they have eggs, get a dozen (heh heh)
  4. Go home

Processing a todo list is really a recursive problem:

  1. If the list is empty you're done
  2. Take the first item off the list
  3. Do it
  4. Recurse

Once you start working with lists, you can play with all sorts of recursive examples.

At the end of the Scheme unit the big project is creating a sentence generator. The kids don't know it but they're learning about grammars and in fact are writing a recursive descent parser - they just think they're writing a program that creates silly sentences. It's a really nice project that uses recursion in a way that's different and I'd argue more fun and interesting than the usual approaches.

I chose Scheme for a variety of reasons. I also chose NetLogo for specific reasons. Unlike Scheme (or most other popular learning languages), NetLogo is really all about agent based parallel processing. There are concepts that we can explore easily and in depth with NetLogo that would be tremendously difficult in any other language and at the same time, there are things that are easy to explore in other languages that Netlogo doesn't lend itself to.

So, in the end, this post really isn't about when to teach recursion. It's more about how languages lend themselves to solving different problems and teaching different concepts in different ways. If all you have is a hammer, everything looks like a nail. Fortunately, we can do better.

Is Cs for All Worth Doing

Last time I mentioned the pushback on CS for All. While many people are all in for CS for All, resistance is coming from many areas. There's resistance from teachers of other subject areas, people who think it's merely job training for the tech industry (which it can be if done poorly), people who feel it will be implemented at the expense of other important subjects already on the chopping block like music and art, and others.

When I started the intro course at Stuy I tried to design something that would be of value to all Stuy students and also inspire some to continue on to more advanced CS classes. The class has been a requirement for well over a decade at this point. I know that not everyone loved the course but as they say, the proof is in the pudding. It clearly got more people into the pool as gender numbers for our more advanced CS courses got and remained much better since the intro class became a requirement. I can't tell you how many people now in tech have told me that they never considered CS and only got into it from our intro course.

So, we had CS for All at Stuy before there was a CS for All and if exposing more kids to CS was the only benefit it would have been worth it but there's more. In addition to getting more people and more underrepresented people into tech, I've had scores of kids in a huge range of fields come back to exclaim the value of having been forced to take our intro course. These kids became authors, lawyers, entrepreneurs, (non CS) teachers, journalists, venture capitalists, Wall Street people, (non CS) professors and researchers, and more.

The benefit of being in the latter stages of a career is that you can look back at years of results and see the good and the bad.

There's no doubt in my mind that the battle to get a good CS course to every Stuy student was one worth fighting and winning.

Should CS for All be implemented at the college level?

There's been a lively discussion on pushback to CS for All at the K12 level over on Facebook. Mark Guzdial started a sub thread asking if CS for All should first be implemented at the undergrad level rather than K12.

It's an interesting question and as good as anything to get me out of my month long non-blogging rut.

Mark was right when he said that if Colleges implement CS for All, K12 will likely do so to follow - just look at AP. Colleges have been saying that students should take more AP classes (while giving less credit) and we all know where that's led.

On the other hand, can colleges really do CS for All, what does it mean and what would it look like.

Much like there is no single K12 - it's 50 states and who knows how many independent school districts, there won't be a single CS for All at the college level but let's think about how things could play out.

Many colleges have distribution requirements. Students must take one course from bucket A, two from bucket B etc. Many schools that I've looked at already count CS courses in one of their distribution buckets. This doesn't mean every student will take CS but in theory means they can. Colleges could in theory create a required CS bucket or even a required CS course but I don't think it's as easy as that. It might be at a private institution but while I don't know all the ins and outs of Hunter's governance rules I do know that adding a universal student requirement is a HUGE undertaking.

So my take is that while it might be easy for a private college to add a CS requirement I'm guessing other public institutions are more similar to Hunter and it's not going to be an easy task.

Regardless, let's say we have a required class on the books. Will we have the capacity to teach it? It seems that schools are struggling to deal with their existing CS majors and running sufficient electives and courses for them. Just a month or so ago there was an article about a college ending its CS minor due to lack of resources. It doesn't sound like a radically different problem then that faced in K12. Maybe it's harder given that at least in NY, there is room for a required CS course if you can find the teacher.

Even so, assuming we have the capacity to enroll every undergrad in a CS course what would that be? I think most people would be in agreement that it shouldn't be CS 101. Maybe existing pre-major courses but even there I don't know if that's always the best path. There could be a great pre-major course to give students the basics and lead some into the major but what about a CS course for students in majors that need some deeper but focussed programming skills. The appropriate course for them isn't the same as a general/pre-major course. Using Statistics as an example, at Hunter, many majors require a statistics course which is off loaded to the Stats department. Each major has slightly different requirements. Over years, the end result is a course that it seems that nobody is happy with - a least common denominator course. CS for All at the college level could give us a least common denominator course that doesn't serve anyone.

Now, if you have the resources, none of these are issues. A well heeled private institution can run tons of sections of specialized classes no problem but this means just like on the K12 level we'll get the CS for All tale of two cities that I see coming in NY where the rich schools have good programs and the poor get a substandard experience.

With all of this said, I'm finally getting to the big red flag with college CS for All and it's an issue that everyone conveniently ignores. I'm talking about teacher quality. One of my big takeaways from SIGCSE is that college faculty are well behind K12 teachers in terms of pedagogy and I don't see this changing anytime soon. This is to be expected given that professor's career advancement is really based on research. Having a good teacher is always important but it's even more important for non-major students since a student in the professor's major will at least be passionate about the subject area. To me, this is not a recipe for success.

One can certainly make the claim that we aren't any better off right now at the K12 level because we don't have teachers who know either the subject nor how to teach it and at least at the college level they know the subject matter. This is very true and it's why pre-service CS teacher preparation is so critical to getting this right even though it will take time. That's something that both Mark and I have been vocal about but more on that subject next time.

Is there room for CS for All

A fear revolving around CS For All concerns where will the money come from and how will we fit in the new classes.

One suggested solution is to integrate CS into other subjects. I thought I'd write today about why I don't think the fear is valid and while integrating CS into other classes can have value, it probably isn't a long term solution for CS education.

Let's start with the integration solution. The idea is to bring CS into an existing class. Bootstrap, a program I've written about before and one of the programs I like does this, primarily in Algebra. The idea is that this supports the student's learning Algebra while exposing them to CS. It's a nice program but a math teacher using Bootstrap shouldn't be confused with a computer science teacher. They're bringing some CS to their student and engaging the students in a different way mathematically and that's all great but in general you can't take two classes worth of material and concepts and fit them into one class and the number of teachers who are truly knowledgable in any two academic subject areas both in content and pedagogical content knowledge is few. I'm guessing that one of the reasons that Bootstrap works in Algebra is the alignment of the toolset and Algebra and how you can teach it. The other is that Algebra is frequently given more time for fewer topics. In some struggling schools, students might have two years of algebra or a double period so there's time to add in some CS.

I'm all for cross curricular work. You can look at applications of science in math classes, do mathy work in a CS class, run stats and data analysis in math and CS classes on materials from History classes and all of this is great. You can even create great combined curricula where you do indeed teach multiple subjects in an integrated way but to think that you can take what is typically taught in two different classes and you can combine both so that they're taught in one class with one teacher sounds fishy to me.

So, at the end of the day, if you go the integration approach you're either going to have to dedicate a similar set of resources both in time and personel to having independent courses. The alternative is that CS will be the second class subject.

So, let's look at actually bringing in CS For All as a separate course.

Here are the New York State Graduation Requirements 1:

Subject   Number of semesters
English   8
Soc Studies   8
Science   6
Math   6
LOTE   2
Arts   2
Phys Ed   4
Health   1
Electives   7
Total   44

It can be difficult to fit Phys Ed in since it has to be offered every semester so let's double the Phys Ed requirement to 8 semesters. What is actually normally done is to have 7.5 periods of science a week and 2.5 periods of Gym.

This means that the basic student program uses 48 class slots and includes 7 elective slots.

In terms of exit exams, students have to pass the following Regents:

  • English
  • Any single math (Algebra, Geometery, Alg 2 / Trig)
  • Any single Social Studies (US History or Global History
  • Any single Science (Living Env (bio), Chem, Phys, Earth Science)
  • Any additional Regents exam

The requirement of passing a single Math regents is what leads to the extra time allocated to Algebra that I mentioned when discussing integrating CS into Algebra above.

To get an Advanced Regents diploma you have to pass additional exams - both history, all three math, three science and maybe more.

Using a Typical 7 period plus lunch day, we have room for 56 single semeter classes in a high school career. This means that assuming students aren't failing too many classes, even with the extra Phys Ed allocation I mentioned above we can easily fit computer science into our day. In fact, we can technically fit in four full years assuming a student doesn't have to repeat any class.

So in New York state we certainly have the time but what about the budget? That's not an issue either. The state also requires that students recieve 5.5 hours of instruction a day exclusive of lunch. At 47 minute periods, that translates to students being assigned 7 instructional classes a day which means we can't just give the kids the required 44. We have to fill all 56 available class slots over those four years.

Of course it's not really that simple. Students fail classes and have to repeat them and some classes might be assigned more time than others but it looks to me like we should be able to fit computer science in without any big budgetary or scheduling changes. The challenge will be finding the teacher and working the internal politics and policies since as computer science comes in it will mean removing some electives even if those electives are additional years of science, math, or English.

Programs like TEALS and Bootstrap are important transitional programs and even when we do have qualified CS teachers they will play an important role - TEALS in providing industry support and resources and Bootstrap by integrating curricular areas and over time as preservice programs start to appear the rest will work itself out.

Footnotes:

1
The state lists by credits which are a year, I doubled the numbers to map to semesters

Unfunded Mandates and CS For All

This morning, Mark Guzdial wrote about unfunded mandates and CS for All. Unfunded mandates frequently wreak havoc on schools in a number of ways but in the long run, I don't think it should have a severe effect on CS for All. Rather, it could have a big impact on the number of CS courses we offer beyond that.

Mark relay's a story from the Cambridge Rindge and Latin School where at the time many students wanted more CS classes but the school wasn't planning on hiring a new CS teacher. The money quote is:

Over 50 percent of students signing up for Level 2 [computer science] courses next year identify as African Americans,

No, I'm not talking about the diversity issue raised by the quote, I'm talking about Level 2 [computer science]. This implies that the students already had Level 1 computer science. Level 1 would cover CS For All so now we're talking about CS electives vs other electives. This is something I had to deal with for most of my career even after we got a CS requirement at Stuy. It was always a battle to hire enough CS teachers to meet demand. The hard part was politics - there were always older more entrenched subject areas who would rather force kids into their electives rather than allow them to take my CS electives. This is a whole other kettle of fish than CS for All. It's an issue for some schools now and will become a BIG issue in five to fifteen years when a single CS required course is more the norm. The issue raised here is a new CS elective vs entrenched teachers and classes which shuld lead to a discussion of the relative value of CS electives vs other electives. That said, the reality is that it usually comes down to school and local power and politics. Also to be considered is the potential ebb and flow of interest - there might be demand for 5 more CS classes and 5 less something else this year but there might not be next year and then we're in real trouble staffing wise.

Schools, public high schools in particular are zero sum endeavors. You have a fixed number of periods a day, specific class requirements, and certain mandates as to a the minimum and maximum number of classes a student can take. In New York City, I believe students are required to have a "full" schedule which basically means they can't come in for English, Math, and History and then go home.

With CS for All, you're basically allocating reallocating some amount of time to computer science. It might be hard to find a qualified teacher. particularly in a small school where the population won't support a full time CS teacher and it might ruffle the feathers of the teachers that will be losing the time but it shouldn't make much of a dent or really any dent on the budget.

Mark also raises the possibility of embedding CS into other subject classes. Bootstrap is a program that I'm rather fond of that does just this in Algebra classes (although more recently they're working to branch out into other subject areas). Even though I'm a big Bootstrap fan I don't think that's the answer to CS for All or CS in the high schools in general. I think that one of the reasons why Bootstrap works so well is the alignment between the CS tool they use and the way Algebra is or can be taught. Another reason is the fact that while Algebra is the lowest level of the traditional high school classes, it's frequently the one for which the most time is allocated. Students in low performing schools might take Algebra over two years or have a double period. This won't be the case for other subject areas. What this means is that there's more likely extra time to embed another subject, cs, into the Algebra class. Long term, embedding CS into another subject area requires:

  • a teacher that really knows both subjects
  • enough time so you can add all the cool CS content while still preparing the students for both the next level of whatever subject you're embedded in as well as for whatever standardized assessments come at the end of the year.

As I said, I'm a Bootstrap fan but I don't think that's the answer for CS in K12.

Back to the original topic there are certainly issues with implementing CS for All but I don't think school funding is the biggest hurdle. For me there are other big challenges. One is having a supply of qualified teachers. In the long run as states outline CS requirements and pre-service programs crop up this will work itself out. Until then, yes, we will have an issue and yes it will take some funding for stop gap and transitional teacher preperation. A second issue is working the internal politics. Adding CS does mean removing something else or more likely a piece of something else. The third one is what I'm noticing in NY where CS for all seems to at times forget about the CS. If we have knowledgeable teachers we can work around that one but I still think that might be my biggest concern.

Pull Requests and Other People's Code

One of the things I've heard for years from former students - both those looking for jobs and those looking to hire is that colleges don't really do a good job preparing students for careers in tech. Sure they teach the algorithms and the theory but ther are a lot of missing pieces, particularly on the practical end. I'm certainly not advocating turning CS programs into coding schools but there are many low cost opportunities to bring practical real world best practices in to the CS classroom. I most recently wrote about unit testing and had earlier about using GitHub as an educational tool. I've been happy with the way I introduce students to Git and how we use GitHub in my classes but I've never found a smooth way to introduce Pull Requests. A pull request is basically a mechanism by which one can suggest a change to a project even if you don't own it. The project owner can then decide to merge it in or not.

Being comfortable with the pull request work flow is an important part of contributing to open source projects. The basic process is that you make a copy of the project you want to work on by forking it, make your changes, then issue a pull request back to the project. For a beginner, there are a lot of moving parts. Instead, I teach my students branching and merging within a project. It's much easier and arguably more useful for day to day projects. I'd like my kid to learn the pull request mechanics but I haden't thought of a good way to do it.

I've also wanted to give kids more real world experiences in class and one experience they rarely get is working in other people's code bases. In school you largely write your own projects be they group or solo or work off a hopefully tried and true code base provided by the instructor. In the real world you're frequently working off of someone elses code and it's rarely in a polished state.

I finally found a way to kill both birds with one stone. A couple of weeks ago my class' lab was rather lengthy. It involved reading in a source file and reformating it in a sensible way. I knew most of the students wouldn't finish it in the allotted time and even if they did, this was an easy assignment to extend. On lab day I had students create a new repo for this lab (normally they just add a folder in a their "labs" repo) and get as much done as they could. The rule was simple - push what you've got up to GitHub at the end of class and then you can't push anything else. I also made it clear that I didn't expect a completed lab..

We continued the lab in the next class session. This time. I randomly assigned repos to students so that they would fork someone elses lab. They then had to complete the lab on the other students code base and then issue a pull request back to the original

This was the first time I've tried this so it was a little klunky. I'll do a much better job specifying the assignment and instructions next time around but even so I think the class went well. By the end of the class the students had sucesfully forked a project, issued a pull request, and merged one in to their own project. The only think I wasn't happy with was that many of the merges happened automatically. I have to figure out how to set things up so that there are merge conflicts since I want my students to experience that.

Overall, I was very happy with the way things worked out. The students were able to experience important real workd software engineering techniques without removing any of the academic CS in the class.




Enter your email address:

Delivered by FeedBurner

Google Analytics Alternative