[504] in Coldmud discussion meeting

root meeting help first previous next next in chain last in chain last

Driver cleanup

daemon@ATHENA.MIT.EDU (Tue Nov 1 18:32:04 1994 )

From: brandon@riverheights.declab.usu.edu
To: coldstuff@MIT.EDU
Date: Tue, 01 Nov 94 16:29:49 -0700

Ok, this is primarily directed towards riche now that he is in the hotseat,
but I'm swinging it by everybody for the heck of it.  Most of this you have
probably seen by me already.

This is a list of 'cleanup' changes to the driver.  The primary purpose
of most of these changes is to clarify their usage, or, to just fix them :)

Proposed Changes:

------------------------------------------
set_name()                  => set_dbref()
del_name()                  => del_dbref()
get_name()                  => get_dbref()

This has a few fold reasons.  A: because is makes it easier to figure out
what a 'name' is.  B: use dbref versus objname because the documentation
already calls the suckers dbrefs.  C: use dbref versus objname because
when using both objname and objnum there was a bit of confusion (I did it
for a while).

------------------------------------------
run_script()                => execute()

This is more of a principle thing.  Since it uses exec() to run the 'scripts',
it doesn't mean they ARE scripts, they can be anything.  It would also be
nice to add an interface where you would do:

execute($object, "execstring", [args as before])

and it would call $object.stdin and $object.stderr with the stdin and stderr
of "execstring" (for simplicity just have it return the output after
execstring exits).

------------------------------------------
connect()                   => open_connection()
disconnect()                => close_connection()
bind()                      => bind_port()
unbind()                    => unbind_port()
assign_conn()               => reassign_connection()

Along with the above changes would be method changes of:

conn_object.connect()  => .connection_started('inbound, "ip", port, socket)
                       => .connection_started('outbound, "ip", port, socket)

Currently connect is not only misleading, as it is the same name as the
system function connect() (which does a totally different thing), but it
calls the method differently depending upon where the connection originated
(inbound or outbound).  Just send the same args, specifying which type of
connection it is with the 'symbol.

conn_object.failed()   => .connection_failed("addr", port, socket)

------------------------------------------
Everything above I feel strongly about (SOMETHING should be done, at the
least with the connection stuff--I'm saying this from experience in writing
a completely configurable $network/$daemon/$inbound[outbound]_connection/
$connection_interface heirarchy: networking needs help).  The rest is
more trivial.
------------------------------------------
set_heartbeat_freq()        => set_heartbeat()
db_top                      => max_objnum()

The above two are just gratuitous, but which I think just "feel" nicer (shrug).

------------------------------------------
Make assignments with ':=' rather than '='.  This is _NOT_ to make it closer
to Pascal, but rather to simplify the language.  Using a semi colon->equals
sign combination not only virtually eliminates the ever constant problem
of people using assignments when they meant to use a comparison (I dont give
a rats ass about good programers, good programers are not the only ones who
use a system--and I am always dealing with the 'other' users of a system--I
know how they think (sorta)), but it also makes sense.  In the english
language an 'assignment' of sorts is made using the semi colon.  Example: <an 
example would follow here>.
------------------------------------------
As long as the idea is to keep code linear rather than horizontal, I would
like to see '-=' and '+=' added.  They add a touch of simplicity and as
long as a statement cannot be an expression they do not add much more
complexity.

-Brandon