At the second annual PillarCon, I facilitated a workshop called “Fundamentals of C and Embedded using Mob Programming”. On a Mac, we test-drove toggling a Raspberry Pi’s onboard LED.

Before and after

Before: ACT LED off
Before: ACT LED off
After: ACT LED on
After: ACT LED on

Retrospective

Noteboard: takeaways from Fundamentals of C and Embedded
Noteboard: takeaways from Fundamentals of C and Embedded

Here are the takeaways we wrote down:

  • Could test return type of main()
  • Why wasn’t num_calls 0 to begin with?
  • Maybe provide the mocks in advance (maybe use CMock)
  • Fun idea: fake GPIO device
  • Vim tricks! Cool
  • But maybe use an easier editor for target audience
  • Appropriate amount of effort; need bigger payoff
  • Mob programming supported the learning process/objective

My own thoughts for next time I do this material:

  • Keep: providing multi-target Makefile and prebuilt cross compiler
  • Try: providing the mocks in the starting state
  • Keep: being prepared with a test list
  • Try: using a more discoverable (e.g., non-modal) text editor
  • Keep: being prepared with corners to cut if time gets short
  • Try: providing already-written test cases to uncomment one at a time (one of the aspects of James Grenning’s training course I especially loved)
  • Keep: mobbing
  • Try: knowing more of the mistakes we might make when cutting corners
  • Keep: delivering a visible result
  • Try: turning off the PWR light (if possible) so we can more easily see when the ACT light turns on and off

Participants who already knew some of this stuff liked the mob programming (new to some of them) and appreciated how I structured the material to unfold. Participants who were new to C and/or embedded (my target audience) came away feeling that they needn’t be intimidated by it, and that programming in this context can be as fun and feedbacky as they’re accustomed to.

Play along at home

  1. Install NetBSD 7 on Raspberry Pi
  2. Fetch the NetBSD source tree (or let the Makefile do it for you)
  3. Build the cross compiler and a complete NetBSD for the target system (or let the Makefile do it for you)

Then follow the steps outlined in the README.

Further learning

You’re welcome to use the workshop materials for any purpose, including your own workshop. If you do, I’d love to hear about it. Or if you’d like me to come facilitate it for your company, meetup group, etc., let’s talk.