Comment

Comment by properparity

My findings as a spartan C programmer:

I've been using a simple unity-build ad-hoc build.bat/build.sh "system" for years now, works wonders.

YAGNI will serve you well, 99.99999(repeating)% of everyone's code will only be built and run on 1, maybe 2 platforms, why bother with these insane monstrosities that we call 'build systems"?

The few times I've needed to build for a new platform I just wrote that build script then and there, took a few minutes and that was it.

Modern machines can churn through a tens if not hundreds of K lines of C code in less than a second, so incremental builds aren't needed either (and if anything, with too many translation units you end up with linking being a bottleneck).

Single TU benefits:

- Global optimizations "for free".

- Make all functions static (except main) and you get --gc-sections "for free".

- Linking is blazingly fast.

- Don't have to bother with header files.

- No one has to download anything to built my code, I make it work on a default msvc/gcc/clang install (i.e if you have gcc, cl or clang in your path when running build.bat/build.sh, it will build).

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton