Thursday, October 13, 2011

Product vs Platform in Programming Languages

There's a big rant floating around the internet this week about Products vs Platforms. Platforms are service-based, with layer upon layer of exposed and secured and throttled services, while Products give the user everything they need in a perfect streamlined form. That is, Products give the user exactly what the builder of the Product believes they need.

Steve Yegge believes we should all be building platforms. It makes sense; Facebook and iPhone and Android all provide some core functionality and let the whole world build on top of them. They're like this Lego table:

Lego building table

So, applications can be self-contained programs or expansible platforms, or somewhere in between.

Programming languages have this spectrum as well. John Backus, in his famous Turing Award lecture (pdf), divides programming languages into framework (functionality built into the language) and changeable parts (all the reusable modules we create in the language). Backus votes strongly for languages with a small framework, instead emphasizing expressive, easily-combined changeable parts.

Functional languages target tiny reusable components that combine in many ways. Building programs with them is like playing with Legos -- the old-fashioned Legos with small rectangular blocks in bright colors. You can build anything with those.

Legos climbing out of your head

In strictly-OO languages like Java, the reusable parts are bigger and fancier. They're more like the new Legos, where whole walls come in one elaborate piece, and half the pieces are special-purpose bells and whistles.

elaborate yet inflexible Lego castle

You can build a space station or a sturdy castle quickly, but if that castle wall piece is seven lumps wide when you expected six, it's going to be one ugly castle. Combine too many of these bulky languages and specialized frameworks and...

scary alien head made of Legos

No comments:

Post a Comment