Book Report: The Clean series by Robert Martin

I recently finished reading a trio of books of software development best practices by “Uncle Bob” Martin. The books are:

  • Clean Code – this one is about the nuts and bolts of making your code readable and maintainable.
  • Clean Architecture – this is about system-level design; how to modularize systems properly to make them flexible and maintainable.
  • The Clean Coder – how to behave professionally as a programmer, assuming you want to. This was was the most interesting to me, because nobody ever tells you this stuff.

Because I also wanted to turn this into a presentation for my colleagues at work, I’ve taken extensive notes and shared them as a slide deck here.

If you’re interested in knowing what’s in the books but aren’t sure if you want to read them, I encourage you to have a look over my notes. They’re all in order by chapter and summarize what I consider the important points. If they catch your interest, you’ll be able to find the relevant section in the book easily from this.

I agree with much of what Martin says in these books, but by no means all. Architecture and professionalism are areas wherein I want to improve myself, and I intend to continue reading this type of book.

Linear Timelapse Robot v1

Just in case anyone is following me via RSS, I just posted a new static page about my latest electronics project, a prototype motion control robot for making timelapse movies.

HD44780 LCD Interface lib for Teensy++ 2.0

Just a quick post to announce that I’ve posted a new project page to the static part of my site: Teensy++ Interface Library for HD44780-Based LCDs

It’s about a recently completed electronics hobby project.

 

My Latest Profile Picture: What’s Inside

I’ve recently updated my social media profiles with a new profile picture / avatar, receiving positive response and some curiosity. This is the image, at a high resolution:

My Profile Picture

This is a picture of me wearing a picture of me. Read on to find out how this was done.

In 2010 the Electronic Arts Capture Lab had an open house, where employees from the rest of the studio could go by for demos of their equipment.  See the video in the above link for examples of what we saw.

One thing they demonstrated was the facial capture rig they used to create high-resolution 3D models of actors’ faces. You can see the rig and part of the process between 0:09 and 0:17 in the video at the above link.  It’s a rig containing a lot of digital cameras arranged spherically around the subject, and set up to fire in synchrony along with strategically placed flashes.  Specialized software then takes all those photographs and correlates the features visible in them to deduce a textured, 3D digital model of the subject. This is one example of the science of photogrammetry. There is a longer discussion of this process in this thread post.

My colleague David Dixon and I had the idea to use these digitized models of our heads to construct actual physical models of our heads, at a larger-than-life scale, and wear them as Halloween costumes.

David, being the 3D editing wizard among the two of us, simplified the models from thousands of polygons down to dozens.  Here are before (top) and after (bottom) screenshots of my model showing his work. Note the bottom one uses a corrected version of the skin texture (which I unfortunately lost the high-resolution version of) which explains the differences in skin tone and detail.

headscan_composite

You can see the original model had quite a bit of surface noise to be cleaned up, including what looks like fractures in my cheeks but are probably registration errors.

We then imported the simplified model into Tamasoft PepaKura, which segmented it into flattenable pieces and added glue tabs, resulting in many pages of fragments that looked like this:

SoleilPaperCraft_005 - Copy

We had these printed on stiff paper at Staples, then spent hours gluing them together.

Here’s what mine looked like from a few angles the morning I finished it (I worked overnight to finish it in time):

d20101029_0001_02_05_07_composite01

And here are David and I showing them off at the office later that day:

d20101101_0003_edit01

For the profile picture image, I set up a mini studio in my apartment and had my visiting parents help me fit my suit jacket over the shoulders of the model (since I can’t see anything when I’m wearing it) and operate the camera for me.  I then digitally emphasized the edges between the polygons and removed the background and replaced it, appropriately, with one of the iconic Max Headroom backgrounds.

So there you have it: A long, technical and involved but creative and fun project that lets me wear an oversized 3D photo of my head over top of my real head.

Only took me 20 years…

The latest addition to my mad science lab: A device programmer.

d20130413_0001

 

There’s a lot of history behind this purchase.

Back when I was taking Electronics Engineering Technology in Toronto, twenty years ago, we had to do a sort of “mini-thesis” project in our final year.  I really wanted to make an EPROM programmer for my project, because having one would enable me to incorporate stored-program components like microprocessors into my electronics hobby projects, and I couldn’t afford to buy one.

The instructor (hi, Darrell!) said this project wasn’t complex enough and would only be worth a ‘C’ grade at best, so I was forced to choose something else.  But I’ve been wanting a device programmer ever since.

Lately I’ve been having a hankering to dust off the hobby and do some projects, and being able to use programmable devices is necessary for many of the projects I have in mind.  I thought about making my own again, but I decided to check and see if prices on commercial models had got a little more reasonable.  While I place value on doing stuff myself, making my own is now less interesting than the things I can do once I have one, so I’m willing to sacrifice some nerd cred in order to get to the good stuff faster.

Prices haven’t improved (most professional models are still in the thousands of dollars) but there are some cheap alternatives available now.  I looked at what could be had from local dealers and from eBay, and I was tempted by these things called Willem programmers.  They typically plug into a PC’s serial or parallel port, though some models now support USB, and they’re super cheap.

Unfortunately upon doing some research, I found that buying a Willem looked risky.  Willems started out as a hobbyist design, which got picked up and mutated by others.  There are now dozens of different models, many of which do not come with documentation or with functioning software – the Willem name has become so fragmented that there is even a visual identification guide to try to help people figure out which one they’ve got, so they can try to make it go. There are also some unscrupulous dealers doing things like naming their products “True Willem Programmer” to make it sound more credible than it is (“True” is part of the name, not a description).

So I could go cheap and buy a Willem and risk having to spend a lot of time hunting down software, or maybe even reverse-engineering the thing to write my own, or I could drop a little more on a prosumer model.  I settled on the Wellon VP-290 pictured above after reading some favorable reviews on hobbyist websites, and a brand new one set me back less than $200.  It has an impressive list of supported devices, which more than covers my needs.

I haven’t actually burned any devices with it yet – I haven’t decided on my next project, let alone written the firmware.  But I did test the programmer by reading out the contents of some old EPROMs I had sitting around, and while the software workflow isn’t slick, it’s good enough.  I think this will prove to be a fruitful purchase.

So: I’m letting out a long sigh after twenty years of holding out.  I had a lot of emotional investment in making my own device programmer – that initial rejection of the project idea got my hackles up and I never forgot it.  But time heals all markets, and I’ve finally put it to rest and enabled myself to move on to bigger and better projects.

Next Page »