Re: Circlemud design issues

From: Luis Pedro Passos Carvalho (lpcarvalho@SONAE.PT)
Date: 04/21/98


This thread has been going on like this:

James Turner: Macros Bad! Inline Functions Good!

George: Macros Good! Inline Functions Ok!

James Turner: Macros Bad! Inline Functions Good!

George: Macros Good! Inline Functions Ok!

yada! yada! yada!

Sorry about the bluntness but let's think clearly now!

Macros:
+ increase the readability of the code (in 90% of the cases they do James)
+ are portable
+ hide simple parts of code thoroughly repeated
+ enable you to use them on the left side of an attribution
- do not make type checking
- can cause problems when receiving active parameters or functions

Inline functions:
+ increase the readability of the code
+ hide simple parts of code thoroughly repeated but can be used with larger
ones as well
+ make type checking
+ can safely receive active parameters
- may not be portable
- Imply a cost with changing to them

I've been coding with Circle for 3 years now, and my opinion is that the
macros are
being well used. They make reading the code easier and allow you very simple
manipulation
of the rather complex data structures of the MUD.

Granted, they have limitations but they are not supposed to be used for
everything (which they're not,
mind you). If you encounter a situation where a macro is unsuitable, by all
means, use a function. But
remember that they too have limitations. For example, I love the CREATE
macro. And you can't implement
it in any function with the simplicity it has been made with.

Now, please. Let that discussion drop. It's becoming a religious thing.
*shiver*

As for the threading discussion, i think it would be introducing complexity
that would not be rewarded.
In theory it's great and makes sense, but, is it really worth it?

And last, the header files: this is just coding style. There are no two
pleople with the same opinion.
I think some declarations are misplaced in the stock header files but I
won't even argue what they are
(it would take us to even more, smaller include files) because that's the
way i'm used to program,
others may have other mental associations that need diferent organization.

I'm against patching to your heart's content, but i beleive that we should
make Circle a little bit more
modular. For example, by hiding the data structures a bit more. Has an
example, we shouldn't know that
The world is in an array, that there are prototypes or even how the
caracters in a room are maintained.

That would be cleaning up code and making the stock code much more solid
than it is now. Not deciding wether GET_BLAH should be a function or a
macro. In most cases it would be just cosmetic.

Well just my thougts.

Have fun and code a lot,

Luis Carvalho


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST