Mathias Brandewinder on .NET, F#, VSTO and Excel development, and quantitative analysis / machine learning.
by Mathias 30. June 2009 15:39

Very interesting piece by Martin Fowler; he discusses spreadsheets as a programming language, and coins the term “Illustrative Programming” to describe the corresponding development style. I quote liberally here:

One property of spreadsheets, that I think is important, is its ability to fuse the execution of the program together with its definition. When you look at a spreadsheet, the formulae of the spreadsheet are not immediately apparent, instead what you see is the calculated numbers - an illustration of what the program does.

Using examples as a first class element of a programming environment crops up in other places - UI designers also have this. Providing a concrete illustration of the program output helps people understand what the program definition does, so they can more easily reason about behavior.

I don't think that illustrative programming is all goodness. One problem I've seen with spreadsheets and with GUI designers is that they do a good job of revealing what a program does, but de-emphasizes program structure. As a result complicated spreadsheets and UI panels are often difficult to understand and modify. They are often riven with uncontrolled copy-and-paste programming.

This strikes me as a consequence of the fact that the program is de-emphasized in favor of the illustrations. As a result the programmers don't think to take care of it. We suffer enough from a lack of care of programs even in regular programming, so it's hardly shocking that this occurs with illustrative programs written by lay programmers. But this problem leads us to create programs that quickly become unmaintainable as they grow.

This piece is worth reading, if only to see such a highly respected developer as Fowler defend Excel as a programming language. Given how Excel is usually dissed by “serious programmers”, it’s refreshing.

His analysis rings true, too – spreadsheets and UI tools are very similar in their benefits (immediate focus on the end result desired by the user) and drawbacks (possible lack of structure, lack of testability…). I am not sure how to describe the “other” style, maybe “Axiomatic Programming” - first establish the principles, then useful consequences can be derived? In a way, the term “Illustrative Programming” marks one extreme on the scale of development styles: don’t program if you can’t see it – whereas the other extreme would be developing a framework– creating programs which can’t be seen until someone decides to illustrate its use.

Another way to view the trade-off is to see Illustrative Programming as focused on a specific instance, whereas Axiomatic Programming emphasized the Class. An Excel speadsheet, or a User Interface, is typically one isolated instance, focused on one unique particular illustration of a problem, and as a result, doesn’t promote thinking about generalization and abstraction, whereas the risk in framework design is to embrace generality to the point where abstractions lose connection to specific usage…

by Mathias 28. June 2009 12:41

I finished “The Drunkard’s Walk – how randomness rules our lives”, by Leonard Mlodinow, a few days after Sway; I have postponed writing about it, because a minor storm of work has hit my parts – but I really loved this book, and thought I should say a few words about it.

The book’s point is that humans are very bad at drawing conclusions from observations of random phenomena. They routinely make gross mistakes when dealing with conditional probability (92% of Americans, some of them with pretty solid mathematical credentials, get the Monty Hall problem wrong), and fall prey to the Law of Small Numbers, seeing patterns where there is none, and refusing to admit the importance of randomness in shaping our fates. In the end, the message is pretty upbeat – I loved this quote from Thomas Watson:

If you want to succeed, double your failure rate.

I really enjoyed how the book builds up following the history of probability and statistics; some of the individuals who contributed to its development are truly remarkable (just lookup Cardano for instance), and the book contains a fair share of anecdotes about them. If anything, it gave me my first introduction to Benford’s law, which I am still digesting – and which has been weirdly prominent in the news, via the Iran election issue.

In short, I strongly recommend this book if you are interested in either history of sciences, probability, or decision making.

by Mathias 24. June 2009 12:43

Since the longest time, I have been a member of Bay.Net, the San Francisco Bay Area .NET user group. It’s one of the largest user groups in the country (north of 4,000 members), very active, with four chapters in the Bay – and first and foremost, it’s a fantastic way to keep up with what is going on in the ever-changing .NET world, and meet fellow developers and fun people.

I initially came to attend the meetings, started to get more involved and volunteering in organizing events (if you are interested in volunteering, drop me a line!) – and I was very honored to be offered to co-chair the San Francisco chapter. The current chair, Kim Greenlee, has been doing an amazing job at lining up great speaker after another, and making the meetings fun to attend, but she wants to dedicate her energy to another Bay.Net related project, and can’t be full-time chair anymore, so… the pressure is on – I’ll do my best to keep it up!

by Mathias 18. June 2009 06:40

Mark Twain famously said “There are three kinds of lies: lies, damned lies and statistics”; in that light, I found the following anecdote – from “The Drunkard’s Walk”, a thoroughly enjoyable book so far - pretty funny.

Like most of his compatriots, Jules Henri Poincaré, the legendary French mathematician, took his bread seriously, and purchased a fresh loaf daily. Suspecting his baker was a cheat, he weights his loaves every day, and finds out the average weight is 950g instead of the 1000g advertised. He complains to the authorities – and his daily baguette suddenly becomes larger.

But now, instead of enjoying his good life, Poincaré still suspects his baker is a cheat, and keeps on measuring his bread for an entire year, and finds out that he now got mostly larger than 1000g loaves, and too few light ones. For him it’s great; but from a statistics standpoint, this doesn’t sound right: he should have roughly as many small and large loaves. Poincaré concludes that the baker is still cheating, but gives him the biggest loaf of his inventory every day to pacify him. He calls the authorities in again, who confirm he is right, and slam the baker.

The moral of the story: don’t lie to statisticians!

by Mathias 14. June 2009 16:44

While travelling to Seattle, I went shopping to the bookstore and purchased “Sway – the irresistible pull of irrational behavior”, by Ori and Rom Brafman. Each of the book’s chapter illustrates a specific bias which leads individuals to make poor decisions, through multiple experiments or real-life stories.

If you are familiar with decision theory, and specifically with decision biases – the way our brain plays tricks with us and processes information poorly, misleading our judgment – you will probably not learn much from the book. Even then, it’s a pretty entertaining read; the style is light, and the anecdotes and cases funny and very clearly explained. If you are not familiar with the topic, I recommend the book: it is a good primer to recognize traps and make better decisions!

The part which was new to me was the chapter “Compensation and Cocaine”. It seems that monetary decisions and altruism are processed in completely different parts of the brain (no surprise so far), but also that when one is active, it shuts down the other. Furthermore, the monetary decision brain is processed in the same place as the center of pleasure derived from sex, drugs or gambling (not sure what this says about the financial sector…), which has very practical implication in designing incentives. From what I gather, altruism provides a stronger motivation than money – but surprisingly, mixing both doesn’t add up: the pleasure center will completely override altruistic motivation, which is then ignored – and reduces overall motivation.

Overall, fun read – recommended!

Comments

Comment RSS