[RFC|Merged] Javascript Coding Style

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.
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC] Javascript Coding Style

Post by naderman »

Anyone going to make a pull request for the coding guidelines to add a section about javascript with what is proposed here?

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Javascript Coding Style

Post by callumacrae »

naderman wrote:Anyone going to make a pull request for the coding guidelines to add a section about javascript with what is proposed here?
Doing it now.
Made by developers, for developers!
My blog

_hsr
Registered User
Posts: 42
Joined: Mon Mar 26, 2012 7:06 am

Re: [RFC] Javascript Coding Style

Post by _hsr »

@callum, I'd like to work on writing the guidelines too, enlighten me with the source :p
There is a text here !

User avatar
Fyorl
Google Summer of Code Student
Posts: 27
Joined: Mon Apr 02, 2012 4:51 am
Location: UK
Contact:

[RFC] Coding guidelines - JavaScript braces

Post by Fyorl »

I'd like to revisit the discussion on curly braces in Javascript since it didn't seem to get resolved in the previous pages. It was already established that braces on their own line looked ugly for anonymous functions and also caused bugs/errors when attempting to return an object. In this case, it feels inconsistent to have one style of curly braces for objects and lambdas but another for named functions and block statements. Would it not be simpler to just say that, in Javascript files, the opening curly brace should be on the same line?

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

Re: [RFC|Accepted] Coding Guideline Modifications

Post by naderman »

I think we really should stop adding more things to this RFC and just start new ones whenever new things come up. Does someone feel like splitting up recent posts into separate discussions?

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC|Accepted] Coding Guideline Modifications

Post by brunoais »

naderman wrote:Does someone feel like splitting up recent posts into separate discussions?
I do.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC|Accepted] Coding Guideline Modifications

Post by callumacrae »

Fyorl wrote:I'd like to revisit the discussion on curly braces in Javascript since it didn't seem to get resolved in the previous pages. It was already established that braces on their own line looked ugly for anonymous functions and also caused bugs/errors when attempting to return an object. In this case, it feels inconsistent to have one style of curly braces for objects and lambdas but another for named functions and block statements. Would it not be simpler to just say that, in Javascript files, the opening curly brace should be on the same line?
That's what was decided, and I have an open pull request for it here: https://github.com/phpbb/phpbb3/pull/779
naderman wrote:I think we really should stop adding more things to this RFC and just start new ones whenever new things come up. Does someone feel like splitting up recent posts into separate discussions?
Done (ish).
Made by developers, for developers!
My blog

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

Re: [RFC|Merged] Javascript Coding Style

Post by naderman »

The PR has been merged.

Post Reply