Blight Move

It was Jon and Amy's wedding. Jon was my student back in the day so there were a handful of Stuy alums there to celebrate the occasion. Some, like Jon, I had stayed in touch with and now count as friends. Others, I knew but hadn't kept up with.

I was with a cluster of guests and for some reason the conversation turned to chess computers. I started telling a story about the my former teacher Herb Greenhut's Talking Chess Challenger computer. You would type in your move using modern algebraic chess notation using a kaypad and the program would not only respond by displaying it's move in said notation but also speak it in it's best War Games voice.

D5 TO E6 - PAWN TAKES ROOK

Herb had a friend Dan, who was a decent chess player but nowhere good enough to compete with someone at the theoretical level of the Chess Challenger at it's higher levels. Even so he came up not only with a way to beat the computer but also to cause it to have a nervous breakdown.

Dan figured that the computer assumed a sensible opponent so when it considered its next move it built a tree assuming the human player would try to find strong moves. Dan would play crazy outlandish moves so that the computer would have to spend all its time working through game trees and then settle on a bad move having not found the right move path. Dan didn't know anything about computer science, search trees or Alpha Beta pruning but he was a smart guy and just figured it out.

At one point, he made a crazy move and the computer responded something like "C4 TO E5" and all of a sudden, I hear blurted out from a voice from across the wedding reception "BLIGHT MOVE!!!!!!!!"

I looked over and it was Mikey, a former student who I had not kept in contact with who had finished the story. What had happened is that the computer had started to create new pieces. In this case a "blight" which we eventually determined could move as either a bishop or a knight.

The cool thing to me was that this was a dumb story I told my classes in 1994 or 5 and here we were some twenty years later and Mikey remembered it.

You really never know what your students will remember about you or your classes years into the future.

I was reminded of this when I saw this tweet the other day:

I don't know the context of the quote but Adam Boxer's reply in the tweet stream seems to indicate that it comes from the thought that they won't remember the content so it isn't important as long as the kids feel good about themselves. The truth is that as a K12 teacher we're responsible for both the students development in the subject and also as a person and while people might not remember the name of the teacher that taught them anything in particular and in spite of people saying they learned "nothing in school" the truth is there's quite a bit that most people do learn from their teachers.

In terms of how students feel, I'm guessing there are some kids who felt that I made them feel smart or capable and probably some that I ended up inadvertently turning off but the majority probably didn't feel much of an impact in terms of how I made them feel.

On the other hand, it's pretty amazing the range of things they do remember. Some academic, some ancillary, some just plain silly.

I heard through a secondary source that Liz, mamy years out still remembers the recursive sock puppets I use. Since Liz is a successful software engineer I'm guessing she remembers the recursion as well.

Blake told me last year that the short edit, save, test, commit cycle I used made an impact on him. That's something I mention but really mostly model in class.

A couple of years ago, when out in California, I was visiting with Pawel who was in my class in the early 90s. He reminded me of a lesson that really made an impact on him. It was on a day when I decided to throw the planned lesson out the window and ended up working thorugh how I would approach and try to solve one of the recent USACO problems going from reading the problem to working solution.

Of course they all remember the Halloween costumes but that's neither here nor there.

I've had students tell me other things they remember. Sometimes, I don't even recall saying them. That's an important point. It might be a throwaway line for us as teachers but it can have a huge impact or at least be really memorable for the listener.

It's just another reminder of the impact we can have and the responsibility we must take seriously as teachers.

Creating a school for CS

Do we really need CS focused high schools?

That's the question Alfred Thompson asked partly in reaction to my post talking about Bill Gates' visit to AFSE, a NYC public school with a CS focus.

On both posts, Michael Preston shared some important and good points about AFSE as a starting point and gateway that helped lead to CS4All in NYC and also specifically about AFSE.

In response to Alfred's question I thought it was time I shared a bit about what I was pushing for AFSE back when I was involved. I wasn't able to talk publicly about any of this at the time because I was warned very sternly by one DOE person involved that I shouldn't talk to "outsiders" about my concerns or designs. In retrospect, since I stopped getting replies to my emails and was apparently dropped from email lists after they selected their founding principal, I probably should have been more public about my critiques. On the other hand, I should have been more politic internally prior to getting to that point.

Reading Alfred's post, what I was pushing for AFSE at the time cuts right to Alfred's question so I thought I'd write about it today.

Before starting though I want to be absolutely clear about one thing. This is not a critique of AFSE as it stands. There are some great teachers and wonderful students there and I do what I can to support both whenever I can. This is a post about my design vs the DOE's design and later implementation. Also note that the numbers, sizes, restrictions and designs are all based on NY state and NYC requirements along with what one can typically do in a NYC public school.

Even though it's the least important issue with respect to a CS school or not, let's start by getting the dirty word out of the way. Given the stated mission of the school (at the time) I wanted a screen. Not a "Stuy test" screen but something. Probably something more along the lines of the screen used by the Manhattan Science Hunter High School. We never got that far in discussing it. My contention was and still is that if you want to produce "Google ready" software engineers by high school graduation, particularly in a small school, you can't start with kids 2 or 3 years behind in math. Now, if your goal isn't "Google ready engineers" but rather to use CS to engage a population that isn't otherwise engaged, I can get behind that and you don't need a screen. It's important however to note it's a different mission.

The DOE would maintain that you don't need any screen and kids can start out years behind and by the end of their senior year they'd be years ahead. It doesn't work that way.

They'd ask tech people at meetings what they looked for in employees knowing that they'd get back "teamwork, creativity etc." I would of course follow up with "where do you look for these candidates" and they'd say "MIT, Cal Tech, Harvard."

The DOE insisted on no screen. This is fine but it's no surprise that Google's not beating down the doors for AFSE graduates right out of high school and the math regents show that you indeed can't take kids from multiple years behind and end up with them multiple years ahead given typical school resources. They're doing really good work there but there's no such thing as a miracle school just hard work and incremental progress. I have heard more than once that the founding principal had lobbied for a screen so I feel my original assessment was correct.

Next up, size. The DOE insisted on a small school focused on CS. They wanted a school of around 136 kids per grade, which makes for 4 "homerooms," and that the school would focus on CS. My proposal was very different. I advocated for a school with about 340 kids per grade and not specifically focused on CS but rather with a great model CS program - a Software Engineering Institute at the blah blah school if you would.

A small school can't support a wide range of classes. With 4 classes of kids per grade you don't have a lot of schedule flexibility in terms of class levels or electives. You also have very few teachers per subject - for a subject taught for a full year every year for a single period, you'd have one teacher per grade in that subject. If you're a school for CS you're not going to be able to offer a robust schedule of music or arts classes. Likewise an arts school is going to be hard pressed to offer a suite of science electives. Remember, public schools are not flush with money and can't just offer loads of courses for a handful of kids.

What we end up with is a school with limited offerings beyond CS and we're asking kids to decide in 8th grade if that's the career path for them. This is a hidden problem of all small schools. Kids shouldn't have to decide on their future in the 8th grade. They should all be able to go to schools that offer a wide range of subjects to a good degree of depth. Only large public schools can do this. I know that public schools come with their own problems but this is one of the trade offs. I believe that having this selection done in 8th grade along with the tech stereotypes and preconceptions is a big part of the schools difficulty in appealing to girls.

Now even if every student who applied and is randomly accepted into AFSE does indeed want to be a CS person then we've also lost because we've done nothing to get more kids into the pool. It could still potentially function as a model school in terms of courses or possibly pedagogy but it won't expose and inspire anyone new with respect to tech.

Let's contrast that with what I proposed. I wanted around 340 kids per grade or 10 "homerooms." How did I arrive at that number? It wasn't just a guess. Schools like Stuyvesant or Brooklyn Tech are clearly too large and impersonal but small 136 kids per grade schools are too small. The 10 homeroom per grade school seems to be the best compromise. There are enough teachers so that there's institutional memory when one leaves, enough of them and students for a varied set of electives. It also means that there are enough teachers to avoid bad fits between teacher and student. At the same time, it's not so large that kids get lost. I also spoke with some of the best programmers I know - not computer programmers but people who schedule students for classes in schools and this seems to be the best compromise size range. Also, with this size you don't necessarily need a screen if you want "Google ready" software engineers. There will be enough of a range kids that come in behind and kids that come in ahead can get what they need.

I also didn't want it to be a CS school but rather a school with great CS. That way it would appeal to a range of students. Kids who think they want to do CS and those who don't. At the end of they day some of the kids that think they wanted CS won't want it and those kids will have other options. At the same time some of the non-tech kids will take the required CS and find out that "this is neat stuff" and we get to increase the number of people in the tent.

I still believe my design would have worked out better but that's not to say that I don't think that AFSE has been and is important. As Mike pointed out in his comment, AFSE was the first unscreened school to offer legit and it did (and does) offer a place for CS kids that don't get into or don't want to go to a place like Stuy which is very much a large school and an unforgiving machine. It was also a showpiece that helped pave the way for CS in all NYC schools. All of that's good.

I do regret parts of what went down between me and DOE. I don't regret sticking to my beliefs in terms of school design but I would like to have been able to handle the politics of the situation better. Had I remained involved I think I had more to offer. I don't regret it too much – at the time it went from the DOE telling me one week to "you can have any role in the school you want" to the next week "we want to introduce you to the person who we're making principal" and I recognize that I'd have a hard time putting that aside now and the me of a decade ago would have found it impossible. That said, I think everyone would have been better off if both sides could have played things better.

I'd still love to have the chance someday to set up and run a school of my design with my team. It'll probably never happen but it would be nice.

"

That Time Bill Gates Visited AFSE

AFSE stands for the Academy for Software Engineering. It's a public school in New York City with a stated focus on, well, software engineering. I have some history with the school and its creation but that's not what this post is about. In fact, this post isn't really about AFSE at all. I plan to neither praise or critique the school. This is about what Bill Gates wrote about his recent visit.

I don't know the circumstances of the visit but I'm guessing it wasn't a surprise. More likely it was a scheduled visit and the school, at least to some extent put on the usual dog and pony show. Teachers know all about this – the superintendent's coming - make sure your bulletin boards are all set. Let's nudge the guest to the right classes, let's make sure to show our best side. I could be wrong, this could have been a surprise visit or Bill could have gone into random classes talking to random students but that's unlikely.

Bill says that "Unlike some specialized schools there are no criteria for admission." First, it's not a specialized school, it's a themed school just as all NYs small schools are. That's just another way of saying "small school that can't support a robust elective program." Bill sounds to be still enamored with small schools. In the video accompanying his post, Bill describes the school by saying "The idea is it's a small high school with teachers that want to engage students on a very personal level and come up with a personalized learning plan…" I guess teachers at larger schools don't want to engage their students at a personal level? Personal learning plan? That inherently has nothing to do with small schools but it does sound like it has something to do with software he can sell to other peoples kids.

Bill talks about it being a diverse school while noting that it's very male heavy (80% in 2016) but I wonder what the culture of the school is like compared to the greater tech community. Does it exhibit the best of inclusive diversity or the worst or somewhere in between.

Bill also talks about the unique curriculum noting how a history teacher might allow a student to make a web page instead of preparing an oral presentation. This isn't unique at all. I know many teachers across the city that do this. It also isn't necessarily a good or bad thing without context.

The title of the piece is "How 3D printers are preparing students for life after high school" and Bill gushes about a design class he observed. A design class can be amazing and I'm guessing the one he saw was, but the 3D printers are incidental. In fact, many educators don't think they're particularly useful or valuable. They're expensive, they break, they use consumables which cost money and printing time make instant gratification impossible. Sure, they're nice toys but when you're stretching your budget to its breaking point are they really worth it?

As I read this I kept wondering if Bill had really learned anything from his past failures in coercing public education to his whims. Then I got to this: "The school enrolls fewer than 500 kids, so class sizes are small, " That's not how it works and if Bill was actually paying attention or cared he'd know this. Small schools in NYC have around 544 kids. That's four grades of 136 student each. Each grade is made up of four classes of 34 students each which is the NYC class size. It doesn't matter if you have 500 in your school or 5000. The class size will still be around 34 unless extra funds are available to lower it. Bill further talks about teachers using a shared data portal and advisors connecting with families and attributes all this to AFSE being a small school when it really has to do with having more funds per student and not the school size at all. He also doesn't seem to notice how his small schools can't offer great art and music unless they're art and music themed.

Why am I writing this? Because people like Bill Gates wield great wealth and great power and Bill's past efforts in education have hurt schools much more than they've helped them.

Has he learned anything? As far as I can tell, not a thing.

I said this post wasn't about AFSE and it isn't but I will share a few thoughts here at the end. As with all public schools with open admission in NYC they face some pretty big challenges. They have some great champions like founder and NYC mensch, Fred Wilson along with other players in the tech industry. AFSE was also a special project of the Bloomberg administration under which it was created. I think this has meant that they've had resources that might not be available as readily to other schools. Resources like the ones mentioned here. It's great that the kids at AFSE have these resources but sad that so many other kids don't.

As CS becomes a subject in all schools what will happen with AFSE? Will they continue to be able to raise the necessary funds for the extras? Will it affect the kids who apply? Will it make them less desirable to "techy" kids since CS will be available at many schools or will it make it easier to get non tech types. Time will tell.

Do you need to know binary for CS?

Yesterday, Alfred Thompson asked "Why is it important for CS students to understand binary?" on Twitter which led to a number of interesting responses. Alfred summarized and wrote his own thoughts on his blog.

I wanted to add a comment but I already wrote a post for yesterday so put it off until today.

First let me say that you can have a very successful career in tech and not really know binary or number bases other than 10. That career could be as as programmer, software engineer, network specialist, devops or in many other areas that fall on the CS side of tech.

You also can't really get through a CS program without learning about binary. If you're self taught or go to a code school then that's another story.

The question is, is it worth the time spent.

One can easily argue that systems - that is low level, close to the metal knowledge is one of the two "latins" of CS, the other being CS theory. You might not explicitly use either but they give you a stronger foundation in everything. You also can't study systems without a good knowledge of binary so if you want to do anything low level, you need it.

What about beyond those easy but not all to convincing to new students answers?

Let's loo at a few things we can do with binary.

A big part of binary notation is that you can look at data as a string of bits. You can also manipulate that data using things like and, or, not, and xor.

At it's core and let's you turn off bits. And any bit with a 0 and it will become a 0. And it with a 1 and it stays the same.

\begin{array}{ccccc} &1 & 1 & 0 & 0\\ and &0 & 1 & 0 & 1\\\hline &0 & 1 & 0 & 0\\ \end{array}

Or is used to turn on bits. You or any bit with a 1 and it gets turned on. Or it with a 0 and it stays as it was.

\begin{array}{ccccc} &1 & 1 & 0 & 0\\ or &0 & 1 & 0 & 1\\\hline &1 & 1 & 0 & 1\\ \end{array}

Xor a bit with a 1 and the bit flips, with a 0 it stays the same.

\begin{array}{ccccc} &1 & 1 & 0 & 0\\ xor &0 & 1 & 0 & 1\\\hline &1 & 0 & 0 & 1\\ \end{array}

What can we do with this? For one thing, image processing. Students frequently play with images where each pixel is represented as a 24 bit color. Three bytes, one each for red, green, and blue. Each byte is really 8 bits. We can use bitwise operations on the binary digits to turn on or off color.

Let's say we have this rgb triple: (200, 15, 80) which in hexadecimal is C8 0F 50 or 10111000 00001111 01010000 in binary. If we want to turn off the reddest reds we could and the color with 00001111 11111111 11111111 or 0FFFFF:

\begin{array}{cccc} & 10111000 & 00001111 & 01010000\\ and & 00001111 & 11111111 & 11111111\\\hline & 00001000 & 00001111 & 01010000\\ \end{array}

Yes, you could just use the base 10 values and keep on calling color setting and conversion functions but if you understand binary it's quicker and easier and what's going on will actually make sense.

Of course you probably wouldn't write out the binary but would rather use the hex notation which once a student realizes is just 4 bit groupings of binary becomes really easy. As a bonus, once you're used to binary and hex those hexadecimal color values will all of a sudden make sense.

This is just the tip of the image processing and graphics iceberg with respect to binary.

Related although I haven't played with it myself, I'd imagine you could use these types of bitwise operations on images to play with steganography.

Another use of binary is in cybersecurity. Things like buffer overflows and blowing the stack all make much more sense if you know how memory is arranged and that's easier to understand if you understand binary, bytes, and word sizes. I do experiments with my classes when we use C or C++ where they access arrays off the ends and end up messing with neighboring variables. It seems like magic unless you know about memory and to know memory you need to know binary.

How about image file formats? Many image file formats start with a fixed size header. Here's the header definition for the GIF file format:

Offset Length Contents
0 3 bytes "GIF"
3 3 bytes "87a" or "89a"
6 2 bytes <Logical Screen Width>
8 2 bytes <Logical Screen Height>
10 1 byte bit0: Global Color Table Flag (GCTF)
bit 1..3: Color Resolution
bit 4: Sort Flag to Global Color Table
bit 5..7: Size of Global Color Table:2(1+n)
11 1 byte <Background Color Index>
12 1 byte <Pixel Aspect Ratio>
13 ? bytes <Global Color Table(0..255 x 3 bytes)
? bytes <Blocks>  
1 bytes <Trailer> (0x3b)

The header info is defined bit by bit so you have to know about binary and know how to manipulate data on a bit level.

Those were three biggies but there are other places where knowing binary makes tons of sense:

  • flag type parameters
  • understanding floating point numbers
  • using shifts for quick doubling and halving of data

Does this mean that binary has to be or should be in a first course? No. Should it be somewhere? Certainly and rather than doing binary because it's on the test or because "you should know it" you can pick and choose your spots and cover it when it will be fun and interesting for your kids.

world

Wishing all K12 teachers a great year

Today was the first day of school for all NYC teachers. Students come back tomorrow. That's a quick turnaround. Some years, they get a day or two before the kids come in. That's much easier.

The first day is usually dominated by meetings. In a large school like Stuy you'll typically have a long faculty meeting in the morning and a department meeting in the afternoon. Not much time to actually get ready for classes. You might think that it shouldn't be a big deal since you had all summer but in NYC where budgets don't come out until the summer for teachers not to know exactly what or when they're teaching until the first day back.

Things started at Hunter college last week but things are different there. I was excited to my students but the overall energy isn't the same. We're two weeks in and I still haven't seen most of my CS colleagues. In the high school, everyone comes back at once.

In any event. It's an exciting time in what should be an exciting year for CS teachers and students.

I'm not going to rehash everything that's going on since I'm sure most readers already already know what's going on but I'll add one thing. Many New York teachers need ongoing professional development - CTLE hours. It seems that teachers in specific programs like New York City's Software Engineering Pilot (SEP) have a number of PD opportunities provided to them and there also seems to be a good amount of PD at the entry level.

There doesn't seem to be much for the teacher ready for that next step.

To address this, we'll be offering once a month sessions through Hunter for CS teachers who are ready to move beyond the basics both in content and pedagogy.

The plan is to start some time in October.

In the meantime to all the teachers meeting their students tomorrow - have a great semester!!!!!

Class Rules

Classes started up again today so I thought I'd talk about my class rules.

I don't seem to recall many class rules in college. Sure, there was a grading policy governing homework and the like but not much beyond that. In K12 there are usually more. When you can talk, how you set up your notebook, how to do homework, bathroom policy etc.

For years, I've used the same set of class rules and I always talk about the rules with my classes.

I don't have a lot of rules.

Just two.

Don't be a bum and don't be a jerk.

Not only are they good class rules, they're also good life rules. I tell my classes that if they follow these two rules everything else takes care of itself.

So, what do they mean?

Being a bum means you're doing something detrimental to yourself.

You don't hand in an assignment? You're being a bum.

Don't prepare for an exam? You're being a bum.

Don't ask for an extension until right before a project's due because you didn't even look at it until the night before? Bum.

Being a jerk means you're doing something detrimental to someone else.

If you're meeting a bunch of friends to see a movie and you leave them waiting for you on a cold corned February since you can't bother to be on time, you're being a jerk.

Don't hold up your end of a group project? You're being a jerk.

Hold up the class by asking the same question that was just asked and answered, not because you didn't understand but because you weren't listening? You're being a jerk.

I have my students fill out an information form at the start of the semester. I give them a day or two to do it but there is a deadline. Don't fill it out on time and you're being a bum. You're also being a jerk. Why? Because I use that list to set up my grade book as well as mailing lists and other resources. If I don't have the data from all my students I either have to wait on setting up my systems or I have to go back later and manually add the stragglers. Making more work for the teacher because you couldn't be bothered to finish a two minute assignment? That falls under the "jerk" category.

Every interaction makes an impression and even small actions can have effects on people that you don't realize.

You do something the right way, people will notice. You do things that adversely affect people? They'll notice that as well. I want my students to start to become aware of how they act, how they affect the people around them, and the reputations they build through small actions - both positive and negative.

We also talk about why I don't need to hear excuses when you violate either of these rules. If you do things the right way - you don't act like a bum or a jerk - you build your credibility. If at some point later, something happens - you miss an assignment because a last minute emergency - you've got the positive reputation so you don't need an excuse. If you've been a bum all along, the excuse carries no weight.

None of this has anything to do with computer science but it does have to do with our students growth as people so in many ways it's more important. Do I make in impact with any of this? I can't be sure but I think it's important enough to make the effort.

Artifacts Have Stories

Earlier today I was asked about my avatar:

hero-z.jpg

I've been using it for most services for a few months now. It's an image that I've had for ages. I started thinking about using it about a year ago

So, what's the story?

It was back in 1993. I had just started at Stuy. I taught some CS when I was at Seward Park but at the time, I was teaching all math at Stuy. Mostly Geometry to ninth graders but also a smattering of Algebra 2 / Trig and Linear Algebra.

The math department had the fourth floor and some of the third but since I was the new guy I taught most of my classes in the hinterlands of the 7th and 8th floor. At least I had great views of the lower Hudson and the Statue of Liberty.

My math classes were somewhat more formulaic and structured than my computer science classes would end up. Start with a "Do Now" while I checked homework. Kids then present homework that they put on the board. We then did the Do Now which hopefully led into the lesson. I was never super strict but it was pretty structured.

In one class I had a young man, let's call him Charles since I don't know if he's comfortable with my sharing his true identity. He sad in the last two or three rows right next to the window on the south side of classroom. Charles would constantly doodle throughout the class. This never really bothered me. He was always prepared, did well on all assessments and was also ready and able to take part in class discussion regularly.

Apparently, his other teachers weren't as tolerant of his doodling. At the end of the semester he gave me the picture. and said he really appreciated me not hassling him about the doodling. I thanked him and explained that since it didn't adversely affect his performance (and might have helped) and didn't distract anyone else, why would I give him a hard time

The semester ended and I didn't think much more about it although once I got my own office I put the picture in a frame and added it to my collection of office trinkets.

Last year, now at Hunter, I was looking at the picture and I wondered what ever happened to Charles. I hadn't seen him after he was in my class as a freshman. I had started to teach CS and we started to developed our cult so I didn't end up keeping in touch with many of my students from those freshmen math classes. It turned out I was able to find him on Facebook. I don't think he remembered me but he accepted the friend request and we caught up. His family moved out of NY after his freshman year so it made even more sense that I never saw him again.

I keep the picture because it's fun and also to remind me of the circumstances under which I go it. I always appreciate it when a student takes the time to say thanks even when they don't remember anything about the class 30 years later. When I would get little gifts during the holidays, if I'm being honest, I'll have to say that I would frequently throw the gift card or present on the pile but I'd keep and cherish the notes and letters.

Over the years, I accumulated quite a collection of esoteric from former students. From the custom mouse pad with Dave, Spike, Igor, and Oy on it to the Squirtle from Larry to Orion's pinhead, every artifact has a story. They remind me of a person time and place. A connection I had and in many cases I still have. It also creates a bridge to the past both for me and my students.

I've been derided for hanging t-shirts donated by former students from their companies when I had my own classroom at Stuy:

shirts-307.jpg

Those naysayers are wrong. Each shirt has a story. It could be Joy's Apple shirt and how she agonized over her employment options, Pawel's Google shirt and his adventures going from Bloomberg LP to the French West Indies to now being a senior programmer at Google or a Digital Ocean shirt from Ben and Moisey and the stories they evoke are far two numerous to list. They create a history and perpetuate the culture. Each has a story.

Looking back, I'm glad that I've kept many mementos from the past. The objects are incidental but the stories give context and inspiration to current students while at the same time reminding me of my past and my shared journey with so many of my students.

Software Longevity

Writing about old projects got me thinking of my first programming gig and software longevity. It was a part time after school / full time summer job at Arcus-Simplex-Brown. I started in my senior year in high school and continued through most of my first year in college. It wasn't my first job - that was being a delivery boy at Video Room, an independent video store that's survived from the old VHS/Betamax days through DVDs and is still, somehow or other, surviving in this day and age of streaming video. My job at Arcus-Simplex-Brown was my first job as a programmer. I got it through my buddy Ben who got it from one of our math teachers at Stuy. Ben had found a job closer to home so passed this one along to me.

Arcus-Simplex-Brown was (is?) a ticket printing company

s-l1600.png

c1f0ec2f524c9e3e65c5e8b50fc7226a.png

They also did tickets for sporting events like the Knicks and Rangers at the Garden. More recently, this was 1983, they had started selling computer printed tickets and that's where I came in. They had a dot matrix line printer. Not the small kind used by personal computer owners and small businesses:

[[11_product.jpg

Printers like the Epson MX 80 pictured above had a print head that moved across a line at a time much like a modern desktop ink jet printer. The difference was that it had a print head that had a matrix of pins which fired and hit an ink ribbon which left the ink impression on the paper.

Rather, they had a big heavy duty one where the print head went across the entire width of the paper and it literally printed a line at a time

printronix-p5008-800-lpm-proline-series-5-line-matrix-printer-1.35__97003.1490181342.jpg

and a computer attached. I think it was an old North Star computer. It ran CP/M which was like a primitive version of MS-DOS. 64K of memory and two floppy drives. It had a basic interpreter built in and they also had a basic compiler.

They had a program that was supposed to print the tickets but it didn't really work. My first job was to get it working, It was a HUGE mess of a program. God knows how many lines of BASIC code with a few gosubs and a ton of gotos. I don't think there were too many comments. It didn't help that in addition to having to deal with custom theater seating plans and ticket policies you had to know all sorts of magical incantations to get the printer to do the special fonts correctly and I don't recall us having a printer manual so it all had to be divined from the non-working code.

On top of all this, the program was so complex that only the simplest test cases could be run via the interpreter interactively. Any real change had to go through the compiler and it took about 40 minutes to compile the program. Whenever I wanted to take a long break, I set up a compile.

Somehow or other, I got the thing to work. The code started as a mess and I didn't improve it any I really had no idea what I was doing. Still, it did work and we were able to reliably print tickets for all sorts of things.

I stopped working at Arcus-Simplex-Brown once I got a job at NYU. That gig ultimately turned into a full time job which enabled me to work my way through school. It was the right move but I had a great time and learned a lot at Arcus.

I didn't think much about the work I did at Arcus over the years. I finished college, went to Goldman, then some consulting and ultimately teaching career.

One day at Stuy, I noticed this:

arcus-ticket.jpg

This was now Spring 2012 - almost 30 years later. Judging from the dot pattern of the letters it looked like the same printer and was probably the same program!!!!!!! I couldn't believe it. Stuy didn't use these tickets back in my day so I was really surprised. It looked like some horrible code I wrote as a kid was still being used productively almost three decades later!!!!!! They could have continued to use it because it basically worked or maybe because they were afraid that touching it would break everything.

I don't remember what the code looked like but know it was horrible. If I had it, I'd be to embarrassed to share and that's saying something.

The lesson of all this? You never know how long your code is going to live. It might surprise you. Hopefully in a good way.

All the more reason to do better than I did and learn how to do it right.

Rite Of Passage Projects

JCS's post on Irreal today brought me back. It was about Brief which was the editing hotness back in the day. I played with it a little really mostly used Emacs clones for real work when I was stuck on MS-DOS systems. Usually either JOVE or Epsilon

In the comments Jon reminded me about the MKS Toolkit which brought most everyday Unix tools to DOS along with a shell and a version of Vi. I didn't use Vi much and I only used their shell until I wrote my own.

This got me thinking about "rite of passage" projects. I was in college in the mid to late 80s. It was the heyday of the IBM-PC. Schools still used older time sharing systems like DEC-20s and Vaxen but the PC was all the rage. The cool thing about them was that you had full control and access to the machine and it was simple enough to get your head around pretty much everything about it. The downside was that MS-DOS was very limited and of course there was little to no networking going on.

On the one hand, you could dive into the low level machine language stuff very easily. Get Norton's book:

7446489-L.jpg

and you're on your way.

On the other hand many student's graduated with no concept of time sharing and the ramifications of sharing a system or resources were foreign to many kids.

Even though we always look back to the "good old days," in many ways things weren't much different. I got a very strong background in academic CS from NYU (Courant Institute) but just like today, there was no real preparation for the real world.If you wanted to really develop your coding chops you had to work on side projects.

I seem to recall, a typical "rite of passage" side project was writing your own shell. It didn't have to be anything as powerful as BASH or ZSH but it would typically be much more powerful than DOS and much more Unixy.

I recall writing my first shell down in UC-49 of Tisch Hall when the computer labs weren't busy. I wrote it in C which was what the cool kids used back then. Specifically I used the Let's C compiler from the Mark Williams company. This was before Turbo C 2.0 so Let's C was pretty much the only game in town for a cheap Unix style C compiler for DOS. There was also Run/C but that was a C interpreter, not a compiler. I also used that to learn C. Funny story - I certainly didn't know this at the time but Run/C was written by Peter Brooks. Peter and I would later meet when he became my colleague at Stuyvesant teaching CS and I now have the privilege of being able to call him friend. I joke that I owe him ~ $100 for the interpreter from back in the day.

Since this was on DOS, I couldn't do real Unix style pipes like cat file | sort | uniq -c | sort -n but I did simulate it with redirection and temporary files. It also supported aliases, simple scripts and I think a few other things.

I was pretty happy with it and used it for a couple of years. It was also one of the first substantial programs I wrote. I learned a lot from doing it.

Another "rite of passage" program that was common back then was a text based window library. Somethig like ncurses that would allow you to make text based windows and menus on the text only screen. I also wrote one of these and actually got to use it for a project when I started working at Goldman.

I guess the third "rite of passage" project I remember was writing a C compiler but that was different because it was for a class. It was a significant project but the class didn't really help with writing a large program in general - it was all about the compiler and all the theory behind it. Great course but not one in software engineering.

Nowadays the projects have changed. Text based windowing is long gone and while I still think writing a shell is a useful and rewarding exercise it's not scratching an itch the way it did back when we were stuck on DOS. I guess writing a full stack web app is probably a pretty typical one for students these days.

Any others?

Early Code Reuse

I've been following the tweets coming out of ICER2018. I've never been to ICER but now am thinking about trying to get funding to go next year. One set of tweets involved students writing or using APIs or Libraries. This overlaps with Owen Astrachan's talk from this past year's CSTA conference on sorting. I was planning on writing a post about Owen's talk but I thought I'd leave it for the school year closer to when sorting is typically covered.

The points alluded to in the tweets go far deeper than can be addressed in one blog post and are more suited to the sorting post I'll write later on but I thought I'd share a lab that I stole from a friend of mine years ago to try to get the kids to abstract code into functions or methods early and to start to think about reusing blocks of code.

I've talked about abstracting out and reusing code before, after students have covered repetition but this lab can be done even earlier. Part of the motivation is the age old problem of objects / functions / methods early or control structures early. With o/f/m early kids think about decomposition, layers, and abstractions but they don't have the tools to do a whole lot of interesting things. On the other hand, with control structures early, kids tend to get in the mindset of throwing everything in "main" at the top level.

This lab tries to get the kids abstracting out and reusing or sharing code but doesn't require much more than methods or functions.

The idea is to create an ASCII art robot or something similar. Of course, this could also be done in a graphical environment:


     ######################
     #                    #
     #   XX          XX   #
     #                    #
     #       XXXXX        #
     #                    #
     ######################
              ###
              ###
          #############
          #           #
   ########           ########
          #           #
          #           #
          #           #
          #############
            ##      ##
            ##      ##
            ##      ##
_ 

This can easily be done with a series of output instructions or possibly by building a string with embedded newlines.

The interesting part comes when you have the student write different functions for the parts of the robot - the head, body, and legs.

Students end up with routines like this:

String generateHead(){
    String h = "##########\n";
    h =    h + "#        #\n";
    h =    h + "#  X  X  #\n";
    h =    h + "#         #\n";
    h =    h + "###########\n";
    return h;
}

and then can generate their robot:

String generateRobot(){
    String r = "";
    r = r + generatehead();
    r = r + generateBody();
    r = r + generateLegs();
    return r;
}

Now for the fun part. Students can make a variety of heads, legs, and bodies. Going further, introduce if statements and random numbers and they can generate random robots:

String genRobot(){
    Random r = new Random();
    String robot="";

    int i = r.nextInt(3);
    if (i == 0) {
	robot = robot + generateHead1();
    } else if (i==1){
	robot = robot + generateHead2();
    } else {
	robot = robot + generoateHead3();
    }

    /* Generate the rest of the robot here */

    return robot;

}

Not the most elegant code but this can be done VERY early when the students don't know more advanced constructs and techniques.

The class can also share robot "components" as long as there's a simple code sharing mechanism - perhaps using gists.

Finally, this can be revisited if desired later on once the class has covered more advanced language constructs.




Enter your email address:

Delivered by FeedBurner

Google Analytics Alternative