bug-coreutils
[Top][All Lists]
Advanced

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

"true.c" is bloated, I suggest "int main() { return 0; }


From: Helge Hafting
Subject: "true.c" is bloated, I suggest "int main() { return 0; }
Date: Fri, 04 Aug 2006 11:14:11 +0200
User-agent: Thunderbird 1.5.0.4 (X11/20060713)

I noticed that the "true" and "false" programs are somewhat
bloated, on i386 they need 3 4k-pages of code when the trivial
implementation in the subject line only need one.

Yes, I know this is a small issue, but still:  No need for
software of excessive size.


I examined the source, and found that the bloat was due to
the parameters --help and --version, which cause true and false
to print some strings in a variety of languages.

Now, having --version is nice for commands that have a history
of changing important functionality.  In these cases, the version
is important.  The version of "true" and "false" doesn't matter
much though, so supporting "--version" is excessive and is better avoided.

Similiar for --help.  It is useful with commands that are so complicated
that their syntax is hard to remember.  This is not the case for "true"
and "false", so "--help" is excessive and better avoided.
Removing these options removes over 90% of compiled code size,
while retaining the main functionality. Try that with any
other software. ;-)  More interesting, it saves 2 pages of memory.
The programs are left with no strings at all, which also removes
the need for internationalization stuff.

Anyone who really need help on the use of "true" and "false"
can still read the documentation provided by "info true".

I can only guess that someone is trying to standardize the
use of --help and --version.  But standardization can be
overdone and doing things to the extreme
don't really make sense.

Helge Hafting




reply via email to

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