phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC|Accepted] Coding Guideline Modifications

These requests for comments 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.

Re: [RFC|Accepted] Coding Guideline Modifications

Postby Oleg » Thu Dec 22, 2011 6:23 am

Another issue: are new functions required to not use globals and instead have them dependency injected?
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: [RFC|Accepted] Coding Guideline Modifications

Postby igorw » Thu Dec 22, 2011 12:54 pm

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
igorw
Registered User
 
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Postby nickvergessen » Sat Dec 24, 2011 5:33 pm

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.
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 350
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC|Accepted] Coding Guideline Modifications

Postby imkingdavid » Sat Dec 24, 2011 7:01 pm

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
imkingdavid
Development Team
Development Team
 
Posts: 902
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Postby bantu » Tue Dec 27, 2011 2:09 am

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. ;-)
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
 
Posts: 437
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany

Re: [RFC|Accepted] Coding Guideline Modifications

Postby Oleg » Sat Dec 31, 2011 9:50 pm

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.
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: [RFC|Accepted] Coding Guideline Modifications

Postby naderman » Sun Jan 01, 2012 3:29 pm

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.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1649
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: [RFC|Accepted] Coding Guideline Modifications

Postby bantu » Sat Jan 07, 2012 4:55 pm

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
User avatar
bantu
3.0 Release Manager
3.0 Release Manager
 
Posts: 437
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany

Re: [RFC|Accepted] Coding Guideline Modifications

Postby sajaki » Thu Apr 12, 2012 10:53 am

hi,

Is there a phpbb specific guideline on using docblocks or does this one apply ?
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblock
sajaki
Registered User
 
Posts: 48
Joined: Mon Jun 21, 2010 8:28 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Postby naderman » Fri Apr 13, 2012 3:17 am

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).
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1649
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Previous Next

Return to [3.1/Ascraeus] Merged RFCs

Who is online

Users browsing this forum: No registered users and 11 guests