Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Yahoo!, Google

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » Are diku derivatives procedeu...
Forum Rules | Mark all | Recent Posts

Are diku derivatives procedeural or OO?
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 20, 2010, 12:39 am   Last edited May 20, 2010, 12:42 am by crimsongate
Go to the top of the page
Go to the bottom of the page

crimsongate
Fledgling
GroupMembers
Posts7
JoinedMay 15, 2010

Ive been peering over the code in my SWFotE base, and really after having looked at it now with some programming know-how, I see the code differently than I did before. But 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.

edit: Oh and I do have one, off-topic question for anyone reading: What is hotboot and how does it benefit the adminstration of a MUD? Where can I find more information on it?
       
Post is unread #2 May 20, 2010, 12:48 am
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

I'm pretty sure its not object oriented.

As to hotboot basically say you make some changes in the code (bug fix, new skill whatever) your game builds fine, instead of a full shutdown/reboot you just hotboot and poof! Add your new command via ingame tools and your good to go.

ayuri
       
Post is unread #3 May 20, 2010, 3:00 am
Go to the top of the page
Go to the bottom of the page

Caius
Magician
GroupMembers
Posts132
JoinedJan 29, 2006

crimsongate said:

Ive been peering over the code in my SWFotE base, and really after having looked at it now with some programming know-how, I see the code differently than I did before. But 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.

I can't think of a single design concept in the standard Diku derivs that could be called object-oriented in any common definition of the word. One definition, which I tend to favour, is that there is no OO without polymorphism.

Even if you could point out the odd OO concept, all Dikus I know of are unmistakenly procedural in nature.
       
Post is unread #4 May 20, 2010, 7:45 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Diku code, and subsequently everything derived from it, is unmistakeably procedural in nature. However, with that said, the FUSS Bases do make use of function overloading, in several places, which might be what you're seeing different.

As for hotboot, as Ayuri said, it's a way to reboot the MUD and incorporate changes without disconnecting anyone connected. Hotboot essentially runs a second instance of your MUD to load the new object code and executable, and then transfers the descriptors of all connected parties to the second instance, and shuts down the first instance. It also tracks where mobs and objects are and loads them back exactly where they were (or it should be).
       
Post is unread #5 May 20, 2010, 7:59 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

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.
       
Post is unread #6 May 20, 2010, 11:15 am
Go to the top of the page
Go to the bottom of the page

crimsongate
Fledgling
GroupMembers
Posts7
JoinedMay 15, 2010

Thanks for the responses. Most of what you guys said sort of was in the back of my mind already. And, yeah, I havent seen any classes being instantiated anywhere and therefore no polymorphism.

Thanks for answering the hotboot question on the fly, Ayuri & Kayle. Its been about 10 years since I was an imm on a MUD and built. I do remember it now.
       
Post is unread #7 May 20, 2010, 12:52 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

And, yeah, I havent seen any classes being instantiated anywhere and therefore no polymorphism.

You don't need classes to have polymorphism...

const char* get_value(SomeObject* obj) {
  switch (obj->type) {
    case ANIMAL_CAT: return "cat";
    case ANIMAL_DOG: return "dog";
    default: return "zomgwtfbbq";
  }
}


Or, more advanced versions would look up the proper function to call in the object's "vtable".

Of course, classes and a proper inheritance structure make it easier...
       
Post is unread #8 May 23, 2010, 5:23 am
Go to the top of the page
Go to the bottom of the page

crimsongate
Fledgling
GroupMembers
Posts7
JoinedMay 15, 2010

You'll have to forgive me if I dont follow. A blessing and a curse of my modern education in programming is that it started with Java 6 & OOP only. Ive never had any experience with procedural programming and other languages.

A part of the reason why I dont follow the code you gave is the fact that its in C with pointers and syntax I dont know (just yet). Another part is that I dont know if in the code thats presented if there is any form of inheritance going on, which is required (by my understanding) for poly to happen.

Procedural, as I am learning, does have its uses in programming for certain types of programs. And the difficulty I am facing right now is how to piece together the different .c files and how the mud is built from them. I am trying to get a gestalt view of how my base (SWFotE) is organized... so I am having to learn C at the moment along with my studies in Java (and C#) presently.
       
Post is unread #9 May 23, 2010, 1:33 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Polymorphism is, generally speaking, when the same operation name does something different depending on what object it is performed on. How this decision to do something different is made is unspecified; most OOP languages do it via inheritance and so forth.

The C code I gave you is quite close to Java; just replace "const char*" with String, and instead of a pointer think of it as just an object reference.

You can write polymorphic code in Java without using inheritance -- never mind that it would be pretty silly to do so -- by using a technique similar to the above. On your objects, have a field called "object_type". The object would have a method that checked the object_type field and did something different depending on the type. (This is, again, terribly silly considering that the language gives you much better support for this kind of thing.)

Procedural programming isn't really an utterly different way of writing code that makes no sense at all to an OOP'er. The same principles for what makes good code still apply. Dikurivatives do not always have good code.
       
Pages:<< prev 1 next >>