[RFC|Accepted] Coding Guideline Modifications

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by Oleg »

Another issue: are new functions required to not use globals and instead have them dependency injected?

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Post by igorw »

I don't think we should be so strict about commit messages. It really slows down development. Having meaningful messages is important, but things like capitalization, spelling and too long lines really shouldn't require rebases every time.

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by nickvergessen »

Oleg wrote:Another issue: are new functions required to not use globals and instead have them dependency injected?
I don't really like this one. We have globals everywhere in the code base. And I prefer it much more than having 6+ additional parameters on a function.
Member of the Development-TeamNo Support via PM

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Post by imkingdavid »

nickvergessen wrote:
Oleg wrote:Another issue: are new functions required to not use globals and instead have them dependency injected?
I don't really like this one. We have globals everywhere in the code base. And I prefer it much more than having 6+ additional parameters on a function.
+1
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by bantu »

nickvergessen wrote:
Oleg wrote:Another issue: are new functions required to not use globals and instead have them dependency injected?
I don't really like this one. We have globals everywhere in the code base. And I prefer it much more than having 6+ additional parameters on a function.
Your statement is missing a reason. ;-)

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by Oleg »

igorw wrote:I don't think we should be so strict about commit messages. It really slows down development. Having meaningful messages is important, but things like capitalization, spelling and too long lines really shouldn't require rebases every time.
If people write correct commit messages most of the time and occasionally make a mistake, it's no big deal to fix them. In projects that do not have commit message requirements I think you end up with a bit of a free for all as people spend that much less effort on commit messages.

You don't actually have to even go that far for proof, take a look at our own commit messages pre-git.

Where I agree this is a big issue is in contributors' commit messages. And the real problem I would say is that the developers can't fix contributors' commits in github pull requests.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by naderman »

There is a difference between having formal requirements for commit messages, which we have and enforcing a particular capitalisation in commit messages. Let's just move on.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by bantu »

igorw wrote:The file header still needs to be adjusted. Currently it is:

Code: Select all

/**
*
* @package {PACKAGENAME}
* @version $Id: $
* @copyright (c) 2007 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
I'd suggest something among the lines of:

Code: Select all

/**
*
* @package {PACKAGENAME}
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
*
*/
This should only apply to files new to the develop (ascraeus) branch.
This has been changed now. See viewtopic.php?f=99&t=42353

sajaki
Registered User
Posts: 86
Joined: Mon Jun 21, 2010 8:28 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Post by sajaki »

hi,

Is there a phpbb specific guideline on using docblocks or does this one apply ?
http://manual.phpdoc.org/HTMLSmartyConv ... s.docblock

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by naderman »

Those are the rules for formatting them, yes.

We have a few more phpBB specific rules: Always document function return value using @return null if no value is returned. Always document all parameters with type and description. But I think that's all. Oh and we don't always document member variables, but often that is rather helpful (no need for @access though since we use PHP5 and require use of access modifiers anyway).

Post Reply