[cmake-developers] Safe source list GLOBs
Wojciech Knapik
wmknapik at gmail.com
Tue May 28 18:37:54 EDT 2013
On Thu, May 23, 2013 at 06:57:34PM +0200, Alexander Neundorf wrote:
> > > Explicit lists violate DRY
> > > http://en.wikipedia.org/wiki/Don't_repeat_yourself
>
> No, this doesn't apply :-)
> By having some files lying around in a directory I did not state anything, so
> I do not repeat myself in the CMakeLists.txt ;-)
Files don't just happen to be lying around in directories. You have to
create them in a specific path, with a specific name. Even if the act of
creation was performed by another developer, on another machine, that
information is written to disk in the course of a VCS checkout.
So, yeah, you're repeating information that's already there.
> > > There are very few cases where introducing redundancy is justified. And
> > > even fewer where it's ok to shift the burden of maintaining sync to your
> > > user, via a manual process no less.
> > >
> > > Removing explicit lists in favour of GLOBs can reduce the size of your
> > > CMakeLists by an order of magnitude. That's something you want.
>
> I do not want it.
Well, to be fair, sometimes people don't know what they want ;]
Personally, I use every chance I can to remove code, that can be removed
with the program still doing what was intended. I'd go so far as to say,
that this is my favourite thing in programming.
But more importantly it makes the code simpler, easier to work with for
newcomers and easier to maintain in the long run.
WK
More information about the cmake-developers
mailing list