yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.22k stars 6.92k forks source link

Switching to PSR-2 #2747

Closed samdark closed 10 years ago

samdark commented 10 years ago

See #2743, #9

schmunk42 commented 10 years ago

@qiangxue Great! Thank you very much.

iJackUA commented 10 years ago

Should it be removed <exclude name="Generic.WhiteSpace.DisallowTabIndent"/> from https://github.com/yiisoft/yii2-coding-standards/blob/master/Yii2/ruleset.xml ?

schmunk42 commented 10 years ago

@iJackUA It's already merged: https://github.com/yiisoft/yii2-coding-standards/pull/9/files ;)

iJackUA commented 10 years ago

@schmunk42 no, that's another line , it is still exist in rulesset.xml

maximal commented 10 years ago

The most reasonable indentation style is SmartTabs: indentation with tabs, alignment with spaces.

I’m against changing Yii style to spaces only :-(

And many modern IDEs and editors do it right.

samdark commented 10 years ago

@maximal that's not about usability, it is about overall consistency in PHP world.

cebe commented 10 years ago

@maximal can't agree more but the majority of people seem to love standards and stick to them without questioning whether it is useful or not...

digitalkaoz commented 10 years ago

interoperability is useful, much more then personal coding style preferences ;)

maximal commented 10 years ago

Agree with you. Framework in any given language, probably, should use current standard for this language (PSR-2 for PHP, for instance).

But, from the other hand, why did unreasonable standard remains real then? Standards sometimes became unuseful and vast majority of people have to follow them just to follow. Space-only indentation is relic of the past, when people don’t know about smart-tabs indentation.

samdark commented 10 years ago

@maximal it's a long term holywar that resulted in spaces decision withing php-fig. I prefer any decision to no decision regarding it.

digitalkaoz commented 10 years ago

you dont have to configure spaces in any editor in any os in any environment, they just look the same for everyone...

maximal commented 10 years ago

@digitalkaoz, anyway, I don’t know any situation when smart-tabbed text brokes its alignment.

http://www.emacswiki.org/SmartTabs

tom-- commented 10 years ago

Enough

I can't think of a less interesting topic to argue about.

This is turning into another sign that it's time to move on from github.

digitalkaoz commented 10 years ago

yes am also tired about discussing tabs vs spaces, it just doesnt matter, following a standard matters

plandem commented 10 years ago

i'm for tabs, coz IDE can be configured. I'm using tabs from c/c++ times at the deep past. Spaces is pain for "fast-fixing" outside of IDE and mostly always breaks such 'nice' formatting :(

But i'm for standard here. Anyways, i'm not going to patch framework alot, so for projects i will still use tabs :)

maximal commented 10 years ago

Sorry, but one more try.

Tabs advantages:

Spaces advantages:

Spaces became standard, yes. But that was strictly because people were unable to use tabs properly. That was 30-, 20-, 10-years-ago problem. But why are they unable to use tabs now, when IDEs are mighty?

The less we use tabs, the less chances they have to became standard. People now are just afraid to use them. It means that standard needs to be reviewed.

Sorry again.

samdark commented 10 years ago

That's the question for PSR, not for Yii. If there will be another standard with tabs we'll switch to it immediately.

maximal commented 10 years ago

@samdark, thank you, Alexander.

lucianobaraglia commented 10 years ago

@maximal :+1: it's amazing standards keeps defending spaces nowadays... @samdark I hope so...you are a member of the PHP FIG, is still this discussion ( spaces VS tabs ) rising up time to time?

samdark commented 10 years ago

@lucianobaraglia yeah, it's still popping up from time to time but not that often and it's not as hot as it was.

maximal commented 10 years ago

@lucianobaraglia, thanks. I opened php-fig/fig-standards#264, but @pmjones closed the discussion. I think it’s time to fork PSR-2 to have more competing standards :-)

If you guys have any ideas, I’m open to requests — https://github.com/maximal/tab/.

lucianobaraglia commented 10 years ago

@maximal spaces dinosaurs still rule the Earth... :neutral_face:

kotslon commented 10 years ago

Hey, people! Why are you still using blank lines for readability? Maybe it's time to invent vertical tab? And why do we use spaces between words instead of \s+ ? One could config own IDE to show that symbols as exotically, as he'd like!

Seriously, i think tabs are not so widely used, because they are alone. One configurable parameter is not enough for introducing the concept of such a configurability. Maybe some day there will be more...

alpharder commented 10 years ago

Why do you guys pay so much attention to this? There are a lot of much more important things to discuss

rawtaz commented 10 years ago

What a great fail this is. Way to ruin a great framework.

And yes, it is obviously a very important discussion, otherwise there wouldn't be an endless stream of opinions on the topic. If it wasn't important, the discussion would die out.

There will never be a common agreement on this. Either "side" of the discussion will be unhappy, while the other is happy.

rawtaz commented 10 years ago

+1 for keeping tabs, even if it's too late :P

rawtaz commented 10 years ago

@kotslon 1) Because blank lines apparently are fine as "vertical whitespace" for most people, otherwise there would have been more discussion about it. 2) Vertical tab already exists, check your facts before typing.. 3) Same as (1). Seems you just wanted to try making this more complicated than it is, which is rather pointless. The things you mention are clearly not an issue for people, so there's no use in bringing them up.

@alpharder Because people care a lot, and because someone brought it up again in #2743. If there are, as you say, more important things to discuss, then the spaces zealots shouldn't bring this up over and over again.

There's been so much bullshit in this thread that there's no way one can comment on all of it. And obviously it doesn't matter anyway since the decision has been made. Kudos to the pro-tab people for standing up for their beliefs.

With this, I'm done.

arm4b commented 10 years ago

I can say I prefer Yii 1 coding style and didn't like this change, but during time after switching to PSR-2 I feel no problems using spaces instead of tabs.

That was right decision that removes another one barrier on the way of Framework growth and popularity.