Monday, March 30, 2009

Monads are Burritos

Earlier in the month, I gave at talk at the Lambda Lounge. The title was Monads are Burritos.

The slides are here. Some example code in Haskell is here. (I have provided examples both with and without the do-syntax: the latter is much cleaner and easier to use, but only once you understand the former. Be warned: the examples are rough, if you don't know Haskell).

The following are among my goals when it comes to talks:
  • I usually have a small set of ideas that I want to state, much like a thesis statement in an essay.
  • I strive to make the experience of attending a talk vastly different from the raw material on the slides. A goal is to reward those who come to my party. Imagine a 1920s ballroom on a Sunday morning. The slides should be like empty beer bottles, overturned tables, and bras hanging from the ceiling fan: mere artifacts indicating that something larger has taken place.
I may or may not have achieved these goals, but the result is the same: the slides will seem odd. So, here is an overview of my thesis points.

Monads are not Burritos

Brent Yorgey has a wonderful post on the tarpit of writing monad tutorials. Generally, someone goes off into the mountains for a few weeks, works hard, and has some kind of epiphany: say, for example, that monads are like burritos. Afterwards, they rave like a lunatic to puzzled listeners/readers.

To me, monads have nothing to do with burritos, but I liked the post so much that I named my talk after it.

Find your own Burrito

Some have challenged the FP world to explain monads in 2 sentences. I can't do that, but in 1993 I couldn't have done it for objects. In my freshman year, I couldn't have done it for recursion.

In other words, even if I did think that monads are burritos, it doesn't matter. You have to do the work and find out your own revelation. That is to say, you have to find your own burrito. Just as we did for polymorphism, encapsulation, inheritence, and so on.

Dude...

The comic Demitri Martin has a puzzle wherein he wonders what the smartest thing anyone has said that starts with "Dude...". My favourite of his: "Dude, these are isotopes". (FWIW, he means "dude" here in a gender-neutral, skater-scene tone.)

I have two offerings (one of which was given at the talk):
  • Dude, a monad is a burrito, if a burrito is a functor-like object with a generic type, a sense of encapsulation, and the ability to combine small computations into larger ones!
  • Dude, a monad is a programmable semi-colon!
Examples?

This post won't give examples, or even really try to explain the zen of monads. This is really intended as an explanation for the beer bottles and overturned tables. (Here are some more).

I may post some code later on, as a supplement to those who were there for the talk.

Thursday, March 26, 2009

Applying Project Coin to Agile Development

Project Coin

As noted in Alex Miller's various Java7 posts, Project Coin is a set of small language changes proposed for Java7. As noted on a recent Java Posse podcast, these changes should be on the same order of magnitude as the new for-loop in Java 5. That is to say, the change should be small: a coin, as it were.

All well and good, but this post is not about Java. This post is about the reaction to the project. Though I prefer Project Coin it could also be called Project Breathmint, because it is refreshing (even fun) to talk about small features that do not ignite the flames of debate as much as say... *pause for effect* closures. These are lightweight changes that can really make a pleasant difference.

The Idea

My proposal is to consider your own Project Coin for your project.

The Background

There are many casualties in the lack of communication between developers and the stakeholders of a project, even on agile teams. One such casualty is this: customers, domain experts, and especially support staff often despise a given defect or quirk that is quite easy to fix. A recent case for me is a recurring exception trace in a log file (it occurs often because of a poor API design: the exception is thrown in a reasonable, normal situation). The support staff have learned to pattern-match it, but it gives them fits.

The Execution

We should not lose focus of the main money-maker: delivering maximum bang-for-the-buck features to customers, where said features are prioritized by stakeholders. However, it seems reasonable for a team to draft a Project Coin once per quarter. The first benefit will be reaped immediately: communication. Even if an item proves to be too large to be a coin, the dialogue among the team will be worth it.

Once the list is compiled, the team could shoot for one coin per iteration (e.g. every 2 weeks). Naturally, if an item doesn't make it, that is acceptable: these are literally bonus points.

The Project Coin items are perfect for newcomers to the project, for junior developers, or for Friday afternoons when we need a break. A danger is that someone will go hog-wild with a complete framework to fix a small problem, but daily stand-ups and code reviews should keep that in check. (Your team does have dailies and code reviews, right?)

The Upshot

I can't say that I've put this into practice. However, my team has talked about this idea in nebulous terms. Now that we have the coin metaphor from Java, perhaps it can become a reality for many agile teams.

Tuesday, March 24, 2009

Ada Lovelace Day: Grace Hopper

Full Disclosure

New readers may want to know that this blog is on this list for posting photos of women holding geeky stickers. For what it's worth, this blog also features photos of men holding geeky stickers. Are any of them geeks? I have no idea: I didn't have time to find out. A geek is not defined by gender or looks; a geek is defined by characteristics such as:
  • Wondering, incredulously: "Did MIT really ditch Scheme in 6.001?"
  • Being able to answer "is 47 a prime number?" in a blink of an eye
  • Enjoying weird puzzles like "what does a nanosecond look like?"
Ada Lovelace Day

I think Ada Lovelace Day is a good idea. Ironically, despite being on a male privilege list, I (sadly) recognize many of the issues listed. Moreover, I have two young, wonderful cousins (girls), and I would like to help to ensure that computer science and mathematics is welcoming to them. If posts like this help the cause, then why not...

The Star

This post is about a wonderful pioneer of computer science. She was brilliant, witty, and an influence on me as a undergraduate student, via print and film.

She also happened to be a woman. Though Ada L Day is a motivating factor, I have long wanted to write an appreciation, because of her abilities, contributions, and style.

She is Grace Hopper, one of the first rock star programmers. I post this for a younger generation, lest we forget.

I've decided not to write a biography: peruse the achievements on Wikipedia. They are stunning. She easily had more on her resume by 1941 than your most of your CS profs, here in 2009. Suffice it to say that she would go on to work on the Harvard Mark I and the UNIVAC. She also helped design COBOL (laugh if you must, but see below).

When I think of her, I think of these influences:
  • She famously demanded to see a nanosecond: she would hand out wires that were the length traveled by light in 1 nanosecond. To this day, I try to use props whenever possible in discussions.
  • I once read the transcripts from a language symposium in the 1970s. Grace said something along these lines "... if you remember one thing from this, remember that COBOL was a temporary proposal. We did not intend for that version to be the final draft." This is fascinating but also a great presentation technique. Again to this day, I use that phrase for effect "if you remember just one thing....".
  • She didn't take any crap from anyone. See her interview with David Letterman below. Though it is dumbed-down for pop culture, notice her matter-of-fact style. There is no need to showboat for TV: these are the facts, and it is all perfectly logical. I love it.
Setting an Example

Grace Hopper was fantastic, plain and simple. To me, her example for my young cousins -- and everyone else -- is this: if you are a geek, be the best you can be. Embrace it, live it, love it. Be so good that you transcend labels, because no one can stop a geek who simply kicks ass.

Saturday, March 14, 2009

No Fluff Just Stuff St Louis: A Review

Ed's note: I work for a sponsor of the StL NFJS and many of the local speakers are friends. That said, I have attended the Gateway NFJS for 8 years, most of which were through a previous employer. If you know me in person, you know I enjoy these shows tremendously.

The Gist

Last weekend, I attended the 2009 St Louis NFJS show. As long-time readers will know, I really enjoy both the content of these shows as well as the energy from talking to other attendees.

In this recap, I will try to highlight my experience with the assumption that you are familiar with the format and the NFJS tour. If not, there are many resources on the web describing the basic idea of a "conference near you".

The Sessions

Here are some highlights from the sessions I attended. Note that later posts will have thoughts/questions that arose from these talks.
  • Sporting a Hawaiian shirt "made from an amalgam of sofas", Alex Miller gave a talk on Java 7. With his Java 7 website, it is hard to imagine someone with a more complete view of the big picture. One slide included all potential features, and the current status of each. I especially enjoyed the background behind Project Coin, JSR 310 (Date/Time), and the fork-join frameword (jsr166y).
  • Alex is hardcore into concurrency, and gave some talks in this space as well. This is essential stuff. It is not clear to me if Java will be the longterm answer for concurrent programming on the JVM, but right now it certainly is: if you do threading, you need to see Java Concurrency Gotchas.
  • Ken Sipe gave several talks on understanding garbage collection and tweaking the JVM. I saw the one on GC in the past, and it helped me solve a tricky memory leak at a client site. I went back for more this year. If you want to be a problem solver for your project in production, his material is top shelf. Who else points to a graph spike and says with a devilish grin: "we are now watching a star die" ?
  • I caught Scott Davis' talk on Lizard Brain Web Design. This was one of the most fun, as Scott is a terrific speaker and the topic is about the nebulous nexus of practicality and aesthetics, outside of the machinations of the IDE. Anyone can simply read the pop psych books but I enjoy how Scott brings it together into a coherent, relevant narrative. This stuff just comes alive.
  • My colleagues Mark Volkmann and Tim Dalton gave excellent talks on Clojure and Scala, respectively the cutting-edge of languages on the JVM. I've seen precursors to these talks before so the material was familiar: I really want to see 'part 2' where each talks about concurrency and/or software transactional memory.
Some other major themes included Groovy, JMS, and agile practices. Incredibly, I didn't attend any Groovy sessions as I feel very comfortable with the language, and with Grails. I've seen the JMS talks before (recommended) and others were casualties of scheduling.

The Vibe

My main sources for the "vibe" of the conference are the Birds of a Feather sessions, the polls during the expert panel, and just interacting with other attendees:
  • I attended the BoF on dynamic languages. The discussion was solely centered on funcational languages. Several people wondered about the allure, and if the masses could make the leap. Again, a theme was the potential sea-change with respect to concurrency. I told one chap that if we could learn object-orientation (recall how tricky polymorphism was in 1994?), then we can learn FP.
  • Jay Zimmerman took some interesting, informal polls. e.g. The majority of attendees wrote unit tests and used agile practices. Agile seemed non-controversial and an ideal, much different from an NFJS from, say, 2003.
  • A common theme among conversation was: which new language should I choose? Venkat Subramaniam said it best: it doesn't matter. Just pick one and go with it. It is more important to learn ideas (from any language) than mere syntax from any one in particular. He cited the conventional wisdom that it is important to know a language from each major school (e.g. functional, object-oriented, etc).
The Keynote

Venkat gave the keynote: Facts and Fallacies of Everyday Software.

After discreetly kicking off his shoes, he launched into a comical tirade about the collisions between common sense and stupidity, using some clever photos to shine the spotlight of logic on absurdity (e.g. a "No Fishing" sign on a bridge that is 1000 feet above the ground). I've seen some dandy keynotes in the past (including the Chairman of the Board) but this was the closest to a good stand-up comedy routine.

In between the laughs, the thesis emerged: think! Observe and challenge the requirements, the process, and the software.

The Upshot

I like to clown around but I truly enjoy sharing experiences about software. This NFJS was energizing, as usual, because of the quality of the speakers and the participants. There were so many conversations and ideas that it is difficult to capture here.

David Geary has a great line about GWT that applies to this past weekend: it makes writing sofware fun again.

Thursday, March 12, 2009

Make Money with tonight's StL JUG

The mobile platform is the new gold rush: there's gold in them thar hills (*).

As you know, there are 2 potential goldmines: the iPhone and Android. I won't tell you which one to pick, but consider this depiction of the battle.

Tonight, at the StL JUG, Eric Burke will introduce us to one of the major players: Android. Come on out and see what is possible. You are only bound by your imagination.

If you can't make it, check out the related videos on OCItv

(*) For those who are not American, it is not clear if you can actually make money with the Android app store: international business is tricky. But surely (?) you can do some free stuff and get your name out there. Often, name recognition will open doors.

Tuesday, March 10, 2009

Get Gregarious: Grok Griffon at Gateway Groovy Group

First, you should meet the nascent Gateway Groovy User Group: it has been started by Dave Klein, a friend, upcoming JavaOne speaker, and all-around class act.

On Wednesday night, March 11, the GGUG will feature Matt Taylor, speaking on Griffon. Matt is not only a friend but also an excellent speaker and is seriously involved in Groovy, working for G2One/SpringSource. As I understand it, Griffon is a Grails-like framework for desktop applications.

Cool people, an interesting topic, and free: that's hard to beat. Come on out and socialize! I'll see you there.

ps. For the artistic types, Griffon is having a logo contest until March 22. Imagine the fame if you won...

Monday, March 9, 2009

The Faces of Gateway NFJS 2009

Here are some photos from the recent No Fluff Just Stuff show in St Louis. Stay tuned for a review and some thoughts stemming from the conference. In a nutshell, it was an excellent show with an energetic crowd.



These are my people: smart geeks who consider Java/JVM technologies as a way to spice up an otherwise dull and dreary weekend. No boredom here!



NFJS attendees report the final score:





Speakers Scott Davis, Venkat Subramaniam, and Ken Sipe ham it up to form the MVC pattern:





NFJS attendee (Jeff G), and speakers Mark Volkmann, Tim Dalton speak to the importance of functional programming and concurrency:





NFJS attendees report the score from the lobby:





NFJS attendee, speakers Alex Miller and Mark Volkmann define a monad (from functional programming):





NFJS attendee, and NFJS organizers form the MVC pattern:






That's how we roll on a geeky, tech weekend....

Friday, March 6, 2009

Beyond TGIF: TGI NFJS

I've had a lot going on (including a fun night at the Lambda Lounge), and have neglected to mention that No Fluff Just Stuff returns to St Louis this weekend.

This will be my 8th one here in St Louis (i.e. all of them, I think).

I'm pumped! Long-time readers will know that I'm a fan of NFJS, both in terms of the content and especially the energy from the crowd.

I'm looking forward to many of the speakers, including my friends and the Gateway's own Alex Miller, Ken Sipe, and Mark Volkmann.

I don't have an iPhone or G1, so live pics and tweets will not happen. However, I do hope to document some of the vibe, and I'll be loaded with various and sundry stickers. Stay tuned or check out my Twitter feed (@codetojoy)

See you soon!