Home
The mirror troubled the far end of a hallway [entries|friends|calendar]
Michael Higgins

[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

Narrative Issues: The Dark Knight [20 Jul 2008|11:09pm]
Overall grade: A. It's well-done and thought provoking. I have some questions about the story, but they're questions I can engage with, not ones that frustrate me. Spoilers follow...

Spoilers )
post comment

Science Project Day [19 Jul 2008|12:35pm]
Yesterday we had our first Rhiza Labs Science Project Day. Once a month, we take a day to do a little project or make something that is kind of fun and off the beaten track of what we would normally do. The idea is to get a mental vacation, and bond a bit, but still do something productive that pushes our skills.

We started off the morning with way too many bagels and a list of ideas culled from our wiki (we've been collecting them for a while). We made a chart on the whiteboard and scored the ideas on a number of dimensions:

* Doability: could we actually get it done in one day? Or at least kind of done?

* Mental Vacation-ness: does it break us out of our normal work routine?

* Rhiza-ness: does it relate somehow to who we are as a company? (This one is somewhat opposed to the previous one, but they're both good things to do...)

* Awesomeness: well, you know.

* Participation: not everyone is a coder. Can we all participate somehow?

We wound up building a small iPhone app that locates program offerings from humanservices.net near your current location. My first iPhone app, though I don't think we'll be putting it on the app store quite yet ;-)

The app is very simple: it figures out your current location, hits a web service that does a proximity search, parses the XML and presents a list of programs. You can click on a program, and it opens Mobile Safari to a web page for the program.

Not an earth shattering thing by any means, but it was doable in a day (even though none of us had programmed an iPhone app and none of us have very much Objective-C/Cocoa experience). Since we normally do web apps, it's a bit of a vacation and develops some different skills. Since it uses a web service and data we already had, it definitely relates to back to our normal work. Awesomeness might not be hugely high, but hey, iPhone app! Steve Jobs says it has to be cool!

Participation was probably the toughest one. The "design" of the app was done in about the first five minutes, once we made a decision. After that, the non-coders spent time doing mostly two things. One was helping the programmers with minor stuff ("hey, I'm about to do the networking code, can you figure out what URL I should be sending and get me an example XML response?"). The other was taking the design of the app further: if you were really to do this seriously, how would you improve it?

So, at the end of the day, we had a basic little app, some good ideas about some changes to our web service API that would make this kind of thing easier to do, and a design sketch and UI treatment for a more real version of the app if we ever decide to devote real resources to doing this.

A few thoughts:

Dear Apple, PLEASE remove the silly NDA restrictions on the iPhone SDK. It's out of beta now, and people need to be able to Google for answers to questions. I would love to be able to post my snarky thoughts on your code-signing process (it's ... baroque), but that would seem to be illegal.

Coding for the iPhone is quite fun, despite some rough edges.

I think each time we do this exercise, participation is going to be a challenge. If you have a problem big enough to fully engage everyones' skill sets, it's probably too big to do in a day. It worked out all right this time around, but I do get the sense that some people were able to get more out of it than others.

Also, figuring out the right balance of doing something really different vs. doing something that could conceivably benefit the company is always going to be interesting. I think we stayed pretty close to shore this time: it's very easy to imagine (given some budget to do it) actually releasing a descendant of the thing we did yesterday and making it part of our product line (if only as a free "extra value" thing). In the future, we might want to strike out more boldly into territory that isn't so close to our normal product line.
post comment

Abstraction and the left hand that doesn't know what the right hand is doing [14 Jul 2008|09:52pm]
A bug popped up the other day that is an example of a frustrating class of computer problem. Here's how it happened:

I have some code that presents a nice UI for managing a certain kind of data. Originally, it was designed to handle data from a particular source. Later on, another source for the "same" kind of data was added to the program. Fortunately, my code is "properly" abstracted, so the UI doesn't care where the data comes from, and I can use it either way.

Unfortunately, and herein lies the problem, a requirement arose later that if the data comes from source A, the UI should behave very slightly differently than it should if it comes from source B. Unfortunately, my UI can't tell the difference between data that comes from one source or another. In essence, the program has forgotten something that it needs to know.

There are several solutions to this particular instance of the problem. One obvious one is to change the API to the UI, to add a little parameter that controls activating the different presentation. Another (not so good) solution would be to try to add intelligence to the UI piece that analyzed the data and looked for some hint that it should display it using method A or method B. (Sometimes you have to do the latter when the API is not under your control.)

The frustrating part of this situation is that I think it's inevitable. To make computer systems tractable, you have to use abstraction. Abstraction, to me, means to remove inessential details leaving behind the essence. The problem is that it can be awfully difficult to figure out what the essential details are and what is noise. If you leave too much out, you have this forgetfulness problem where information is lost as it goes through the system. If you put too much in, though, your abstraction is not abstract, and it becomes hard to use in more than one context.

To some extent good design work can mitigate this problem. It does help to think things through up front, and talk them over with others. But it can't solve it completely. We are not terribly good prognosticators, and requirements change over time. If you control all the relevant code, re-factor aggressively. That will beat the code into a useful shape fairly rapidly. If you don't control the code, be prepared for ugliness.
4 comments|post comment

moxie DaDA [12 Jul 2008|03:39pm]
Jill and I went to the moxie DaDA gallery last night. They were having an opening, but the main reason I wanted to go was that Rose has an installation in the garden out back that I wanted to see and chat with her about.

I'm glad we went. I'll try to describe the construction of the piece: it consists of eight tomato plants in papier-mache pots resting on a frame of papier-mache about two feet over an area of good soil. All this is near, but not quite in the shade of, a crab-apple tree. The tree is framed by two sets of eight stones, one set embedded in the ground and one set in suspended just above the ground. In the tree is a chime made of silverware. (There are more details, including a nearby garden of herbs, but I'm not going to do it justice with a prose description anyway.)

The tomato plants represent Rose and her siblings, and the overall piece discusses her struggle with her mother's depression and how that affected the family.

The reason the piece is successful is that it evolves dynamically because it is outside and exposed to the elements (and interference of other people). When we saw it, rain had already caused the pots to fall through and break down. Now the tomato plants are growing back up through the broken frame. Two of the plants landed badly, though, and bounced outside of the frame, so they are growing by themselves.

Anyway, it combines several things I really like. One is the aesthetic of decay and re-growth. Another is the introduction of a controlled amount of randomness. I think some amount of randomness and re-shuffling is really important for a successful creative process (it's also really important in other areas).

I'm looking forward to seeing how it evolves over the rest of the summer. There are some photos here, but if you're in Pittsburgh, it's easy to find. The moxie DaDA is right down the street from the Mattress Factory (which also has a great garden). It's on the corner of Arch and Jacksonia (the entrance to the garden is on Arch, and Rose says it's always open).
post comment

Post robot saturday [12 Jul 2008|03:39pm]
[ music | Moonshiner-Uncle Tupelo-March 16-20, 1992 ]

Last night I went over to the Mattress Factory to see my robot. Jill didn't come because she had a tiring and mud-splattered day, which was okay, but I should get better at trying to put together a posse for these things in advance.

The robot needed a few minor tweaks when I arrived. The stabilization rod we added did help a lot, but it's not perfect. Also, I don't think the helpful gnomes who did the set up really knew what they were doing. That said, if I ever have a future life as an artist, I think interactive installations are not a bad idea. You get to watch people try to figure out your thing. An observation: we had attached an autoharp to our robot as one of the noise generation units. No one actually knows how to play an autoharp. Here's a hint: just pressing the buttons doesn't do anything! You have to strum it and press the buttons.

I saw Rose and Kevin there, who were on my team. Rose had another robot as well, since she was at the Brew Works Robot 250 class. She also has a garden installation down the street in the garden at moxi DaDA. I might go over there this evening to check it out.

We all went over to the other Mattress Factory building (1414). I ran into David Holstius, mastermind of the "We Are Survival Machines" zombies vs. robots gigapan project. It was about two million degrees in 1414, so eventually I went back to the main lobby to check on the robot. Then I swung by the Warhol to see the video installation of "We Are Survival Machines".

I am very tall as a zombie.

Today I've been lounging around reading comics on the porch.

In other news, I didn't get a 3G iPhone. I did upgrade to the 2.0 software and bricked my phone for a couple of hours while Apple's servers unclogged themselves. I have since downloaded several applications. So far my life remains unchanged. Anyone have any favorites?

6 comments|post comment

Robots Friday Night [10 Jul 2008|10:47pm]
There's an exhibit of robotic art at the Mattress Factory tomorrow night:

http://www.mattress.org/index.cfm?event=ShowExhibition&eid=87&c=Upcoming

Last year I was part of a team that made one of the robots.  We pulled it out of storage and, with a hacksaw and some threaded pipe, managed to breathe new life into it.  

Also, down the street at the Warhol, the "We Are Survival Machines" GigaPan zombie vs. robots video installation will be showing starting tomorrow. Among many others, Jill and I appear as zombies.

I think it all gets started around 6pm. The Mattress Factory reception is free --- not sure about the Warhol.
1 comment|post comment

Narrative Issues: WALL-E [06 Jul 2008|09:42pm]
Overall grade: A+. There are no narrative issues: this movie is close enough to flawless that changing something would just screw it up.
post comment

Narrative Issues: Hancock [05 Jul 2008|07:56pm]
Overall grade: B+. It's thoroughly enjoyable, and fairly original. But I can't help but find fault. Spoilers ahoy!

Spoilers )
post comment

Going down south [13 Jun 2008|10:57pm]
Well, a little ways anyway. Jill and I are going down to Hinton, WV until Wednesday next week. Communications will be limited.
post comment

Are you a Tom Waits fan? [12 Jun 2008|07:16pm]
I've been periodically checking ticketmaster, hoping to get some tickets for his Columbus concert date. I had been consistently rejected, and assumed they were all sold out, but ticketmaster (in its teasing way) told me to keep checking back. So I did.

What do you know, just now I got two tickets! So, don't lose hope. The ways of ticketmaster are strange and mysterious.
post comment

Egad! Tom Waits is touring! [10 May 2008|07:32pm]
Tom Waits is going to be on tour! Road trip to Columbus?

Also, Jill and I are now in San Francisco.
post comment

San Francisco [09 May 2008|08:44pm]
Jill and I are going to be in San Francisco starting tomorrow for about a week. I'll be going to Where 2.0, and probably to WhereCamp as well.

But in between, a certain quantity of vacation will be occurring! So if you're around, give me a shout.
2 comments|post comment

Gin, Television, and Social Surplus [26 Apr 2008|03:15pm]
Here's a cute article by Clay Shirky called Gin, Television, and Social Surplus. It argues that society has a vast cognitive surplus that is mostly dissipated watching TV. If even a small percentage of that were used to do something, say, edit wikipedia articles, the world would be a better place. He goes on to argue that now that connecting with other people is easier (yay, internet!) some of this cognitive surplus will no doubt be used.

He's probably right. On the other hand, I tend to watch TV when my brain is tired. So, he may overestimate the real size of the surplus.

In other news, all the Rhiza paperwork is finally signed. Kind of anti-climactic since it's works retroactively back to April 1. Still, good to have all the legal stuff done.
post comment

Databasin.org Google Tech Talk [21 Apr 2008|01:43pm]
Our talk at Google, DataBasin.org: Creating incentives for people to share public GIS data just got posted to YouTube. Josh, Rhiza Labs' illustrious CEO gave the talk together with Dr. Tosha Comendant from the Conservation Biology Institute.




Some interesting parts of the talk (with handy timecodes for the lazy!):

(02:00) About the Information Commons and cloud computing. We've gotten a lot of positive feedback about this aspect of the talk, but there is a little bit of potential for confusion. We're advocating public, shared data, but also the ability for organizations to own their own little piece of the Commons. This goes beyond, say, a service like Amazon S3, where you own your own data, but Amazon owns the storage infrastructure.

(07:50) What does Rhiza Labs do? The Information Commons, by itself, is pretty low-level. It's a property-store database. We build applications and higher-level services on top of that low-level infrastructure. Some of those services are about getting data in and out, and some are about providing analytical value.

(11:40) About the specific DataBasin project. Here is where we really start to talk about the conservation mission of CBI and the Wilburforce Foundation. We also talk about some of the specific real-world issues involved. It's all very nice to talk about sharing data in the abstract, but part of our challenge was to help incent people to actually do it (or, at least, remove some of the common disincentives).

(14:55) The design process --- in particular, interviewing and understanding the potential users of the system. This is pretty classic MAYA Design-style work, which, as a spin-off, we're naturally fairly good at ;-) We developed some specific personas to target the design to, and, of course, the infamous (to us, anyway) kidney bean diagram (18:10).

(25:00) The site demonstration starts. The first part of this goes a little slowly, and doesn't show up terribly well on YouTube. What it's showing is a series of "snapshots", which are maps produced using the tools on the site from data uploaded to the Commons. The first several snapshots document the development of roads in the Alaska Tongass National Forest over the course of the 20th century, together with data about where clearcuts have been made in the forest. (As you can imagine, there's a striking correlation.) One of the first things the folks at CBI showed us when we first started talking to them was a custom animation they had produced to show this very thing. Now, the series of snapshots isn't quite as slick as their animation, but it shows the effect quite clearly and can be made by anyone in about five minutes. That sort of easy access to data is a big part of what the site is about.

(27:20) A complex map. For time reasons, most of the snapshots we make during the presentation are fairly simple. This is a fun example of a more complex map, made up of data from a number of different sources. It also has a visual comment (sort of like Flickr, you can draw a region on the map to add annotations or notes) around 29:00.

(33:15) A chart. You can also make simple charts. This has seen a lot less development than the maps, so it's limited to fairly simple bubble/scatter plots right now, but I anticipate a lot of growth in this area down the line.

(34:45) Up to this point, we were showing "pre-baked" maps and charts. Here's where we show a bit of how to make one yourself. When you make a map, you can start from "raw" data that you find on the site. However, you can also start from a pre-built snapshot that someone else made. This doesn't change their snapshot; you just use it as a starting point for your own. For this example, Tosha shows an analysis that CBI did regarding California Redwood habitat. Then she creates a new snapshot that overlays part of CBI's protected areas database. Fortunately, the highly protected areas line up reasonably well with the most critical redwood habitat.

(41:00) A similar example, but starting from a search for raw data. Tosha shows the projected effects of a doubling in CO2 out in 2070-2099 on vegetation in the United States and how it changes from the current vegetation coverage.

(48:00) How to import data into the system. This is a bit dull, but actually critical to the success of the system, since the more data you can get into the better.

You can go to the DataBasin website, but you can't do much without an invite key right now. We are just getting started with the alpha test period. Beta will be wider. Also, for the moment you've gotta use FireFox (sorry!).
post comment

Talks next week [13 Apr 2008|08:34pm]
I'm going to be in California briefly next week to give a Google Tech Talk. That's on Tuesday --- I don't know if it's open to the public, but if we're lucky it will be video taped and put on the web.

Josh is going to stick around for a few days and will be at these fabulous venues:

-----------------------------------------------------------
Wed, April 16, 2008 from 5:30 - 7:00 pm
Evening Lecture Series at the Rockridge Institute
Rockridge Institute, 2105 Martin Luther King Jr Way, Berkeley CA 94704

Summary:
Josh Knauer will discuss the need for open access to public data and providing the tools/means to make that happen through the Information Commons. We'll also spend a bit of time discussing the emerging trend of privatization of public information and explore ways to stop it.

-----------------------------------------------------------
Thurs, April 17, 2008 from 12:00 - 1:00 pm
Tides Center Talk - Emerging Technologies in Community Information Sharing
Tides Foundation @ The Thoreau Center (Lincoln Blvd. and Torney Ave, Presidio Building 1014, San Francisco, CA 94129)

Summary:
If data exists and is being collected, then why isn't my community using it? Lack of data sharing is a common problem across communities of all sorts, and is preventing effective communication and growth. This talk will discuss case studies of how cutting edge technology is being used from social services to conservation science to bring their communities together.
-----------------------------------------------------------

I know y'all are drooling with excitement!
2 comments|post comment

Spring [01 Apr 2008|11:44pm]
Today we put our newest product into acceptance testing with our client. I spent part of the afternoon adding a little Easter egg --- I think it's the first time I've put an Easter egg into a piece of commercial software. It'll be interesting to see if any of the alpha or beta testers find it on their own (I think it's fairly well hidden, but not insane).

By the way, if you're interested in conservation science or GIS or web communities, or all of the above, let me know and we can talk about possibly being part of the alpha or beta testing rounds. We'll be talking more about the project in a tech talk at Google in two weeks, and I think we're also going to be giving at least a mini-demo at Where 2.0 in May.

Also: excellent front-end engineer wanted. Not that we have any cash to speak of this month. Start-ups rule.

Meanwhile, this weekend I plan to not work. It will be my first weekend off since January. Perhaps I'll clean the house. Perhaps I'll lie on the floor and vibrate. The possibilities are endless.
11 comments|post comment

Rhiza Labs [14 Mar 2008|03:26pm]
The website is up. I let Josh pick my title --- apparently, I'm the Chief Technology Officer.
4 comments|post comment

Reviews: SingStar 80s and a Touch of Evil [02 Mar 2008|12:37am]
Tonight I experienced both SingStar 80s and Touch of Evil. In every important way these things are from opposite poles of the American cultural experience, but I found my reaction to both similar: they are both badly flawed, but ultimately enjoyable.

You all know that I'm pretty much tone deaf, yet addicted to the Karaoke Revolution series of games. SingStar is a competitor with the same basic idea, produced by Sony. I got the "80s" version of the game for Christmas, but hadn't had the chance to break it open and play (all work makes Jack a dull boy). You literally do have to break it open --- it's packaged in that horrible invulnerable plastic that cuts your fingers and that was invented by Satan himself to teach you that materialism is evil. Anyway, Jill and I sang through every song.

The good news is that it has a fantastic song selection. Sony gets to use the real song versions (KKR primarily buys the rights and re-records the songs, though to surprisingly good effect in most cases). Sony's programmers also seem to have figured out how to make the song load and play immediately --- KKR has an annoying "loading" screen before every song. SingStar also records your singing and gives you the option to play it back, which always seemed like a missing feature to me in KKR. (Though in reality, of course, no one really wants to hear themselves sing ;-)

But the game play is terrible. The primary game mode of KKR is the most obvious one: you get a bunch of people together, and you take turns singing songs, and the game scores you. (Supply your own beer.) As far as I can tell, there's no easy way to do this in SingStar 80s. There are a bunch of atrocious "party games" that compel you to sing at the same time as the other person playing, often in a weird "medley" --- Sony's programmers apparently believe that "medley" means splicing random phrases from songs together with an "applause" effect. It's hideous. You can play in "solo" mode and just sing songs, but then you have to go back to the main screen to select a different player. We found it easiest to just share the same player and hand the mic back and forth. (You don't get an avatar, so the only defining characteristic of a player is a name and a score.)

The user interface is very poor in general. For some reason, the screen is not quite the right size for a 4:3 television set, just by a few pixels, so there's a special "slide the display around" mode that entirely fails to fix the problem --- you can either lose the bottom couple of pixels or the top couple. As Jill remarked, "wouldn't it have been easier to just fix the bug instead of develop an entire configuration screen to try to work around it?" Apparently not. They use a lot of light grey text on a white background, which is basically the worst possible color choice for legibility. Like KKR, it uses a "piano roll" notation to help the tone-impaired sing the right notes. But, unlike KKR, it doesn't scroll the piano roll continuously. Instead, it displays each phrase individually. That wouldn't be so bad, except that the pitches of the notes are displayed relative only to the other notes in the same phrase, *not* the other notes in the entire song. So it's extremely common for a very high note to wind up lower on the screen than a low note you *just sang*, simply because it's not in the same phrase. They have the same problem with rhythm: some phrases are very long and some are very short, but the notes always occupy about the same amount of horizontal space, so time seems to stretch and compress.

It's also pretty random about whether, at any given moment, you're expected to sing the lead vocal or a backing vocal. It often switches back and forth. I suppose you learn it pretty soon, but isn't singing the lead the obvious thing? (The game does give you the ability to pick which vocal you want to sing in duets: for instance, you can either sing Run or DMC in "It's Tricky." That one is weird, though, because there's a special "rap mode" that seems to be rhythm based.)

Most songs have the original music video playing in the background, though not "Eye of the Tiger" for some reason --- it just has a sort of tiger-striped screensaver thing going on. It's kind of fun to watch all the old new wave haircuts, but I'd rather have an avatar. It's much more engaging.

Verdict: it's possible to have fun with this game, once you get over the random crap it puts you through. KKR is, on balance, a much superior offering. If KKR's programmers and designers were given access to Sony's song catalog, everything would be super awesome. And I must remark that I sing "A Little Respect" remarkably well.

After dinner we watched Touch of Evil. Well, I watched Touch of Evil. (Spoilers ahead!) Jill got bored in the middle and went to bed. It's a very strange movie. First of all, Charlton Heston is not exactly convincing as a Mexican cop, especially when surrounded by very broad Latino stereotypes. The subplot involving Janet Leigh in the motel with the druggies sort of reminded me of a "Reefer Madness" kind of movie. There's a lot of barking back and forth with various Fifties Dudes interrupting each other and talking very quickly. I've always wondered if real people talked that way in the forties and fifties, or if it's just a movie thing.

Anyway, once Orson Welle's character starts hitting the bourbon, the whole thing gets a lot darker fast, and became more watchable for me. There are a couple of scenes which still manage to shock, but a lot of things "turn out okay" that would probably be more brutal in a more recent film. Janet Leigh's character in particular turns out not to be shot up with heroin but only drugged with sodium pentothal. That's just weird: a drug gang kidnaps her in order to ruin her husband's reputation by setting up her up as a druggie, but rather than actually filling her full of drugs, which presumably they have easy access to, they bother to go get sodium pentothal and use that? These are very charitable and oddly hard-working thugs. Needless to say, there are a bunch of other horrible things they could have done to her that they don't. Ultimately, of course, the drug lord isn't the truly evil character, so maybe that's the point.

Many things must have seemed like good ideas at the time, but really aren't. Marlene Dietrich's character is an example. She's a gypsy who runs some sort of house of ill repute. Maybe it's a brothel, maybe it's a bar, maybe it's a place to get your fortune told. All we know for sure is that there's a really annoying player piano going all the time, Orson Welles is her only customer, and he really likes her chili. (Many gypsies who hang out in Mexican border towns have learned to make a killer chili.) I think her character exists entirely to deliver the line "He was some kind of a man. What does it matter what you say about people?"

Speaking of some kind of man, Charlton Heston needs to work on his priorities. He's just gotten married to a woman who spends most of her time lounging around dressed like this:



and yet he seems to feel the need to involve himself in a murder case outside of his jurisdiction, leaving her to the mercies of vendetta-driven drug lords. I can't help but feel that if he was a little less driven by Justice and a little more driven by Nookie, that a whole lot of problems could have been avoided. It turns out that the guy he was standing up for was guilty all along anyway.

So, great tracking shot at the beginning, but I'll take Citizen Kane.
2 comments|post comment

Review: The Commitment [17 Feb 2008|12:22pm]
At first, I thought The Commitment was just sort of a rambling rant: Dan Savage chatters on about whether or not he wants to get married with periodic detours to discuss gay marriage in general and the perfidy of the Religious Right.

And that would have been fine. Savage is always entertaining, and the topic matter has meat. But the book does actually have a structure: it's more like a spiral. Dan and his partner (and their kid) go around and around the same arguments again and again, but as they get closer to their ten-year anniversary, the emotional stakes go up, the political diatribes get sharper, and the book gets funnier and more touching.

I won't ruin the end for you (not that it will come as a huge surprise). For many people, I think the arguments about gay marriage will be the most interesting part of the book, but as a (relatively) newly wed person, I found the general discussion of commitments and relationships to be much more interesting. (Besides, he's sort of preaching to the choir with me on gay marriage --- though I guess I haven't made my HRC donation lately.)

Upshot: very good. It blends the personal and the political well, and it's funny too. (And if you're only familiar with Savage from his advice column, there's significantly less discussion of sex toys and bondage in this book than you might expect.)

Speaking of the Gay Lifestyle, I saw Freezepop last night at Pegasus with Anukul and Dana. (Jill didn't feel like going out.) Great show. Their live performances have gotten more musically sophisticated over the years --- they kind of have a band now, and at one point played an actual guitar with strings. (The mind boggles!) The crowd was great, and they closed with covers of The Final Countdown and Don't Stop Believing, which was AWESOME. (Shut up. I totally have cred.)
post comment

Types and tests [11 Feb 2008|06:46pm]
Are unit tests the static type system of dynamic languages?

A static type system does the following things:

* It provides a minimal level of documentation telling the programmer what sort of data a function expects to operate on and return;

* It provides an analytical scaffolding that allows a compiler to automatically check for certain kinds of errors;

* The same scaffolding allows certain program transformations to be done in a "safe" way. These are often optimizations (done transparently by the compiler) or re-factoring operations (done explicitly by the programmer with the aid of an IDE).

On the down side, all this type annotation scaffolding causes code to become more verbose. This verbosity can be a worse-than-linear effect as the program grows: connecting different pieces of code together in a strongly typed system often causes a lot of extra code to be written just to make the types and protocols match up.

Dynamic languages, on the other hand, don't support this sort of scaffolding. While values still have types, these types can change over the course of the program, and there is no way to specify that certain functions expect certain types.

The big win is that dynamic languages tend to be very concise, largely because all of that annotation to explain to the computer (and to other programmers) what sort of data is expected goes away. Similarly, when connecting together pieces of a large program, it's not necessary that types match exactly. As long as the parts do the right thing, all is well. (Needless to say, guaranteeing that can be problematic.)

But you lose the self-documenting feature of type systems and the ability to automatically (and statically) detect type errors and do optimizations and re-factoring.

Instead, dynamic language proponents put even more emphasis than usual on unit testing. Instead of relying on the compiler to check errors, the test suite checks the errors. The tests can also serve as documentation: how is the function usually used in practice? Look at the tests.

Tests are, in fact, much more powerful than types. A unit test can verify any computable set of semantics, whereas type systems can only tell you that the right sort of value is in the right place.

So tests are better, right? You can define any semantics you need, write tests that verify those semantics, and you've got your documentation and error-checking covered, right? No need for those messy types.

Well, sure, kind of.

The first problem is that you've got to write the tests. No one ever has 100% test coverage. Far from it. (Think about how many cases you would need to completely test the "add" function.) Writing tests is time consuming, usually fairly boring, and itself prone to errors. Type systems have soundness properties, though, and if your type system is sound you know that your program has "coverage."

The second problem is that the semantic strength of tests is its undoing as far as writing tools goes. Because type systems are simple and (relatively) easy to formally characterize and prove things about, you can write program transformations that preserve types. But tests are Turing machines: you can't prove shit about what they do in general, so you can't write code that "understands" the tests and uses them to understand the underlying program.

My opinion is that the concision of dynamic languages is, overall, enough of a benefit that you can live without automatic re-factoring. (A good chunk of automatic re-factoring is done to try to help with the bloat that came about from the type system in the first place.) And it's not impossible to write re-factoring tools that work heuristically --- you just better have good tests to make sure they don't break your code!

All of this was sort of semi-inspired by Stevey's recent characterization of types as being akin to comment bloat. I see where he's coming from: strong type systems can be awfully frustrating. It's intolerable to write (or read) Java without a smart IDE that helps with all the type cruft. And it's so painful when you encounter a situation where duck-typing would "just work" but you have to introduce wrappers in order to match types.

The big difference, though, is that the computer can't read the comments, but it can read the types, and it really can do some cool stuff with that information. Tests are, ironically, too powerful to subsititute for types completely.

(I do completely agree with Stevey that "huge long comments" are a sign of young programmers. Comments should be brief and to the point. The idea is to clarify the non-obvious, not to re-implement the program in English. Also: comments cannot be tested, so are quite often wrong or obsolete. A wrong comment is worse than no comment at all.)
4 comments|post comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]