From: Horst von Brand <vonbrand@inf.utfsm.cl>
To: Coywolf Qi Hunt <coywolf@gmail.com>
Cc: Bill Davidsen <davidsen@tmr.com>,
"linux-os (Dick Johnson)" <linux-os@analogic.com>,
Paul Jackson <pj@sgi.com>,
francis_moreau2000@yahoo.fr, linux-kernel@vger.kernel.org
Subject: Re: Use enum to declare errno values
Date: Fri, 02 Dec 2005 15:30:55 -0300 [thread overview]
Message-ID: <200512021830.jB2IUtcK015628@pincoya.inf.utfsm.cl> (raw)
In-Reply-To: Message from Coywolf Qi Hunt <coywolf@gmail.com> of "Sat, 03 Dec 2005 01:07:04 +0800." <2cd57c900512020907h4be23519q@mail.gmail.com>
Coywolf Qi Hunt <coywolf@gmail.com> wrote:
> 2005/12/3, Bill Davidsen <davidsen@tmr.com>:
> > Coywolf Qi Hunt wrote:
> > > This is a reason why enums are worse than #defines.
> > >
> > > Unlike in other languages, C enum is not much useful in practices.
> > Actually they are highly useful if you know how to use them. They allow
> > type checking, have auto increment, and are part of the language instead
> > of a feature of the preprocessor.
The preprocessor /is/ part lof the language...
> Yes, I know type checking and auto increment. But they are not
> worthwhile, at least not for serious C programming.
They do have their uses. No, C (particularly as used today) is not a
"designed" language, it has several ways of doing the same thing, some
quirks, and outright design mistakes.
> No, I don't know
> how to use them comfortably.
Then you aren't fit to judge, are you?
> What's wrong with sorted macros? They are more flexible
"More flexible" == "more leeway to screw up"...
> and readable.
"Readable" is in the eye of the beholder...
> enums just look weird.
Ditto.
> We also share macros b/w C and asm.
So what?
[...]
> Follow you logic, C standard should only specify C language, not
> anything of libc... I have no interest in arguing the relations b/w C
> and cpp.
libc is part of the language, as is cpp.
[...]
> > It would have been good to use enums in the first place, I can't see
> > changing now because of the effort involved.
> You contradict yourself rather.
No. The difference between them is not /that/ large, and by now the use of
#define is so much part of the "way things are done" that the pain of
changing it doesn't buy you enough.
What I see is that you don't know too much about large-scale software
development (and Linux is definitively in that league).
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
next prev parent reply other threads:[~2005-12-04 2:07 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-23 13:24 moreau francis
2005-11-23 14:19 ` linux-os (Dick Johnson)
2005-11-23 14:24 ` Denis Vlasenko
2005-11-23 15:00 ` linux-os (Dick Johnson)
2005-11-24 7:19 ` Denis Vlasenko
2005-11-24 7:30 ` Paul Jackson
2005-11-24 7:37 ` Paul Jackson
2005-12-01 20:01 ` linux-os (Dick Johnson)
2005-12-02 6:49 ` Denis Vlasenko
2005-12-02 9:27 ` Coywolf Qi Hunt
2005-12-02 12:07 ` Denis Vlasenko
2005-12-02 12:18 ` Pekka Enberg
2005-12-02 12:56 ` Coywolf Qi Hunt
2005-12-02 13:20 ` Denis Vlasenko
2005-12-02 13:34 ` Pekka Enberg
2005-12-02 16:02 ` Bill Davidsen
2005-12-02 16:32 ` Coywolf Qi Hunt
2005-12-02 16:56 ` Vadim Lobanov
2005-12-04 13:10 ` Denis Vlasenko
2005-12-02 16:15 ` Bill Davidsen
2005-12-02 17:07 ` Coywolf Qi Hunt
2005-12-02 17:51 ` Steven Rostedt
2005-12-02 18:15 ` Bill Davidsen
2005-12-02 18:30 ` Horst von Brand [this message]
2005-11-23 14:27 ` Denis Vlasenko
2005-11-23 14:31 ` Denis Vlasenko
2005-11-23 15:15 ` Alan Cox
2005-11-23 15:44 ` moreau francis
2005-11-23 15:55 ` Nikita Danilov
2005-11-23 16:05 ` moreau francis
2005-11-23 16:24 ` Nikita Danilov
2005-11-23 16:42 ` moreau francis
2005-11-23 16:54 ` Nikita Danilov
2005-11-24 7:22 ` Denis Vlasenko
2005-11-23 17:35 ` Bill Davidsen
2005-11-24 9:43 ` Giuliano Pochini
2005-11-28 23:19 ` Bill Davidsen
2005-11-24 17:11 ` Ben Pfaff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200512021830.jB2IUtcK015628@pincoya.inf.utfsm.cl \
--to=vonbrand@inf.utfsm.cl \
--cc=coywolf@gmail.com \
--cc=davidsen@tmr.com \
--cc=francis_moreau2000@yahoo.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-os@analogic.com \
--cc=pj@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®