Re: 3 Questions

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 01/29/01


On Sun, 28 Jan 2001, Peter Ajamian wrote:

> NOT a good idea.  This can (and most likely will) result in purgeplay
> being run while the MUD is running which is explicitly warned against
> by the automaint script itself.

You can easily prevent this and I assumed he was already aware of the
existing stipulations for automaint's use.  It does bear mentioning and
repeating, though.

> Why bother when all you have to do is declare your variables at the
> beginning of the function?

Not to debate the usefulness of certain features of the C standard (but
the irony noted when contrasting these stances with the EXIT_FAILURE
debate), but there are clear benefits to this.  The first is that it
simply makes more sense to have declaration near use and increases the
structured nature of the program.  There are also efficiency benefits, but
that's not a good reason in-and-of itself in the case of muds.

> It keeps things way more portable that way.

In theory.  For now.  It is a part of the new C standard and, thus, will
eventually come into wide-spread support.  Legacy platforms that don't
keep up have a funny way of falling out of common use when programs start
appearing that benefit from adhering to new standards.  That said, I
wouldn't push adherence to C99 to anyone, yet.  I'm not aware of any
compiler with completed support and it will take time for C99 code to be
portable.

> *Wonders why people have to insist on breaking thier programs

Well... they are their programs.  As any good (professional) programmer
knows, code is written for people, not computers.  (Any programmer with
great job security knows this and abuses it.)  Now if you're intending to
write code that is going to be supported by legacy platforms, then avoid
things that are a part of the C99 standard but not ANSI C.  But if you're
writing for portability to newer platforms and prefer the style and
benefits of C99 additions... it's your program's portability to break.

> etc, etc, and yes, it is stupid, because it's so easily avoidable.*

Avoidability does not a stupid thing make.  It is possible to avoid
breathing and yet, strangely, breathing is not a stupid activity because
of it.  Or, more inline with your thinking, it is possible to avoid
EXIT_FAILURE, which doesn't make EXIT_FAILURE stupid.  (Other things make
it that. :)


-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/03/01 PST