I guess this is kind of a follow up to my Retro Challenge posts, as it was thoughts that stemmed from teaching myself Assembly Language for my Z80 project. Essentially it is a comparison between programming in the 70’s and today against building with Lego in the 70s and today.
But before I get stuck in, can you identify this famous TV family from a few crude Lego bricks?
Yes, it is, of course The Simpsons. And whilst I take issue at the range of colours used (two shades of blue? And green? We never had green Lego bricks when I was growing up. Now get off my lawn!), this simple representation and a little bit of imagination represents the cartoon family pretty well. Although in the early days there was more of a range of brick shapes and sizes, and even generic people, this could have been built back in the day – before The Simpsons was born.
Anyway, jump forward to 2014, and what does The Simpsons look like when modelled in the medium of Lego?
Yup, they’re all there in their yellowie goodness, complete with bulging eyes, shorts, skirt, tie, bouffont hair and dummy. Pretty hard to imagine they could be anyone else!
So, I see this as basically the difference between programming in assembly language and modern languages like .net or Java. I should, however, point out at this stage that I am not a programmer, and cannot program in .net or Java myself, although I do dabble a bit with the Arduino flavour of C++
The Z80 has very few instructions which can be summed up in couple of dozen 2 or 3 letter mnemonics, such as LD, RLR, JP or INC. My LED Matrix program only used 12 different mnemonics. So, consider this as your original Lego blocks. 2×4, 2×2, 6×1 or 4x8flat. With a very limited set of instructions or bricks, it was possible to make amazingly complex creations. However, if you used those brickstructions creatively, and used enough of them, it was possible to come up with amazing creations. Sure, the resolution was low, so you had to build your dragon really huge so you could see any detail, and maybe you had to rely a bit on the users imagination, but amazing things could be built. Such things as a single command to multiply by 5 wasn’t possible, and neither was curved bricks to build round structures.
During the 80ss and 90’s, computers got slicker and faster, and when I wrote my first program in 1982 I used BASIC, which compared to Assembly Language was pretty, well, basic! Likewise the Lego sets got better too, so my spaceships had radar dishes and control panels, and I wasn’t limited to just red, white, blue and yellow bricks (which, in hindsight, was awful spaceship colours!)
These days, if I want to build a Lego castle, I simply buy the Harry Potter set and build myself Hogwarts. If I want to get my Arduino to talk to a LED matrix, I call the LED matrix library and tell it want I want to say. I can build a spaceship that looks just like Millennium Falcon or I can call a Java script that fetches SQL data and draws it as a pretty pie chart in whatever colour theme I choose.
Now, I’m not saying that progress is a bad thing. I know that if I was still 12 years old and was offered an official Star Wars branded Lego X-Wing fighter to play with versus the Lego spaceships I built in 1983, I’m totally sure I would go with the one that actually included R2D2. Likewise, I am currently working on an Arduino and LCD project at work, so do you think I am crafting the code for this from one layer above 1’s and 0’s? Hell no, I’m calling a library, telling it the screen size and what text I want placed where. Job done.
80s command line display vs modern gui display
I do think it is important though to appreciate where things started though, and appreciate how far we have come. And, although the libraries are there for the complex and tedious jobs, and the kits are there to let you build the set from The Lego Movie, it is still possible to take things down to a much more fundamental level. With a bit of practice, hard work, some creativity and squinting a bit, you can still build whatever your imagination can dream up!