Yii Framework Forum: Coding Standard tools - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Coding Standard tools Help to develop yii standard application

#21 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 665
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 01 March 2012 - 01:15 PM

I didn't think that the core team would need to have a public coding standard.

But now I agree with jacmoe because it will ease contributions to the framework and avoid this: https://github.com/g...5d692a95b9f5373.
A layout definition file can even make things easier.
1

#22 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 01 March 2012 - 01:20 PM

Yes, that is exactly the reason why I think it would be a good idea: to ensure that contributions are applied as cleanly as possible.
"Less noise - more signal"
0

#23 User is offline   choiceerp 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 24-April 10
  • Location:EUROPA - France - Paris

Posted 01 March 2012 - 01:26 PM

View Postchoiceerp, on 01 March 2012 - 12:59 PM, said:

I agree to, if it's not necessary to fix everythings, but just some rule to make the code more readable. If in 2 or 3 year I should get an old application with no rule, I whant not must be say; "put your work at trash and restart on another framework".
In same time if i get the same project but from Symfony2 and is writted on the same way, I can't say same and that just because Symfony2 have set writting rules and if the developper don't follow and if the code isn't readable, that mean the project manager is null and I put him in trash.

example of few rule:
- no braces for single line statements (braces exist in order to group multiple lines, no multiple lines no braces)
- space after conditions (they are not functions like f(x) )
- private menber start by _ and not static member start in minus
- indentation (space or tab, not problem but indent)
- presence of doc generated automaticly (@param and @return minimum)
and that all (and i think that the minimum)


Just for exemple Yii framework + somes plugins (all needed by all my website on yii) give 120.495 errors and 23.379 warnings with the rule code of Symfony2 and beleave me I prefert Yii to Symfony2, but that avanche of error in rules desesperate me, spececialy by the extensions folder giving to me arrond 80.000 errors in rule. So Symfony2 is not clean with they hown rules and give 5.005 errors and 1.007 warnings with the demos download.
knowledge is valid only if it is shared ;-)
0

#24 User is offline   choiceerp 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 24-April 10
  • Location:EUROPA - France - Paris

Posted 01 March 2012 - 01:41 PM

View Postchoiceerp, on 01 March 2012 - 01:26 PM, said:

Just for exemple Yii framework + somes plugins (all needed by all my website on yii) give 120.495 errors and 23.379 warnings with the rule code of Symfony2 and beleave me I prefert Yii to Symfony2, but that avanche of error in rules desesperate me, spececialy by the extensions folder giving to me arrond 80.000 errors in rule. So Symfony2 is not clean with they hown rules and give 5.005 errors and 1.007 warnings with the demos download.


Houps I forgot some directory for Symfony2 the good count is 36.473 errors and 7.980 warnings,
knowledge is valid only if it is shared ;-)
1

#25 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 02 March 2012 - 06:29 PM

=)
0

#26 User is offline   Psih 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 115
  • Joined: 30-June 10

Posted 05 March 2012 - 07:38 AM

Some coding standards should be defined and acceptance to the package managing should be filtered through them. Take srbac module for example - it has ugly looking code and I have to put it through PHPStorm's "Reformat code" before I try to do something with it.

Despite me using different conventions than Yii does, I have no problem reading that code (although lack of braces on single-line if's and loops makes you read the code more carefully).
2

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users