Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 05-16-2003, 02:18 AM   #1
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Unhappy

While browsing through some old code at work (not MUD code, but relevant none the less) I came accross an attrocious cpp file, the various authors had come from different coding backgrounds (4 of them, an engineer used to  fortran, a java programmer, a C prima donna - not an attack at C users just this guy, and an amateur VB *shudder* user). 2 of them used a consistent style (alas, only within their own code, and not with each other) and the others were inconsistent even within their own functions *boggle*. As you can imagine this makes for very hard to maintain code. Since then the company has begun to enforce a style, and once you are used to it, it seems logical and easy to follow. Now I look at the CircleMUD code, and I can see the same thing, inconsistant styles, and hard to follow code in places.

I was wondering how many other coders follow some sort of standard (obviously not just your own personal one) and if anyone out there (in the appropriate position) enforces a standard on their coders.

When I write code, I aim to leave it maintainable by someone with no previous experience with that code (note THAT CODE! not no experience coding), do others try to do this too, or is "get it working" good enough?
karlan is offline   Reply With Quote
Old 05-16-2003, 04:29 AM   #2
Kastagaar
Member
 
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
Quote:
Originally Posted by
I was wondering how many other coders follow some sort of standard (obviously not just your own personal one) and if anyone out there (in the appropriate position) enforces a standard on their coders.
At work, I have a standard to follow which, to my eyes at least, is quite ugly. At home, I follow my own personal standard which is not too different from that used in the Boost libraries. While I'd rather not have to, I think that using two different styles aids in my comprehension of others' code - to help "look past" the notation.

Quote:
Originally Posted by
When I write code, I aim to leave it maintainable by someone with no previous experience with that code (note THAT CODE! not no experience coding), do others try to do this too, or is "get it working" good enough?
An honourable notion - and one I try to work to. One such idiom I try to keep is "The Code Is The Comment" - sensible naming and layout keeps it as close to English as possible; when that can't be done, add a comment.

However, I think that if you want to leave your program in a state suitable for a maintenance programmer to come along and understand it, you need documentation. Without it, it's only the maintainer's best guess as to the explicit semantics of your work.

Kas.
Kastagaar is offline   Reply With Quote
Old 05-16-2003, 05:01 AM   #3
Tamsyn@zebedee.org
New Member
 
Join Date: Mar 2003
Posts: 23
Tamsyn@zebedee.org is on a distinguished road
Obviously there are no 'title standards' ("codong"...heh)

On Zeb, we having a review system, where every new area or other project is marked by other coders under various categories - balance, bugs, and coding. Coding requires code review, which usually involves randomly looking at some rooms and objects, making sure to look at anything complex.

Code review involves
1) making sure code is readable, indented properly, commented where anything complex is going on
2) making sure standard mudlib objects are used where appropriate

A reviewer gives the project a pass in each area. When the project has enough passes under all areas, it goes online.

It means it takes longer to get areas up, and sometimes there is a backlog of reviews to do (I am guilty at the moment of having 7 areas to review! but usually it means the quality of new areas is good from the minute they go online.

And most importantly, coders buy into this system - i don't get any huge complaints about having to follow it.
Tamsyn@zebedee.org is offline   Reply With Quote
Old 05-16-2003, 06:14 PM   #4
Lodes
New Member
 
Join Date: Apr 2002
Location: California
Posts: 15
Lodes is on a distinguished road
Send a message via AIM to Lodes
Hello,

Even though now I am not into muds I do look back on the forums see if anything interesting shows up. What I do, is set up a coding standard for every project I am starting and include it in my project as a text file. It goes from how many spaces indentation should be, to naming functions, variables. It is quite successful as if there is somebody new to the project they just read that file and all of a sudden the code can be a lot more readable even though the standards set for every project are pretty straight forward and easy to read and comprehend. At least in my opinion

It is extremely important to set standards for every project, it makes your code reusable and your project looks consistent.

- Lodes
Lodes is offline   Reply With Quote
Old 05-17-2003, 03:35 AM   #5
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Unhappy

Yes I do have to apologise for the codong thing, and IF I can find a way to fix it I will.

I find the review idea interesting Tamsyn, and I think used in combination with a document setting out the standards as mentioned by Lodes should end up with consistent and maintainable code. We already have a basic review system in place but a more indepth one would be better. I originaly proposed the Java/Sun or GNU coding standards, but it seemed people did not actually read them (boring I know, but...) let alone follow them.

Has anyone else run up against a prima donna coder (or indeed in general) before, are they as irritating for others as for me?
karlan is offline   Reply With Quote
Old 05-17-2003, 03:55 PM   #6
visko
Member
 
Join Date: May 2002
Posts: 98
visko is on a distinguished road
Send a message via ICQ to visko Send a message via AIM to visko
Dealt with them, am one, yeah. We're all pains in the ass, but occasionally (and happily) some of us end up creating legible, maintainable code that can be used without too much screaming and cussing.

If you're looking for a more structured way of developing your code, the above comments are ones I'd never thought of before, and I have to say they're pretty good ideas. I'm more of a free-form chaotic coder, and most of the people I've worked with like it as fragmented and crazy as possible; probaby why we work together.

But yeah, prima donna programmers in general are a serious pain in the ass. On the other hand, occasionally they have the skills to back up the attitude, and with those you can usually find a happy middle ground; if they're smart enough to be useful, they might just be smart enough to be rational as well.

-Visko
visko is offline   Reply With Quote
Old 05-17-2003, 05:58 PM   #7
enigma@zebedee
Member
 
Join Date: Mar 2003
Posts: 70
enigma@zebedee is on a distinguished road
Yeeh Tamsyn, what are you doing on here? Go review my area damnit! That Elder Wyrm aint gonna eat any legends when he is sat in the review system!

Work doesn't enforce coding standards, although it tries too. Every year we get a new 'lets follow the new new revised proper coding standards' speech and then everyone carries on as per normal.

Zebedee has basic coding standards - but its just on the 'indent your code, use sensibly variable names' level rather than a full style guide.
enigma@zebedee is offline   Reply With Quote
Reply


Thread Tools


Codong Standards - Similar Threads
Thread Thread Starter Forum Replies Last Post
Personal Standards as a Builder Miyamoto MUD Builders and Areas 16 06-29-2002 05:43 PM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 03:04 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014