Clay Dowling's Occasional Musings

I write code, build things, and occasionally lead teams. I also share my thoughts or things I've learned about them, so that others can learn from my mistakes.

Easy Makefiles

If you read my earlier article OMG WTF Makefiles, there was a lot of information to take in. And Makefiles built that way can get pretty overwhelming to keep up pretty quickly. In fact, unless I'm forced to use BSD Make, I use GNU Make and take advantage of some nice shortcuts. I'll show you how to keep your Makefile building simple.

→ Read more...

2017/11/12 22:05 · clay

OMG WTF Makefiles!

If, like many developers, you haven't written a line of C or C++ since you left school, but suddenly find yourself needing to write in those languages, this article is for you. Or maybe you're in school, but you need to write a moderately complex program (more than one file). This article is also for you.

→ Read more...

2017/11/05 11:38 · clay

Embedded Testing Suites

At Prairie.Code() I provided an example embedded project to demonstrate test driven development as part of an Arduino workshop. The example I gave used the Unity testing framework, but there are several others and they're worth exploring.

→ Read more...

2017/09/27 23:35 · clay

A Functional Conway's Game of Life

Conway's Game of Life is an old standby for code retreats and coding katas. The game's simplicity means that implementation complexity won't get in the way of what you are trying to learn.

A few months back in a code retreat a fellow attendee implemented the game in a functional language. My first thought was “why would anybody do that?” My second was “how could I do this in C?” C isn't normally thought of as a functional language, but there's nothing stopping it from being used that way. Functions have always been first class objects, and applying a function to a collection of objects is trivial.

I put the thought away for a while, but recently I decided that building this as an LED array driven by a microprocessor would be fun. So I pulled the project out of the vault and started working on it during my lunch hour with my colleagues.

You can see the results at https://github.com/ClayDowling/functional-life

→ Read more...

2017/05/05 22:29 · clay

Branching By Abstraction

Recently at a client we had a discussion as a team about our continuous integration practices. One of the goals of continuous integration is frequently pushing changes to the master branch, so that it can be integrated into the build.

But how do you do that if you need to make breaking changes? You can push to master, break everybody's build, and earn the undying enmity of your entire team if you do this regularly. Or you can try a couple of different approaches, such as Branching by Abstraction.

→ Read more...

2017/04/15 16:52 · clay