fuelphp-storage / fuelphp

FuelPHP framework
http://fuelphp.com
MIT License
274 stars 57 forks source link

PSR-2 #58

Closed kenjis closed 9 years ago

kenjis commented 9 years ago

I know you guys don't like PSR-2, but more and more PHP projects adopt PSR-2. It is getting to become PHP de-facto standard.

Why don't you reconsider to adopt PSR-2?

Ref, http://bakery.cakephp.org/articles/jameswatts/2014/12/16/cakephp_3_to_fully_adopt_psr-2

sagikazarmark commented 9 years ago

@kenjis you made a huge mistake, because a war starts now. There are several reasons against PSR2. I suggest you reading the last few year IRC logs. IMO the biggest reason is readability. But I leave it to @WanWizard to explain it. It is time to explain for the public why we don't follow PSR2.

WanWizard commented 9 years ago

I think that has been discussed numerous times over the last few years.

My general problem with the PSR's is that they are no standard. They are a few people, mainly from the "symfony" corner of the web, that have decided that these should be "standards" everyone should use. People that have a different opinion and want to voice it are not welcome. FuelPHP was denied membership because of this, which is odd compared to the ease in which others are accepted.

Now, PSR-2 in particular is not a standard at all, it is a coding style guide.

Which, like any other style, is every personal. The biggest problem I personally have with it is, as @sagikazarmark already said, readability. It takes a developer simply more time to understand code written in "symfony style", it is too compact to see in a glance what the code is all about.

sagikazarmark commented 9 years ago

IIRC I found a study about using tabs increases readability. Do you remember @WanWizard?

kenjis commented 9 years ago

I don't like wars. This is just a discussion.

This issue is about PSR-2. It is about coding style.

sagikazarmark commented 9 years ago

Relax, just kidding. :)

emlynwest commented 9 years ago

Since it's clear that we are not going to switch to PSR-2 I am closing this issue.

kenjis commented 9 years ago

it's clear that we are not going to switch to PSR-2

Would you please explain why?

PSR-2 and custom (Fuel) coding style, they have both pros and cons.

sagikazarmark commented 9 years ago

@kenjis readability. (Damn, I can't find that study about why tabs are better than spaces)

@stevewest maybe a blog article with explanation? (IIRC you were excited about writting posts, weren't you)

emlynwest commented 9 years ago

@sagikazarmark when I have the time for them :wink: But might indeed be a good idea as this question keeps coming up. As for tabs vs spaces I much prefer tabs mostly because you can change the size that they render at, with spaces you cannot, so the dev has full control over how "deep" the indentation is without effecting the viewing pleasure of others.

kenjis commented 9 years ago

@sagikazarmark Of course I know the word "readability", but I don't get what is better. Because I use 4 spaces for a tab in my editor, so 4 space indent (PSR-2) and tab indent are the same to me.

sagikazarmark commented 9 years ago

It is not just spaces, but there are some more differences, like new line after control structures. Read @WanWizard's comment about this.

Also, we gave a reason why we use tabs. What are the reasons for using spaces (except a "few" people decided to do and called it a standard)?