[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [The good, the bad and] The Ugly -- the cosmetic rant



> What happens if the configure command fails?  config.status will be
> there, all right, but the configure target will not have completed
> successfully.  So if you use config.status as a stamp file, you'll be
> stuffed.
> 

No. If configure fails, config.status won't be created. Only
config.log gets created in that case.

,----[ configure.ac ]
| AC_INIT(configure.ac)
| AC_ERROR(foo)
| AC_OUTPUT()
`----

Try this one, this will fail, and config.status will not be created.

If you mean a silent fail, which did not find a library, but
continued, that will happen with the configure-stamp approach too.

> >             Second, the comment above the ./configure line - as added
> > by dh_make, I presume - does not bear any value once the template is
> > filled out, since you don't have to add anything anymore. Compare this
> > with TeX markup in a printed book, it's almost the same thing.
> 
> Comments are good.  Compare this to commenting your source code; after
> all, once you've written it, you don't need to know what it does any
> more, right?  So this comment is a bit redundant -- big deal: it could
> help someone one day.

Compare this:

/* FIXME: Write here code that does this stuff. */
void foo() {}

With this:

/* This code makes foo look like bar. */
void foo() 
{
	/* FOO is a global variable, used to baz things around,
	 * BAR does something else */
	FOO=BAR;
}

There's a distinction between comments that were put in to describe
what a given code does, or should do, and comments that are only
relevant until the necessary code is added.

Do you leave FIXMEs around, after you fixed the bug?

> > Another bad example is this:
> > 
> > ,----
> > | # Build architecture-independent files here.
> > | binary-indep: build install
> > | # We have nothing to do by default.
> > `----
> 
> Good example.  I recently changed a package from arch: all to arch:
> any and back again, and was very appreciative to have these comments
> lying around.  And as a policy maintainer, I do know this stuff well;
> nevertheless, having reminders is very good (and even then, I forgot
> things).
 
In that case, a tiny rewording would help, at least for the second
comment, see my reasoning the original mail. For the first, I think
the name of the target already explains what it does..

Attachment: pgp_JarUC1smc.pgp
Description: PGP signature


Reply to: