Can Software Be Like Building Lego?
I'm not thinking about programming the actual solid plastic bricks (though some people do). Rather i'm thinking about the idea of:
"Making the construction of a program, as simple, fun and obvious, as putting lego blocks together"
I've seen lots of people write about this idea before -- either denying that such a thing is possible, or pimping their own new tool as the long-awaited realisation of the 'lego programming' dream.
But neither side has ever clinched if for me. One group argues that lego programming is not possible, because programming is just too tricky.
The other group will point to some new technology they've created, and claim that this will finally bring 'programming to the masses' -- which is the kind of crazy talk i'm tired of.
But I like to think about this Lego Programming idea now and then. To understand the idea, I think you've got to start by looking at lego itself...
Building With Lego Is Fun And Easy
What makes it so?
My first thoughts were all about the lego itself...
- The colours are bright.
- The constituent parts are almost indestructible.
- They have a very visual and obvious connection mechanism:
- it's obvious how two pieces connect
- it's obvious how many pieces can interconnect.
- It's obvious when two pieces are fully connected. They can't be *half* connected.
- It's obvious when a piece is connected.
- It's obvious when a piece is not connected.
- You don't get your hands dirty.
- You get a result quickly.
- There are many many less choices -- the material is pre-chosen.
- Blocks can't be broken down beyond their original size: You can't use half a block.
- Everything you build with lego looks like it was built with lego.
But then I started to think about the 'Tool Chain' involved in building lego... and this seems to be the real differentiator of lego:
- You don't need any tools to build with lego -- just the lego itself, and your hands.
- Anything built with lego can be torn apart with just your hands.
- Anything built with lego can be added to, altered, investigated, without using any special tools at all.
And I think that's the real essence of lego -- no tools, no workbench, no spanners, no visual studio .net license required.
The Real Question about Lego...
The real question about lego is one I can't answer. Here's three different ways to phrase it:
- Is it possible to efficiently build something truly useful out of lego?
- Is lego confined to toys?
- Is lego merely an educational tool?
And some references.
Here's some of the things that made me think about lego programming in the last six months:
- Users are not programmers
- The Executable Web
- Yahoo Pipes
- dabble db
- Zoho Creator
And most important of all, here's that Lego Machine Gun.
'Haacked' on Wed, 09 May 2007 06:03:11 GMT, sez:
And even if you can build something somewhat useful from legos, do you really want to deploy it?
Suppose I, the untrained bridge builder, build a bridge out of legos because it is so easy.
Are you going to trust it enough to cross a river on it?
And finally, do I have a point with this line of questioning?
'Witwe Bolte' on Wed, 09 May 2007 06:47:37 GMT, sez:
I think the comparison is especially good for programming (construction) abilities. Good lego builders have a thought-out plan in their heads that requires lots of 3-D thinking. They do not build brick by brick "well.. lets see where we can use this..". Instead they start off by collecting the bricks they know they'll need and so on.
It's the simplicity that makes it so powerful.
No, just kidding.
'Goran' on Wed, 09 May 2007 08:03:09 GMT, sez:
I think Coghead is the latest lego set out there (think MS Access and Web 2.0).
What I do find lego languages useful for is teaching children how to think. I had the opportunity to spend some time as a substitute at an elementary school. I managed to sneek logo and mindrover (programming game) in the computer class - the kids quickly understood and loved it.
IMHO you can have simple legos, but will need many to assemble something complex - or you can have complex legos, but have limited ways of assembly. If the interface is general, then it's easy to fit bits together - if the interface is concrete then not everything can fit together.
'Eric D. Burdo' on Wed, 09 May 2007 10:15:03 GMT, sez:
WOOT! My two favorite topics. LEGO and Programming! :)
OK. Let's tackle a few questions:
>> Is it possible to efficiently build something truly useful out of lego?
LEGO bricks are not intended to be indestructible. They are intended to be reused over and over again (very resilient, I have LEGO pieces from the late 70's - still in good shape and useable).
I think the concept behind the "LEGO Programming" would work pretty well though. You outlined some good points with the "obvious connection mechanism". I think a good modular programming language would work similar.
However, in the LEGO world, there are alternate building methods that most non-builder never think og. SNOT (Studs Not On Top) - where you build something sideways, or upside-down. Why? To get the affect you want.
Same with programming. The truly talented can take the same methods you use, and build something WAY more intense than what another person can build. Why? Knowledge of the tool, and experience.
If you think LEGO is just confined to toys, check out the website link (click on my name). It's a LEGO Mindstorms related blog. Some of the creations people have done are simple amazing.
'Aaron' on Wed, 09 May 2007 11:55:45 GMT, sez:
I don't think you would want to build a home out of LEGO. But right now MACROs are the best fit for the common users LEGO programing.
'Michael' on Wed, 09 May 2007 11:58:39 GMT, sez:
lb -- This is a great analogy but I think there are some implied features of LEGOs that were missed.
1. There are clear standards on peg and hole sizes so that basically any two bricks could fit together. What we end up with in programming is not only bricks without pegs and only some bricks with holes but also, as you said. pegs and holes are different shapes and configurations. Holes = API, pegs are supplied by middleware.
2. Only LEGO makes LEGO. In this way they control the supply chain and brick options, they control the user experience, and they control the interoperability between bricks. Does this sound familiar? It should because a similar description fits Apple as well.
'Peter McArthur' on Wed, 09 May 2007 12:00:55 GMT, sez:
Just a thought:
Lego is statically typed.
Stickle bricks are dynamically typed.
'Peter McArthur' on Wed, 09 May 2007 12:02:58 GMT, sez:
If you don't know what stickle bricks are:
'Brian Sherwin' on Wed, 09 May 2007 12:07:22 GMT, sez:
Yes, you can build almost anything with LEGO.
But then the questions:
Does the user see the same thing I see (hard to make circle patterns without custom pieces or a really big model--i.e. the Death Star LEGO set would be really difficult to do in a set of 200 legos.)
Just because I can put them together in a different way doesn't mean I can put them together in a meaningful way. I could buy the Death Star LEGO set, but if I tried to make it look like a 1920 Locomotive Set, I wouldn't be able to--I'm not that good at artistically putting something together except by the directions.
Usually, the guy building the LEGO directions can ask for Custom Pieces to be built. Sure, they can be used in other sets, but it's those custom pieces that make the set look "finished". Look how many pieces are specific to Jack Stone, Knight's Kingdom, ExoForce, etc. They "can" be mixed and matched, but they don't look like they should.
I'm not saying component/LEGO based programming is bad. I just think we need to balance it with what the "user" is able to do.
You're right. Users are not programmers. But not everyone that builds with LEGOs can build something useful/practical/complete either.
In my short career, Access 2.0 was the most painful LEGO package for "non-developers". Oh, the pain of fixing what some "business user" put together over the weekend just because he could.
Just because you can, doesn't mean you should.
'Brian Sherwin' on Wed, 09 May 2007 12:11:21 GMT, sez:
In reply to Michael:
LEGO makes LEGO, but MegaBlox (among other cheap knockoffs) follow the interface and are compatible.
'Ryan' on Wed, 09 May 2007 12:53:43 GMT, sez:
Yes, it is called JavaBeans. Further development and simplification of the J2EE framework and libraries will give you what you are looking for.
'mike' on Wed, 09 May 2007 14:41:57 GMT, sez:
Building most things out of Legos is a compromise that most users tend not to see ... you can build the Statue of Liberty out of Legos, and it can look recognizably like the SoL, but it will be all, you know, jaggy. We admire the effort and skill and overlook the fact that the real SoL is not jaggy. To build a real SoL, you can't use Legos.
The Lego solution is to introduce ever more specialized parts -- way, way beyond the simple brick that defines the brand. How many distinct types of snappable "bricks" does Lego now make? Surely it's in the hundreds. All that techno stuff, all the little-kid stuff, etc., etc. ... and all because the original model wasn't suitable for all users and all purposes.
'JonR' on Wed, 09 May 2007 15:59:34 GMT, sez:
the most Lego like programming experience I've had was with Windows Mobile 5 and the .NET CF. the pieces really do just seem to snap together, but they feel kind of plasticy and the end result is a model of a spaceship and not an actual spaceship. if you get me.
incidentally, i've wondered about this before, on 12/07/2006 to be precise. desperate attempt to get traffic: http://workblog.jonrowett.com/index.php/2006/12/07/joel-on-lego-programming/
'hobit' on Wed, 09 May 2007 19:55:46 GMT, sez:
I think it's the level of abstraction that matters when thinking about building blocks. It's easy to see MSIL instructions as individual LEGO blocks. However, it get's tricky when you reach the level of objects and/or functions.
'Dan F' on Wed, 09 May 2007 20:54:42 GMT, sez:
LEGO programming, nah, I think that's a perfectly silly idea.
But a LEGO like workflow-ish definer (I'm thinking WCF et al) is not a bad mindset to be in. Make it obvious, make it standard, make it snap together. Make the inputs (the holes) and the outputs (the pegs) obvious, make it purdy and colourful, and you've got something that non coder types can use to "reconfigure" the system. Like Witwe and others have said, you still have to have some kind of clue to put it together in a meaningful manner. And hopefully not end up with the DeathStar :)
'Jonas B.' on Thu, 10 May 2007 12:48:28 GMT, sez:
Ever heard about Labview? They have blocks and you "connect" them in your application. Thei even have a "While" and "Do" block.
'Dave' on Thu, 10 May 2007 22:55:34 GMT, sez:
I work at as a teaching assistant for a course at ________ university and we teach entry level engineering. Interstingly the concept of programming Lego elements originated at MIT. Lego elements are a very reusable and versatile tool to teach robotics and programming with.
To my knowledge it can be programmed in not quite c, assembly, c, java, labVIEW and the mindstorms software from lego.
As far as the more advanced models I have built or seen, they have included a bluetooth enabled airsoft turret, killough platform, functioning scale v6 engine, CNC and my favorite underwater robotics. Some really interesting highlights would be one kid who built a controller for a plane out of lego.
This is also a interesting read where rhode island university beat mit using a rcx based controller.
'Kyralessa' on Fri, 11 May 2007 00:59:45 GMT, sez:
I think "building with LEGO" is what Windows Workflow Foundation is supposed to be about. The programmers write components, but then turn them over to the users to string together in a nice flowchart of activities.
Will it work? I dunno, ask me in ten years.
'Brad Bellomo' on Fri, 11 May 2007 18:31:25 GMT, sez:
This debate is the same as the debate of computers programming themselves, the debate about average people writing code in English, the debate about industrial software factories with thousands of programmers with little knowledge working together to develop software more than 1000 times faster than a traditional developer.
The problem is not the language (or building blocks) of programming is difficult. The problem is end users don't really know what they want. Users may want a report about certain data, but don't think about who would enter the data or what interface is used to enter the data. Managers (even good ones) think they have good understanding of how everything works, but the don't understand details, they overgeneralize, rely on employees using common sense, and have rules full of contradictions and missing plans for unlikely situations that they only think about at the time the situation happens. They can picture a computer doing it all for them, and think if they understood C#/Ruby/Cobol or whatever, they could make it do it just by typing long enough.
We will never see easy programming for the masses or untrained. Programming requires knowing what you want, and the only way to develop this way of thinking is by programming with today's tools and methods. Once you've been a programmer for years that understands several languages and business domains, it becomes theoretically possible to actually work with some of these crazy lego-like technologies - but at that point, why would you want to?
'Carl' on Tue, 15 May 2007 10:58:43 GMT, sez:
So, no-one will steal your idea hey?!?
Apparently, building games IS like lego... it's only a matter of time before this filters down into the whole software industry ;o)
'Mark Hughes' on Fri, 18 May 2007 18:20:15 GMT, sez:
There's already a great LEGO brick-like environment.
The Unix shell.
Every tool plugs into every other tool by passing plain text through a filter of stdin to stdout and stderr, with arguments as parameters. Shell script and pipes are the glue between them.
You can build almost anything in it.
Admittedly, to use it you have to be more literate and smarter than the average .NET "programmer", but that's still >50% of the planetary population.
'Manuel Zambrano' on Mon, 22 Oct 2007 22:09:29 GMT, sez:
i love lego i have just a Lego Titanic.
'alradyhave' on Wed, 10 Apr 2013 02:21:35 GMT, sez:
Here is a tool that works just like Lego.
'alreadyhave' on Wed, 10 Apr 2013 02:22:17 GMT, sez:
the web site is http://www.otakhi.com