Author |
Topic  |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 19 January 2001 : 01:50:22
|
quote: Has someone drafted a standard on SNITZ coding -- structures/conventions/standards etc? This would be extremely useful for the developer, the moderators, the users. I can't see a down side of doing this -- except someone has to do it!
Rob has good idea here. Snitz standards will be helpful. Just throwing it out for discussion.
- Alan
|
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 19 January 2001 : 03:00:28
|
I just model everything I do after the current Snitz code.  |
 |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 19 January 2001 : 03:17:17
|
quote:
I just model everything I do after the current Snitz code. 
Yeah, we've been looking and working with the code for a while now so it's familiar to us...but to someone new to snitz who has an idea on a mod...this info would save considerable time 
heck, I didn't know what the strDBSQLNT variables and stuff were for until kal corp pointed it out.
- Alan
Edited by - aznknight on 19 January 2001 03:18:14 |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 27 January 2001 : 12:58:21
|
<raises hand> I'm still kinda fuzzy on all the NT stuff... I rely on Kal and Richard Exclusively for that stuff.
What kind of things would we realy talk about in a convention page though? a couple major things for me would be:
1. Spacing (all HTML is spaced out with spaces, and ASP code is TAB'ed out) 2. Single DB Connection and Closing (top and bottom in the Inc_Top and Inc_Footer) 3. Limit <% %> <% %> <% %> useage 4. Utilize Response.Write "..." & _ instead of switching back and forth between HTML and ASP code. 5. Access the DB as little as possible.
Reinsnitz (Mike) ><)))'> "The glory of young men is their strength, and the honor of old men is their gray hair." - Proverbs 20:29
|
 |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 27 January 2001 : 13:36:59
|
1) Ah I didn't know that this was the standard for spacing on Snitz. I just tab out everything...woops. 2) Single db connection..this is important to help server performance and help people with the "file in use" error. I notice in private messages and active user mod that "my_Conn" was opened again within the mod but it's not neccessary since it was already opened in inc_top.asp 3 & 4) I always strive to avoid excess usage of <% %> whenever I can. 5) makes perfect sense. Roundtrips wastes server resources.
thanks for pointing out these...I'm sure there's more standards and conventions used by snitz forum out there. Others we should know about, snitz developers and users?
I think a compilation of the snitz standard should be put in a downloadable file somewhere.
- Alan
|
 |
|
Aznknight
Senior Member
   
USA
1373 Posts |
Posted - 27 January 2001 : 13:42:13
|
Here's some I ran across that are useful to know for mod writers.
1) get to know the mlev and chkUser2 functions. 2) Use strMemberTablePrefix and strTablePrefix instead of hard-coding "FORUM_" 3) if you have the member id, you can get the Member name by the function getMemberName(id), and respectively, you can get the id from member name from the function getMemberID(). 4) Use the forum variables for layout (ie strForumCellColor, strDefaultFontSize, etc) instead of hard coding these attributes. 5) try to use dates as strings like the forum does.
Some of the points I just wrote I was quilty of but have fixed and kept in mind when I write mods.
Cheers,
- Alan
|
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 28 January 2001 : 05:45:38
|
I think we are probably guilty of doing all those things when we wrote our first mods, it take a while to get to know the code enough to realise.
'Resistance is futile' |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 06 February 2001 : 16:54:01
|
can you think of any others huwr?
Reinsnitz (Mike) ><)))'> "Blessed are those who hear the word of God and obey it." - Luke 11:28
|
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 14 February 2001 : 15:10:12
|
anyone want to volunteer to come up with a list? (I can be pinged for content) the biggest thing is geting something started... this will initialy be a top level menu item on the site here unless there are better ideas. :)
Reinsnitz (Mike) ><)))'> "Therefore go and make disciples of all nations,..." Matthew 28:19a |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 14 February 2001 : 15:23:42
|
Ever since a while ago when Gor pointed out that less <% and %> there are improves performance, I've been trying to use as little HTML hardcode as possible, and passing it all through variables or response.write()
Some things I would mention: 1) using default fonts and stuff instead of leaving it to the browser (mentioned above) 2) using existing functions instead of writing out new code (mlev, getMemberName, ChkUser, formatStr, etc...) 3) for any posting/editing for new mods, using the 'format bar'
---- Da_Stimulator Snitz Forums Dev Team Member http://stimmy.cfm-resources.com/forum - my testing forums. |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 14 February 2001 : 16:21:59
|
learn how to use the datetoStr and strToDate functions to avoid using date fields.
biggest point try to keep your MOD as self contained as possible, the fewer changes required to existing code, the easier it is to install
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 14 February 2001 : 16:30:45
|
yeah that too... I usually write out the files to run independantly, then I stick the includes in, unless its neccassary to edit existing files. Such as faq.asp for my faq mod.
---- Da_Stimulator Snitz Forums Dev Team Member http://stimmy.cfm-resources.com/forum - my testing forums. |
 |
|
|
Topic  |
|