News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[WIP] SMF Coding Guidelines

Started by Joshua Dickerson, March 23, 2007, 04:27:52 PM

Previous topic - Next topic

Joshua Dickerson

Quote from: PJLawrence on October 05, 2008, 02:44:54 PM

In the coding guide lines (smf coding guidelines.pdf) it states the following..

QuoteDo not indent statements in the global scope (not inside of a class, function, statement)
(see the example in Appendix B)

However, Appendix B does not seem to contain this information.
Or is it just me and I've missed it?
It's not you, I haven't had the time to do any of this. I was hoping someone could pick it up for me. Anyway, to give you an example of what that means:

<?php
    
// Indented code. Not supposed to be indented here.
// This is where it should start. Being that it is in the global scope.
function show_you()
{
    
$a 'Notice how this is indented here. That is because it is inside a function';
}

// Notice the below is not indented because it is in the global scope.
show_you();
?>


I hope that helps you out some. If you want to edit the original file, I will fix the original post.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Joshua Dickerson

If you want to collaborate on this, I've uploaded it to Google Docs. Just give me your info and I will add you to the doc.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Joshua Dickerson

This will need tons of updating for SMF 2
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

N3RVE

Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

ivan91tran

#44
Well I'm still working on my coding, so I don't want to correct you there. I did however do a thorough run-through of all the grammar and punctuation, and there seems to be nothing wrong. Hope that helps :)

Advertisement: