April 30, 2016 11:02 AM

Thinking About Untapped Extra Credit Opportunities

I don't usually offer extra credit assignments in my courses, but I did this semester. Students submitted their last scheduled homework early in the last week of classes: an interpreter for a small arithmetic language with local variables. There wasn't enough time left to assign another homework, but I had plenty of ideas for the next version of our interpreter. Students had just learned how to implement both functions and mutable data, so they could add functions, true variables, and sequences of expressions to the language. They could extend their REPL to support top-level definitions and state. They could add primitive data objects to the language, or boolean values and operators. If they added, booleans, they could add an if expression. If they were willing to learn some new Racket, they could load programs from a text file and evaluate them. I had plenty of ideas for them to try!

So I asked, "If I write up an optional assignment, how many of you would take a stab at some extra credit?" Approximately twenty of the twenty-five students present raised their hands.

I just downloaded the submission folder. The actual number of attempts was a complement of the number of hands raised: five. And, with only one exception, the students who tried the extra credit problems are the students who need it least. They are likely to get an A or a high B in the course anyway. The students who most need extra credit (and the extra practice) didn't attempt the extra credit.

SMH, as the kids say these days. But the more I thought about it, the more this made sense.

  • College students are the most optimistic people I have ever met. Many students probably raised their hand with every intention of submitting extra credit solutions. Then the reality of the last week of classes hit, and they ran out of time.

  • The students who submitted new code are likely the ones doing well enough in their other courses to be able to spare extra time for this course. They are also probably used to doing well in all of their courses, and a little uncertainty about their grade in this course may have spurred them into action. So, they may have had both more time and more internal motivation to do extra work.

  • To be fair, I don't know that the other students didn't attempt to solve some of the problems. Maybe some tried but did not submit their work. They may not have been satisfied with the quality of their code and didn't have time to seek help from me before the deadline.

  • And, if we are being honest, there is at least one more possibility. A few of the students who find themselves needing extra credit at the end of of the semester got themselves into that position by not being very disciplined in their work habits. Those students may be as optimistic as any other students, but they aren't likely to conjure up better work habits on short notice.

These reflections have me thinking... If I want to help the students who most need the help, I need to find ways to reach them sooner. I did try one thing earlier this semester that worked well for many students: the opportunity to rewrite one of their exams at home with access to all the course materials. A couple of students wrote surprisingly candid and insightful assessments of why they had performed below par under test conditions and supplied better work on their second attempt. I hope that experience helps them as they prepare for the final exam.

I've been teaching a long time. I still have much to learn.


Posted by Eugene Wallingford | Permalink | Categories: Teaching and Learning

April 29, 2016 3:30 PM

A Personal Pantheon of Programming Books

Michael Fogus, in the latest issue of Read-Eval-Print-λove, writes:

The book in question was Thinking Forth by Leo Brodie (Brodie 1987) and upon reading it I immediately put it into my own "personal pantheon" of influential programming books (along with SICP, AMOP, Object-Oriented Software Construction, Smalltalk Best Practice Patterns, and Programmers Guide to the 1802).

Mr. Fogus has good taste. Programmers Guide to the 1802 is new to me. I guess I need to read it.

The other five books, though, are in my own pantheon influential programming books. Some readers may be unfamiliar with these books or the acronyms, or aware that so many of them are available free online. Here are a few links and details:

  • Thinking Forth teaches us how to program in Forth, a concatenative language in which programs run against a global stack. As Fogus writes, though, Brodie teaches us so much more. He teaches a way to think about programs.

  • SICP is Structure and Interpretation of Computer Programs, hailed by many as the greatest book on computer programming ever written. I am sympathetic to this claim.

  • AMOP is The Art of the Metaobject Protocol, a gem of a book that far too few programmers know about. It presents a very different and more general kind of OOP than most people learn, the kind possible in a language like Common Lisp. I don't know of an authorized online version of this book, but there is an HTML copy available.

  • Object-Oriented Software Construction is Bertrand Meyer's opus on OOP. It did not affect me as deeply as the other books on this list, but it presents the most complete, internally consistent software engineering philosophy of OOP that I know of. Again, there seems to be an unauthorized version online.

  • I love Smalltalk Best Practice Patterns and have mentioned it a couple of times over the years [ 1 | 2 ]. Ounce for ounce, it contains more practical wisdom for programming in the trenches than any book I've read. Don't let "Smalltalk" in the title fool you; this book will help you become a better programmer in almost any language and any style. I have a PDF of a pre-production draft of SBPP, and Stephane Ducasse has posted a free online copy, with Kent's blessing.
Paradigms of Artificial Intelligence Programming

There is one book on my own list that Fogus did not mention: Paradigms of Artificial Intelligence Programming, by Peter Norvig. It holds perhaps the top position in my personal pantheon. Subtitled "Case Studies in Common Lisp", this book teaches Common Lisp, AI programming, software engineering, and a host of other topics in a classical case studies fashion. When you finish working through this book, you are not only a better programmer; you also have working versions of a dozen classic AI programs and a couple of language interpreters.

Reading Fogus's paragraph of λove for Thinking Forth brought to mind how I felt when I discovered PAIP as a young assistant professor. I once wrote a short blog entry praising it. May these paragraphs stand as a greater testimony of my affection.

I've learned a lot from other books over the years, both books that would fit well on this list (in particular, A Programming Language by Kenneth Iverson) and others that belong on a different list (say, Gödel, Escher, Bach -- an almost incomparable book). But I treasure certain programming books in a very personal way.


Posted by Eugene Wallingford | Permalink | Categories: Computing, Personal, Software Development, Teaching and Learning

April 28, 2016 4:12 PM

A Homeric Take on the Power of Programming

By participating in history instead of standing by to watch we shall at least be able to enjoy the present. ... You should read your Homer. Gods who manipulate the course of destiny are no more likely to achieve their private ambitions than are men who suffer the slings and arrows of outrageous fortune; but gods have much more fun!

If we are to be thwarted in our ambitions, let us at least enjoy the striving. Writing code is one way to strive bigger.

~~~~~

From We Are As Gods, the iconic piece in the The Whole Earth Catalog that gave us the line, "We are as gods and might as well get good at it" -- misremembered, but improved in the misremembering.


Posted by Eugene Wallingford | Permalink | Categories: General

April 27, 2016 4:35 PM

"I Had No Need Of That Hypothesis"

Joshua Brown closes his blog Simple vs Complex with this delightful little story:

1802: Emperor Napoleon sits in state at the Chateau de Malmaison, ready to receive the the mathematical physicist Pierre Laplace and his just completed Celestial Mechanics. In this book, Laplace has explained the formation of the solar system for the first time and has modeled exactly how the planets and stars work. For all his brutality and battlefield expedience, Napoleon is a sophisticate and an enthusiast of the arts and sciences. He is intellectually curious.

"Tell me, Monsieur Laplace, how did the solar system come about?"

"A chain of natural causes would account for the construction and preservation of the celestial system," Laplace explains.

"But you don't mention God or his intervention even once, as Newton did?"

"I had no need of that hypothesis."
One hundred years earlier, Sir Isaac Newton had created a celestial model of his own. In it, he surmised that the planetary orbits were out of control and not stable, and that a God was needed to explain their course. Laplace went further than Newton, showing "it works without that, too."

Whatever one's position on faith in a supernatural deity, Laplace models precisely the attitude that scientists must bring to their work. Let's explain every phenomenon with the fewest and simplest hypotheses.


Posted by Eugene Wallingford | Permalink | Categories: General

April 25, 2016 1:26 PM

"So Little of the Great to Conceal"

In a recent post, Clive Thompson quotes a short passage from Carlo Rovelli's Seven Brief Lessons on Physics in which Rovelli notes that genius hesitates when it comes upon great ideas. Einstein introduced quantum theory with "It seems to me...", and Darwin demurred even in his own notebooks on natural selection with "I think...". Thompson writes:

It's not a bad litmus test for the people around us in everyday life. The ones who are proposing genuinely startling and creative ideas are liable to be ... careful about it. It's the ones with small ideas who are shouting them from the rooftops.

These thought brought to mind a wonderful passage from Okakura Kakuzo's The Book of Tea:

Perhaps we reveal ourselves too much in small things because we have so little of the great to conceal.

Those who encounter a great idea are most willing to let their uncertainty show. Those who express no uncertainty often have no greatness to conceal.

Earlier in the book, Okakura writes another line that I see quoted often:

Those who cannot feel the littleness of great things in themselves are apt to overlook the greatness of little things in others.

This passage takes on a different flavor for me when considered in the light of Rovelli's observation.


Posted by Eugene Wallingford | Permalink | Categories: General

April 24, 2016 6:46 PM

A Short Break in Boston

This weekend has been a normal one at home, a little online and a little off, but last weekend I went offline for most of three and a half days to visit my older daughter in Boston. She been in Jamaica Plain in for eight months and had plenty of sights to show. I hadn't spent much time in Boston since AAAI 1990 and, except for the walk across the Charles River from my MIT dorm room, had forgotten most of the details of that trip. Now that I blog, I can preserve my memories for 2042 me.

Offline.   Being offline for most of three and a half days was a treat. I had my laptop on for only a couple of hours in the Chicago airport when I used a long layover to grade one of my students programming assignments. Thereafter, I left it in its bag, turned off. It was great to be present to my daughter and the world for a while without feeling the need to check mail or tinker with work.

Goal.   At the airport, I saw several members of the Fort Lauderdale Strikers, a North American Soccer League team. I'm guessing they were passing through ORD en route to a match with the Minnesota United. From the score of the game, I think my weekend went better than theirs.

Confluence.   Saturday morning, we went out for brunch at the Center Street Cafe in Jamaica Plain. We arrived a few minutes after opening. Seating is limited, so we waited outside in line.

There was one party ahead of us, a young couple. The young woman kept looking at my jacket and finally said, "Did you go to UNI?" When I told her that I teach there and that my daughter is from Cedar Falls, she told us that she is from Des Moines. The older guy behind me in line heard us discussing Iowa, asked where we were from, said that he is from Council Bluffs, and recalled that a good friend of his UNI. We all marveled at the coincidence. Our new Council Bluffs friend wondered what it was that attracted Iowans to Boston; I silently wondered if Boston depended on an influx of Iowa talent to stay fresh.

The food was excellent, too.

Walking.   After brunch, my daughter and I spent several hours walking in the Arnold Arboretum and the Forest Hills Cemetery. The arboretum is not yet in bloom yet still had plenty of neat things to see, as well as a prodigious hill to climb. The cemetery is full of impressive monuments and interesting sculpture.

For some reason, I got it in my head that I wanted that I wanted to see e.e. cummings's cemetery marker. I did not know that it is famously difficult to find. Alas, after several hours on foot at the arboretum and cemetery in the sun, my brain was not up to the task of finding it. Now I have extra motivation to return to JP. I'll have a picture next time.

The Arts.   We decided to spend Sunday afternoon at the Museum of Fine Arts, but I could have spent a week there. Our first stop was the special exhibit called Megacities, by artists from cities that have, in the last few decades, grown to populations in excess of 20 million people. These artists are responding to what this growth means for the people, their way of life, and the cities themselves. The old architecture student in me was drawn especially to two spaces created to evoke the cities that existed before the growth:

  • Hu Xiangcheng's room-like installation made from windows and doors that were salvaged from Ming- and Qing-era houses torn down to make way for modern buildings
  • Asim Waqif's bamboo scaffolding inspired by the changes in construction techniques in Delhi

Sarah wanted to be sure to see a painting she likes, of a big storm in a valley, and otherwise was open to explore. It turned out to be Albert Bierstadt's wonderful Storm in the Mountains. I expressed interest in the impressionists, so we made sure to swing through those galleries, too. The Pisarros took more of my attention than in the past, and the Monets lived up to my expectations. We spent several minutes examining several of his Rouen Cathedral canvases and several of his Morning on the Seine works up close, then walked to the opposite corner of the room to experience them from a distance. It was hard to leave.

A New Favorite.   The MFA has an extensive collection of John Singer Sargent's work, about which I had much to learn. I left the weekend with a new painting among my favorites, Sargent's "An Artist in His Studio":

An Artist in His Studio, by John Singer Sargent, 1904

Up close, the detail in the bedding grabs the eye: "Surely, never were tumbled white sheets so painted before." The artist at work.

Coincidence.   My reading for the trip was The Book of Tea, Okakura Kakuzo's short book on the Japanese tea ceremony and its intimate connection to art, culture, and philosophy. Until I reached the biographical essay at the back of this 1956 edition of the book, I did not know that Okakura had a connection to the MFA in Boston:

The wholesale destruction of a nation's cultural heritage [in the late 19th century] aroused to action a small group of Japanese artists and men of letters and a handful of foreigners who seemed more concerned about the fate of Japanese art than were many native hotheads. The nucleus of this movement emerged from the Imperial University in Tokyo, with Professors Morse and Fenollosa in the lead, and with Kano Hogai, of the ancient family of artists, to act as historic instructor. Fenollosa urged his wealthy friend, William Sturgis Bigelow, to buy up whatever of value was tossed on a careless market; this was to become the core of the great Oriental collection of the Boston Museum. Okakura Kakuzo and Baron Kuki were the most energetic Japanese workers in this group.

Iowans and Japanese intersecting with Boston. The Oriental collection is definitely on the itinerary for my next visit.

Much More.   We packed the weekend from morning until night, beginning with a workout at my daughter's gym and ending each night with a film. In addition to the places I've mentioned, we visited the aquarium, the North End, Boston Common, and the public garden, another brunch at Vee Vee, and a dinner at Bella Luna. It was a weekend well-spent.

A Modern Man.   I even joined the 21st century on this trip. I sent a text for no purpose other than to say 'hello'. My daughter and I streamed movies from Netflix. And I relied on my cell phone alarm to awaken to catch a cab at 5:00 AM. A weekend well-spent, indeed.

PLT Rising.   One last bit of new knowledge: Northeastern University is but two short subway stops from where I got off for my visit. This means that my next visit to Jamaica Plain, should there be one, will include a visit to see the home of the PLT group there. If nothing else, I can take snapshots of the labs and offices where so much cool Racket work is done. Then maybe I could write the excursion off as a business trip.


Posted by Eugene Wallingford | Permalink | Categories: Personal

April 22, 2016 12:03 PM

Universities, Cities, and Start-Ups

If I were the city of Des Moines, I'd be thinking about Paul Graham's advice on how to make Pittsburgh a startup hub. Des Moines doesn't have a Carnegie Mellon, but it is reasonably close to two major research universities and has a livable downtown. While Des Moines is not likely to become a major startup hub, it could create the sort of culture needed to sustain a healthy ecosystem for new companies. Such an ecosystem would strengthen its already solid, if unspectacular, IT industry.

Regarding the universities' role in this process, Graham says:

Being that kind of talent magnet is the most important contribution universities can make toward making their city a startup hub. In fact it is practically the only contribution they can make.
But wait, shouldn't universities be setting up programs with words like "innovation" and "entrepreneurship" in their names? No, they should not. These kind of things almost always turn out to be disappointments. They're pursuing the wrong targets. The way to get innovation is not to aim for innovation but to aim for something more specific, like better batteries or better 3D printing. And the way to learn about entrepreneurship is to do it, which you can't in school.

Our university has an entrepreneurship program. I like a lot of what they do for students, but I worry about it becoming about entrepreneurship more than students starting companies. Academics are great at creating programs to talk about stuff, and a lot of what I see our students do is reading about entrepreneurship and studying what other entrepreneurs have done and are done. I'm reminded of an online Q-n-A with Elon Musk's ex-wife. She said that one thing Elon was not doing was sitting around thinking about what other entrepreneurs were doing.

As in so many things, I am also reminded of an aphorism from Kent Beck: "Do stuff, or talk about stuff, but don't talk about doing stuff." An entrepreneur does things. The best thing a university can do is to help students learn what they need to solve hard problems and then get out of their way.


Posted by Eugene Wallingford | Permalink | Categories: General

April 11, 2016 2:53 PM

A Tax Form is Really a Program

I finally got around to preparing my federal tax return this weekend. As I wrote a decade ago, I'm one of those dinosaurs who still does taxes by hand, using pencil and paper. Most of this works involves gathering data from various sources and entering numbers on a two-page Form 1040. My family's finances are relatively simple, I'm reasonably well organized, and I still enjoy the annual ritual of filling out the forms.

For supporting forms such as Schedules A and B, which enumerate itemized deductions and interest and dividend income, I reach into my books. My current accounting system consists of a small set of Python programs that I've been developing over the last few years. I keep all data in plain text files. These files are amenable to grep and simple Python programs, which I use to create lists and tally numbers to enter into forms. I actually enjoy the process and, unlike some people, enjoy reflecting once each year about how I support "we, the people" in carrying out our business. I also reflect on the Rube Goldberg device that is US federal tax code.

However, every year there is one task that annoys me: computing the actual tax I owe. I don't mind paying the tax, or the amount I owe. But I always forget how annoying the Qualified Dividends and Capital Gain Tax Worksheet is. In case you've never seen it, or your mind has erased its pain from your memory in an act of self-defense, here it is:

Qualified Dividends and Capital Gain Tax Worksheet--Line 44

It may not seem so bad at this moment, but look at that logic. It's a long sequence of "Enter the smaller of line X or line Y" and "Add lines Z and W" instructions, interrupted by an occasional reference to an entry on another form or a case statement to select a constant based on your filing status. By the time I get to this logic puzzle each year, I am starting to tire and just want to be done. So I plow through this mess by hand, and I start making mistakes.

This year I made a mistake in the middle of the form, comparing the wrong numbers when instructed to choose the smaller. I realized my mistake when I got to a line where the error resulted in a number that made no sense. (Fortunately, I was still alert enough to notice that much!) I started to go back and refigure from the line with the error, when suddenly sanity kicked it.

This worksheet is a program written in English, being executed by a tired, error-prone computer: me. I don't have to put up with this; I'm a programmer. So I turned the worksheet into a Python program.

This is what the Qualified Dividends and Capital Gain Tax Worksheet for Line 44 of Form 1040 (Page 44 of the 2015 instruction book) could be, if we weren't still distributing everything as dead PDF:

line   = [None] * 28

line[ 0] = 0.00 # unused line[ 1] = XXXX # 1040 line 43 line[ 2] = XXXX # 1040 line 9b line[ 3] = XXXX # 1040 line 13 line[ 4] = line[ 2] + line[ 3] line[ 5] = XXXX # 4952 line 4g line[ 6] = line[ 4] - line[ 5] line[ 7] = line[ 1] - line[ 6] line[ 8] = XXXX # from worksheet line[ 9] = min(line[ 1],line[ 8]) line[10] = min(line[ 7],line[ 9]) line[11] = line[9] - line[10] line[12] = min(line[ 1],line[ 6]) line[13] = line[11] line[14] = line[12] - line[13] line[15] = XXXX # from worksheet line[16] = min(line[ 1],line[15]) line[17] = line[ 7] + line[11] line[18] = line[16] - line[17] line[19] = min(line[14],line[18]) line[20] = 0.15 * line[19] line[21] = line[11] + line[19] line[22] = line[12] - line[21] line[23] = 0.20 * line[22] line[24] = XXXX # from tax table line[25] = line[20] + line[23] + line[24] line[26] = XXXX # from tax table line[27] = min(line[25],line[26])
i = 0 for l in line: print('{:>2} {:10.2f}'.format(i, l)) i += 1

This is a quick-and-dirty first cut, just good enough for what I needed this weekend. It requires some user input, as I have to manually enter values from other forms, from the case statements, and from the tax table. Several of these steps could be automated, with only a bit more effort or a couple of input statements. It's also not technically correct, because my smaller-of tests don't guard for a minimum of 0. Maybe I'll add those checks soon, or next year if I need them.

Wouldn't it be nice, though, if our tax code were written as computer code, or if we could at least download worksheets and various forms as simple programs? I know I can buy commercial software to do this, but I shouldn't have to. There is a bigger idea at play here, and a principle. Computers enable so much more than sharing PDF documents and images. They can change how we write many ideas down, and how we think. Most days, we barely scratch the surface of what is possible.


Posted by Eugene Wallingford | Permalink | Categories: Computing, General

April 08, 2016 4:27 PM

"Algorithm" is not a Postmodern Concept

Ken Perlin's The Romantic View of Programming opens:

I was attending a panel recently on the topic of new media art that seemed to be culturally split. There were panelists who were talking about abstract concepts like "algorithm" as though these were arcane postmodern terms, full of mysterious power and potential menace.

I encounter this sort of thinking around my own campus. Not everyone needs to learn a lot about computer science, but it would be nice if we could at least alleviate this misunderstanding.

An algorithm is not a magic incantation, even when its implementation seems to perform magic. For most people, as for Perlin, an algorithm is ultimately a means toward a goal. The article closes with the most important implication of the author's romantic view of programming: "And if some software tool you need doesn't exist, you build it." That can be as true for a new media artist as it is for a run-of-the-mill programmer like me.


Posted by Eugene Wallingford | Permalink | Categories: Computing

April 07, 2016 3:47 PM

Notes from Today's Reading

Getting Older

In Fun With Aging, "Dean Dad" Matt Reed pontificates on reaching a Certain Age.

When Mom was the age I am now, I was in grad school. That can't possibly be right, but that's what the math says.

When my mom was the age I am now, I was already in my second year as an assistant professor, a husband, and father to a two-year-old daughter. Wow.

Getting old: what a strange thing to happen to a little boy.

That said, I am one up on Reed: I know one of Justin Bieber's recent songs and quite like it.

An Interesting Juxtaposition

Earlier this week, I read The Real Reason Middle America Should Be Angry, about St. Louis's fall from national prominence. This morning, I read The Refragmentation, Paul Graham's essay on the dissolution of the 20th century's corporate and cultural order abetted, perhaps accelerated, by computation.

Both tell a story of the rise and fall of corporations across the 20th century. Their conclusions diverge widely, though, especially on the value of government policies that affect scale. I suspect there are elements of truth in both arguments. In any case, they make interesting bookends to the week.

A Network of Links

Finally, as I tweeted yesterday, a colleague told me that he was going to search my blog. He had managed to forget where his own blog lives, and he remembered that I linked to it once.

At first, I chuckled at this situation as a comment on his forgetfulness, and ruefully as a comment on the passing of the age of the blog. But later I realized that this is as much a comment on the wonderfulness of blogging culture, in which links are life and, as long as the network is alive, conversation can be revived.

I hope he blogs again.


Posted by Eugene Wallingford | Permalink | Categories: General, Personal

April 05, 2016 4:06 PM

Umberto Eco and the Ineffable Power of Books

In What Unread Books Can Teach Us Oliver Burkeman relates this story about novelist and scholar Umberto Eco:

While researching his own PhD, Eco recalls, he got deeply stuck, and one day happened to buy a book by an obscure 19th-century abbot, mainly because he liked the binding. Idly paging through it, he found, in a throwaway line, a stunning idea that led him to a breakthrough. Who'd have predicted it? Except that, years later, when a friend asked to see the passage in question, he climbed a ladder to a high bookshelf, located the book... and the line wasn't there. Stimulated by the abbot's words, it seems, he'd come up with it himself. You never know where good ideas will come from, even when they come from you.

A person can learn something from a book he or or she has read, even if the book doesn't contain what the person learned. This is a much steadier path to knowledge than resting in the comfort that all information is available at the touch of a search engine.

A person's anti-library helps to make manifest what one does not yet know. As Eco reminds us, humility is an essential ingredient in this prescription.


Posted by Eugene Wallingford | Permalink | Categories: General, Teaching and Learning