Code Layout

Code Layout #

This is a series of articles about UCCL - Uniform C Code Layout - a code layout method for C/C++ projects.

Normally, when you speak to developers about code layout standards, you get an eye-roll or an answer along the lines of “it doesn’t matter as long as you are consistent”. It’s almost like saying that controls layout in a car is not important. It is however very important and if you don’t believe me, just go to Australia or UK (or go outside of those, if you live there), and see how many times you turn on the windshield wipers when you want the turn signals.
Photo: NPH/Dieter Mahis/Picture-Alliance/DPA/AP Images

No, you don't want this layout!

Photo: NPH/Dieter Mahis/Picture-Alliance/DPA/AP Images

In the same vein, yes, you will find where different files are even in an unfamiliar code layout but it’s going to create frustration and take time that could be better used elsewhere. Moreover, if you need to integrate a number of projects, each with its own idiosyncrasies, the complexity can quickly get out of hand.

These articles were written at different points in time and show how these ideas evolved.

I have used symbolic links for bringing together different projects for quite some time. The way to do it is described in Eat Your Own Dogfood. As the number of projects grew, maintaining and updating them became more and more challenging. That’s how the need for a package manager appeared.

Not long after, I discovered the Pitchfork Layout and thought it is a good match with my ideas. Their combination is described in The Dogfood and the Pitchfork.