Monday, February 18. 2008

Girls and Math


Every girl gets the memo:

To: Girls
From: The Establishment
Re: Math

Math is hard, and you'll never need it anyway.  
You'll just be cooking and making babies, after all.

cc: Boys

But most teen girls, being the modern anti-establishment type, reject this sentiment as "the man" trying to keep them down. They look to the female role models around them for guidance as to what "real life" is like. That comes down to teachers, moms, aunties, and big sisters.

Last week, while I was working on an algebra problem with a group of 7th-grade girls, the classroom teacher (a woman) said, "I'm not good at math."

To: Girls
From: Grown-up Girl
Re: Math

I never learned math, and now I'm a teacher, so you can safely ignore it.

But what did this teacher really mean? She can solve the problem we were working on, no problem. What's hard is teaching math. As with most subjects, a teacher needs to be agile enough to dance around the math, attacking it from all angles, spotting the misconceptions and shreds of understanding in a student's responses, and asking the right questions.

That's legitimately hard, and I think it's unreasonable to ask someone to be this good at more than one subject. I'm a pretty OK math teacher, but if you plop me down in front of a language arts class, I'll struggle. I'm OK with that, but the proper phrase is "I'm not good at teaching language arts," not "I can't read."

Thursday, February 7. 2008

Retroactive Unit Tests

Amanda has, for a long time, shipped with an asynchronous communication library, called event. It supports the usual suspects: reading and writing file descriptors, timeouts, and arbitrarily triggerable events. It's actually commented a bit better than most of Amanda, but only with vaguely suggestive sentences, rather than rigorous descriptions of behavior.

It has come time to "re-base" this particular library to use glib's GMainLoop, because other, newer parts of the code will be based on GMainLoop, and everyone needs to play nice together. The process is relatively clear: write thorough unit tests against which the existing implementation passes, then check the new implementation against those tests. This means writing unit tests against existing code that someone else wrote. That's hard.

My initial selection of unit tests gave my new implementation a PASS on the first try, so I fired up a backup process, which seemed to work, and then a recovery, which failed miserably. Many, many hours of hand-tracing code later, I uncovered two behaviors of the event library which were completely undocumented. I won't make a guess as to whether they were intentional and undocumented or unintentional and just happened to work. I've now adjusted the comments appropriately, and added unit tests to tickle the funny behavior, but things are still broken.

[EDIT: this sat in my "drafts" folder for no reason]

Notice

The postings on this site are my own and don't necessarily represent the opinions of Zmanda, Inc.