Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Are bases procedural or OO written

Are bases procedural or OO written

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Npp83   (16 posts)  Bio
Date Thu 20 May 2010 07:25 AM (UTC)
Message
Ive been peering over the code in my SWFotE base, and really after having looked at it now with some programming knowledge, I see the code differently than I did before. So, in looking at it is a Diku derivative like SMAUG or what-have-you written procedurally or in an OO format. I really dont see any OO going on. Correct me if I am wrong.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 20 May 2010 07:31 AM (UTC)
Message
Smaug isn't particularly OO (it is pretty old). The MOO codebase is, hence its name.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Npp83   (16 posts)  Bio
Date Reply #2 on Thu 20 May 2010 07:45 AM (UTC)
Message
Thats interesting. Thanks. Given the procedural nature of the code then, is there any method for gaining a better understanding of how the source is organized and related? The lot of the files all require mud.h but, for instance, what does mud.h contain that those files require. What I am looking for is a little organizational insight. Any thoughts or resources on how to start? Thanks again.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Thu 20 May 2010 04:32 PM (UTC)
Message
As I said in your crosspost over here:
http://www.smaugmuds.org/index.php?a=topic&t=4419&p=20720

I said:
Diku is only 'accidentally' object oriented in places, but this is neither enforced nor really encouraged. You can write OO code in C, it's just that Diku didn't. I don't think that you need polymorphism to be considered object oriented (although if you have it, it's a pretty clear indication of at least some OO design), but you do need a stronger conception of objects and public interfaces to those objects.


To answer your new question, mud.h contains the necessary prototypes for functions, a few declarations for global variables, and such things. There is not really a strict organizational scheme although the file names will give you a nominal idea of what is supposed to go in there. E.g., act_comm.c contains stuff related to communication actions; act_wiz.c contains stuff related to wizard (i.e., imm) actions.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,054 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.