#techpost #CI really like C and have really leveled up in it.
One of the downsides of C is no namespacing.
But one of my lessons from learning lots of programming languages is
that you can take a good thing from one language and apply it
to another even if it doesn't support it. Typically by adopting
some convention. For example C figuratively does have namespaces
if you are diligent about naming files and functions.
Anyways one of my patterns that I like is that I use a make target like
this:
\
#makefile target to copy in lib files
libs:
cp ../libs/log/log.[ch] .
I have a repo of basic C stuff like file handling and binary math
stuff called "libs". I also have one called "learn". The distinction
is that "libs" is stuff I might re-use, where "learn" is stuff
(like pointer math) that is more of a reference.
So I like this pattern of copying in files from another repo.
And then I just add them to whatever repo locally. It's cool because
it lends itself to developing those libs further in either place.
Like I can re-run that make target to get new changes to
those files, and because they are in git locally, I can see what's
changed. And I can copy the files back to "libs" if the changes
are local. This is a compromise, but very good, especially
since I am learning, so I enjoy the development churn.
Like if I update some code in "libs" it might break something
where I am "importing" it, but then I just fix that up and
commit it all. It's like I don't have to remember, to do
something, because the code breaking will notify me :)