help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Byte-compiler warnings


From: Emanuel Berg
Subject: Re: Byte-compiler warnings
Date: Thu, 25 Jun 2015 05:42:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> The tendency over the year has been first to move it
> all into the compiler (since the kind of analysis
> needed to give those warnings is often useful for
> a compiler to generate better code as well), and
> then to add specialized tools again (that focus on
> particular coding errors). IIUC the reason to
> develop the newer tools separately from the
> compilers is because they tend to use different
> analyses (e.g. more superficial (paying attention to
> identifier names), or much more costly, or that
> require extra information/setup from the coders,
> ...).

If it were up to me, superficial or super-costly, it
would still be placed along with the compiler and
invoked with options rather than having that as
separate tools.

> In any case, within the Elisp realm, we're still at
> the stage where the compiler is the most common
> place to add warnings. There are a few other tools
> (elint and checkdoc), of course.

The compiler warnings are great and perhaps more can
be added still? For example, remember the discussion
`if' and (if (not ...)) vs `when' and `unless'? No?
Anyway at that time I thought `if' was better because
then you can add an else clause later (if necessary)
without having to change the function, and you can
start writing the block without thinking how it will
end. I understand that thinking but for whatever
reason somewhere along the way I just started using
when/unless instead and now I think those are much
better whenever there isn't an else path (with
when/unless, `if' also signals there is one).
Perhaps the compiler can warn about that as well? But,
if it gets that aggressive and subjective in, eh,
"style", then people will get crazy if they can't shut
it up if their style conflicts. So I think warnings
should be added in the thousands, and then mutable one
by one...

I'll try elint tomorrow. checkdoc is good, no doubt,
as is the help. Not all functions in official Emacs
(in Gnus, for example) do as checkdoc says and mention
the args in the correct order and all that. It makes
sense and is easy, so why not just do it?

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]