Switching to PSR-2 #2747

Closed
samdark opened this Issue Mar 14, 2014 · 77 comments

Comments

Projects
None yet
@samdark
Member

samdark commented Mar 14, 2014

See #2743, #9

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

i am against spaces, in netbeans their usage is painful, also i dont think that switching PSR styles here and there is good, we should be strict in usage one of them and not jumping from one to another.

Contributor

Ragazzo commented Mar 14, 2014

i am against spaces, in netbeans their usage is painful, also i dont think that switching PSR styles here and there is good, we should be strict in usage one of them and not jumping from one to another.

@nineinchnick

This comment has been minimized.

Show comment
Hide comment
@nineinchnick

nineinchnick Mar 14, 2014

Contributor

Should we vote, I'm for it. I'm not bringing any arguments up, referred issues are enough.

Contributor

nineinchnick commented Mar 14, 2014

Should we vote, I'm for it. I'm not bringing any arguments up, referred issues are enough.

@subdee

This comment has been minimized.

Show comment
Hide comment
@subdee

subdee Mar 14, 2014

Contributor

I personally was hoping that Yii2 would conform to all the PSR standards, was disappointed to see that it doesn't. There's nothing wrong with conforming with a standard that's agreed upon.

Thus, I vote for PSR-2.

Contributor

subdee commented Mar 14, 2014

I personally was hoping that Yii2 would conform to all the PSR standards, was disappointed to see that it doesn't. There's nothing wrong with conforming with a standard that's agreed upon.

Thus, I vote for PSR-2.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

definitly for psrX...working with different coding styles in one project is a pain in the ass...iteroperability ftw, thats why mostly every php library switched to it, it simply makes code formatting a no-brainer in the php world...

personal preferences should stand back on this one, every ide can handle it properly.

definitly for psrX...working with different coding styles in one project is a pain in the ass...iteroperability ftw, thats why mostly every php library switched to it, it simply makes code formatting a no-brainer in the php world...

personal preferences should stand back on this one, every ide can handle it properly.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

@digitalkaoz can you show me how faster you will be by browsing code with vim and PSR-2 spaces, or in netbeans IDE? So you are proposing that each programmer should be some piano master to remember all switch-combinations and use them? I also dont like arguments splitting in method signature, it only makes code unreadable.

Contributor

Ragazzo commented Mar 14, 2014

@digitalkaoz can you show me how faster you will be by browsing code with vim and PSR-2 spaces, or in netbeans IDE? So you are proposing that each programmer should be some piano master to remember all switch-combinations and use them? I also dont like arguments splitting in method signature, it only makes code unreadable.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

so you rating "browsing code without shortcuts" higher than "common readability across different libraries"? vim: alt+shift+arrays, phpstorm alt+arrows ;)

its just not a matter of personal preferences, its a matter of a common sense, correct formatting is done by some tools or your ide itself

so you rating "browsing code without shortcuts" higher than "common readability across different libraries"? vim: alt+shift+arrays, phpstorm alt+arrows ;)

its just not a matter of personal preferences, its a matter of a common sense, correct formatting is done by some tools or your ide itself

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

yes, i rate usability higher than some ability with 3rd party libs, also you can see that there a lot of such decisions and PR in Yii2 where usability is higher then some other PSR. And you proposing to use 3-4 buttons for simple browsing? I dont like it, also remember that you can simply push some other button and consequences can be awful. How long you were using Yii? It looks like you just came and want to do everything right.

Contributor

Ragazzo commented Mar 14, 2014

yes, i rate usability higher than some ability with 3rd party libs, also you can see that there a lot of such decisions and PR in Yii2 where usability is higher then some other PSR. And you proposing to use 3-4 buttons for simple browsing? I dont like it, also remember that you can simply push some other button and consequences can be awful. How long you were using Yii? It looks like you just came and want to do everything right.

@joseph-kuruvilla

This comment has been minimized.

Show comment
Hide comment
@joseph-kuruvilla

joseph-kuruvilla Mar 14, 2014

Contributor

Vote for PSR-2

Contributor

joseph-kuruvilla commented Mar 14, 2014

Vote for PSR-2

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

yes i came by from a psrX world, where this discussion ended a few years ago in favor of a common sense ;)

yes i came by from a psrX world, where this discussion ended a few years ago in favor of a common sense ;)

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

so, @digitalkaoz you was not using Yii and just forcing idea of spaces here, right? Do you understand that there are a lot of Yii1 and Yii2 (already) projects that use tabs, and a lot of Yii developers that already use and prefere to use tabs, and now you are just suggesting them to forget everything and support a lot of projects with new formatting?
I dont think that it is good. However as you can see Yii2 has some things from PSR-2, the only thing Yii does not have is spaces, well this is for historical reasons. So i think we should first listen for developers that were using Yii for some long time, and not switching right now. Note that with IDE you will have some problem by supporting old and new Yii projects with tabs and spaces, you will need to make IDE remember 2-3 desktop settings and switch between them each time.
The thing here is that you should adopt fw style, because you use it, and not suggeting to build everything from the ground.

Contributor

Ragazzo commented Mar 14, 2014

so, @digitalkaoz you was not using Yii and just forcing idea of spaces here, right? Do you understand that there are a lot of Yii1 and Yii2 (already) projects that use tabs, and a lot of Yii developers that already use and prefere to use tabs, and now you are just suggesting them to forget everything and support a lot of projects with new formatting?
I dont think that it is good. However as you can see Yii2 has some things from PSR-2, the only thing Yii does not have is spaces, well this is for historical reasons. So i think we should first listen for developers that were using Yii for some long time, and not switching right now. Note that with IDE you will have some problem by supporting old and new Yii projects with tabs and spaces, you will need to make IDE remember 2-3 desktop settings and switch between them each time.
The thing here is that you should adopt fw style, because you use it, and not suggeting to build everything from the ground.

@subdee

This comment has been minimized.

Show comment
Hide comment
@subdee

subdee Mar 14, 2014

Contributor

Noone is forcing anyone to do anything. Many members of great PHP projects have already accepted a standard as a way to have interoperability. It is nice to have a community that agrees on some standards that would make developer's lives easier.

The argument about Yii1 is completely irrelevant. Whoever has started a project in Yii2 should've known about the risks of starting a project with a framework that is in Alpha still. Also, suggesting that just because someone hasn't used Yii since day one, doesn't have a say in this, gives a very bad image about the Yii community in general.

Contributor

subdee commented Mar 14, 2014

Noone is forcing anyone to do anything. Many members of great PHP projects have already accepted a standard as a way to have interoperability. It is nice to have a community that agrees on some standards that would make developer's lives easier.

The argument about Yii1 is completely irrelevant. Whoever has started a project in Yii2 should've known about the risks of starting a project with a framework that is in Alpha still. Also, suggesting that just because someone hasn't used Yii since day one, doesn't have a say in this, gives a very bad image about the Yii community in general.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

yes i am dont prejudiced against yii, but not using a common sense in the php world just sounds insane to me. its like being stuck in old paradigms

yes i am dont prejudiced against yii, but not using a common sense in the php world just sounds insane to me. its like being stuck in old paradigms

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

@digitalkaoz so you telling me that all developers switched to spaces and none use tabs? really? what common sence are you talking about? Afaik there always will be 2 points: tabs vs spaces. And since you are not using Yii and dont know its workflow you are trying to force here PSR-2. That is not good. Well as i said, i am against it, but not for me to decide ofcourse, but all this last Yii2 changes just guide fw to some madness.

Contributor

Ragazzo commented Mar 14, 2014

@digitalkaoz so you telling me that all developers switched to spaces and none use tabs? really? what common sence are you talking about? Afaik there always will be 2 points: tabs vs spaces. And since you are not using Yii and dont know its workflow you are trying to force here PSR-2. That is not good. Well as i said, i am against it, but not for me to decide ofcourse, but all this last Yii2 changes just guide fw to some madness.

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Mar 14, 2014

Contributor

+1 for switching to PSR-2 ...

@Ragazzo What's the big deal about switching to spaces for a project once? Just run a formatter.
It is really annoying, that Yii 2 is practically the only project in your vendor folder which uses tabs rather than spaces.

There was a 50/50 chance for tabs vs. spaces in the standard, which is very widely accepted in the PHP world now. I didn't analyze ist, but I'd estimate 90% of extensions on packagist are using spaces.

Contributor

schmunk42 commented Mar 14, 2014

+1 for switching to PSR-2 ...

@Ragazzo What's the big deal about switching to spaces for a project once? Just run a formatter.
It is really annoying, that Yii 2 is practically the only project in your vendor folder which uses tabs rather than spaces.

There was a 50/50 chance for tabs vs. spaces in the standard, which is very widely accepted in the PHP world now. I didn't analyze ist, but I'd estimate 90% of extensions on packagist are using spaces.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

PSR-2 is a common sense, just to make php code almost the same style in every project, so our brains just dont have to fiddle around in which library we are editing right now...and yes i havent seen tabs for long time... what does a coding style has todo with a workflow of things? i have to use yii in a future project, and wondered when i started to dig into the code...

PSR-2 is a common sense, just to make php code almost the same style in every project, so our brains just dont have to fiddle around in which library we are editing right now...and yes i havent seen tabs for long time... what does a coding style has todo with a workflow of things? i have to use yii in a future project, and wondered when i started to dig into the code...

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

@schmunk42 running formatter is such a pain) also extensions should follow main fw codestyle as you know.

@digitalkaoz yeah, i read that guide, as i said i dont like attributes splitting and other things. Anyway not for me to decide.

Also what about switching Yii1 to PSR-2 then? Dont see good reasons against it, why not?))

Contributor

Ragazzo commented Mar 14, 2014

@schmunk42 running formatter is such a pain) also extensions should follow main fw codestyle as you know.

@digitalkaoz yeah, i read that guide, as i said i dont like attributes splitting and other things. Anyway not for me to decide.

Also what about switching Yii1 to PSR-2 then? Dont see good reasons against it, why not?))

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 14, 2014

Member

@digitalkaoz

yes i came by from a psrX world, where this discussion ended a few years ago in favor of a common sense ;)

That's not entirely true. Tabs vs spaces discussion on PSR mailing list never ended. People just got tired and voted to accept something since it was clear there will be no 100% agreement. Many people from php-fig including me think PSR-2 is not perfect.

Member

samdark commented Mar 14, 2014

@digitalkaoz

yes i came by from a psrX world, where this discussion ended a few years ago in favor of a common sense ;)

That's not entirely true. Tabs vs spaces discussion on PSR mailing list never ended. People just got tired and voted to accept something since it was clear there will be no 100% agreement. Many people from php-fig including me think PSR-2 is not perfect.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 14, 2014

Member

Also what about switching Yii1 to PSR-2 then? Dont see good reasons against it, why not?))

It's already stable. That would be very bad timing while for 2.0 it is still possible.

Member

samdark commented Mar 14, 2014

Also what about switching Yii1 to PSR-2 then? Dont see good reasons against it, why not?))

It's already stable. That would be very bad timing while for 2.0 it is still possible.

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Mar 14, 2014

Contributor

@schmunk42 running formatter is such a pain) also extensions should follow main fw codestyle as you know.

Try https://github.com/fabpot/PHP-CS-Fixer and yes, that's why the FW should change here ;)

@samdark Correct. If the decision for the PHP world would have been tabs, I'd be using tabs now.

Contributor

schmunk42 commented Mar 14, 2014

@schmunk42 running formatter is such a pain) also extensions should follow main fw codestyle as you know.

Try https://github.com/fabpot/PHP-CS-Fixer and yes, that's why the FW should change here ;)

@samdark Correct. If the decision for the PHP world would have been tabs, I'd be using tabs now.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

you never get every person to fully agree with some opinions of others. but at least we had a decision.

i am against changing it for 1.x but for 2.x it really makes sense i think

you never get every person to fully agree with some opinions of others. but at least we had a decision.

i am against changing it for 1.x but for 2.x it really makes sense i think

@lucianobaraglia

This comment has been minimized.

Show comment
Hide comment
@lucianobaraglia

lucianobaraglia Mar 14, 2014

Contributor

+1 For keeping tabs

What people keep saying that using spaces is common sense?
Tabs allows developer to configure the ide to show any desired width.
Tabs means smaller file size.

What if "standards" changes and tell you that you should use 3 spaces instead? Good luck with that!

Contributor

lucianobaraglia commented Mar 14, 2014

+1 For keeping tabs

What people keep saying that using spaces is common sense?
Tabs allows developer to configure the ide to show any desired width.
Tabs means smaller file size.

What if "standards" changes and tell you that you should use 3 spaces instead? Good luck with that!

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

fixing code formatting against a ruleset, is a matter of minutes nowadays...

spaces makes it readable the same on every device with every software out of the box, so its just a matter readability not a matter of personal preferences

fixing code formatting against a ruleset, is a matter of minutes nowadays...

spaces makes it readable the same on every device with every software out of the box, so its just a matter readability not a matter of personal preferences

@mikehaertl

This comment has been minimized.

Show comment
Hide comment
@mikehaertl

mikehaertl Mar 14, 2014

Contributor

+1 for spaces.

Spaces are de-facto standard in PHP back since (I think?) 1998 when PEAR was born. And the advantages are self-evident: Spaces are unambiguous. A space is a space is a space. A tab can be everything. Given that we mix more and more foreign libraries into our projects it's a real pain to switch back and forth between standards.

And the real danger is, when you start mixing tabs with spaces (often without notice).

Contributor

mikehaertl commented Mar 14, 2014

+1 for spaces.

Spaces are de-facto standard in PHP back since (I think?) 1998 when PEAR was born. And the advantages are self-evident: Spaces are unambiguous. A space is a space is a space. A tab can be everything. Given that we mix more and more foreign libraries into our projects it's a real pain to switch back and forth between standards.

And the real danger is, when you start mixing tabs with spaces (often without notice).

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Mar 14, 2014

Contributor

@lucianobaraglia

What people keep saying that using spaces is common sense?

It is not about pro-contra features, it's just about having the same standard across the PHP world.

What if "standards" changes and tell you that you should use 3 spaces instead?

The purpose of a standard is, that these things don't change all the time!

Contributor

schmunk42 commented Mar 14, 2014

@lucianobaraglia

What people keep saying that using spaces is common sense?

It is not about pro-contra features, it's just about having the same standard across the PHP world.

What if "standards" changes and tell you that you should use 3 spaces instead?

The purpose of a standard is, that these things don't change all the time!

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 14, 2014

Contributor

don't change all the time!

@schmunk42 you are telling this in Yii2 repo? where in last week a lot of big BC breaks occured :D

Contributor

Ragazzo commented Mar 14, 2014

don't change all the time!

@schmunk42 you are telling this in Yii2 repo? where in last week a lot of big BC breaks occured :D

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 14, 2014

Member

@Ragazzo let's keep this discussion clean from offtopic please. BC breaks aren't relevant before stable release.

Member

samdark commented Mar 14, 2014

@Ragazzo let's keep this discussion clean from offtopic please. BC breaks aren't relevant before stable release.

@crisu83

This comment has been minimized.

Show comment
Hide comment
@crisu83

crisu83 Mar 14, 2014

I agree with @schmunk42. I think it should be a no-brainer to follow PSR-2.

crisu83 commented Mar 14, 2014

I agree with @schmunk42. I think it should be a no-brainer to follow PSR-2.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

and please lets focus on psr2, psr4 is another good thing, but thats already introduced :)

and please lets focus on psr2, psr4 is another good thing, but thats already introduced :)

@mgrechanik

This comment has been minimized.

Show comment
Hide comment
@mgrechanik

mgrechanik Mar 14, 2014

Contributor

+1 for psr 2

Contributor

mgrechanik commented Mar 14, 2014

+1 for psr 2

@klevron

This comment has been minimized.

Show comment
Hide comment
@klevron

klevron Mar 14, 2014

Contributor

From @qiangxue in #9 :

Let's not bring up the war between tabs and spaces again

👍

@samdark

People just got tired and voted to accept something since it was clear there will be no 100% agreement

👍

This has already been discussed... I usually prefer tabs, but I don't really care : I contribute (I am forced, sometimes) on some projects which use psr2 or 4, but with 90% of shit code... I mean CS will not always make the code better, just more readable (I don't mean it is not useful)...

Contributor

klevron commented Mar 14, 2014

From @qiangxue in #9 :

Let's not bring up the war between tabs and spaces again

👍

@samdark

People just got tired and voted to accept something since it was clear there will be no 100% agreement

👍

This has already been discussed... I usually prefer tabs, but I don't really care : I contribute (I am forced, sometimes) on some projects which use psr2 or 4, but with 90% of shit code... I mean CS will not always make the code better, just more readable (I don't mean it is not useful)...

@theill11

This comment has been minimized.

Show comment
Hide comment
@theill11

theill11 Mar 14, 2014

Contributor

I'm for tabs.. It is easy to configure in an IDE to suit your needs.
Also it is more easy to navigate imo.

Contributor

theill11 commented Mar 14, 2014

I'm for tabs.. It is easy to configure in an IDE to suit your needs.
Also it is more easy to navigate imo.

@digitalkaoz

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 14, 2014

its not tabs vs spaces, it about following a defacto php standard

its not tabs vs spaces, it about following a defacto php standard

@gonimar

This comment has been minimized.

Show comment
Hide comment
@gonimar

gonimar Mar 14, 2014

Contributor

Vote for spaces

Contributor

gonimar commented Mar 14, 2014

Vote for spaces

@motin

This comment has been minimized.

Show comment
Hide comment
@motin

motin Mar 14, 2014

I agree with @schmunk42, @crisu83 and others - following standards is the way to go. For those that are worried about IDE support, you should understand that standards will be the best supported in the long run.

motin commented Mar 14, 2014

I agree with @schmunk42, @crisu83 and others - following standards is the way to go. For those that are worried about IDE support, you should understand that standards will be the best supported in the long run.

@tonydspaniard

This comment has been minimized.

Show comment
Hide comment
@tonydspaniard

tonydspaniard Mar 14, 2014

Contributor

If the decision for the PHP world would have been tabs, I'd be using tabs now.

Tabs vs spaces discussion on PSR mailing list never ended

IMHO all of you are right and have good reasons to pursue one way or the other. But I would also vote for standards.

Contributor

tonydspaniard commented Mar 14, 2014

If the decision for the PHP world would have been tabs, I'd be using tabs now.

Tabs vs spaces discussion on PSR mailing list never ended

IMHO all of you are right and have good reasons to pursue one way or the other. But I would also vote for standards.

@tom--

This comment has been minimized.

Show comment
Hide comment
@tom--

tom-- Mar 14, 2014

Contributor

+1 for PSR-2 and spaces

Contributor

tom-- commented Mar 14, 2014

+1 for PSR-2 and spaces

@PrplHaz4

This comment has been minimized.

Show comment
Hide comment
@PrplHaz4

PrplHaz4 Mar 14, 2014

+1 for PSR-2 standards support - not looking forward to changing everything over to spaces, but it is the lowest common denominator when it comes to indentation, and it seems if we're going to deviate from standards, it makes more sense to save it for something that is more worthwhile than tabs vs spaces.

Yii2 also has a lot more community involvement than Yii1 - meaning standards will have more of an impact on community contributions and quality (ie, getting pull requests right the first time)

+1 for PSR-2 standards support - not looking forward to changing everything over to spaces, but it is the lowest common denominator when it comes to indentation, and it seems if we're going to deviate from standards, it makes more sense to save it for something that is more worthwhile than tabs vs spaces.

Yii2 also has a lot more community involvement than Yii1 - meaning standards will have more of an impact on community contributions and quality (ie, getting pull requests right the first time)

@klimov-paul

This comment has been minimized.

Show comment
Hide comment
@klimov-paul

klimov-paul Mar 14, 2014

Member

I am for spaces usage, I have spoken my arguments back in #9.

In addition to those I can say following.
I have to work both with Yii code style which uses tabs and my company code style, which is uses spaces.
So to make sure code matching particular standard I have no choice but always enable "show whitespaces" in my IDE.

This is how it look with tabs:
tabs

And this is the same file with spaces:
spaces

My opinion latest is more pleasant.

Member

klimov-paul commented Mar 14, 2014

I am for spaces usage, I have spoken my arguments back in #9.

In addition to those I can say following.
I have to work both with Yii code style which uses tabs and my company code style, which is uses spaces.
So to make sure code matching particular standard I have no choice but always enable "show whitespaces" in my IDE.

This is how it look with tabs:
tabs

And this is the same file with spaces:
spaces

My opinion latest is more pleasant.

@mastermunj

This comment has been minimized.

Show comment
Hide comment
@mastermunj

mastermunj Mar 14, 2014

Though I am not frequent contributor, I regularly use Yii & follow Yii2 development religiously. Lately I've also realized that following PSR standards is better than having custom one. It's not about superiority, but about following a standard followed by mass.

I vote for PSR standards.

Though I am not frequent contributor, I regularly use Yii & follow Yii2 development religiously. Lately I've also realized that following PSR standards is better than having custom one. It's not about superiority, but about following a standard followed by mass.

I vote for PSR standards.

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Mar 15, 2014

Contributor

Trend as of 15.03.2014 - 18:18

Vote for PSR-2 (spaces) - 20 votes

nineinchnick
subdee
joseph-kuruvilla
digitalkaoz
mikehaertl
schmunk42
Crisu83
mgrechanik
gonimar
motin
tonydspaniard
tom--
PrplHaz4
klimov-paul
mastermunj
domokun-san
index0h
loloroboros
kotslon
andersonamuller

Vote for exisiting Yii standard (tabs) - 3 votes

lucianobaraglia
Ragazzo
Theill11

Contributor

schmunk42 commented Mar 15, 2014

Trend as of 15.03.2014 - 18:18

Vote for PSR-2 (spaces) - 20 votes

nineinchnick
subdee
joseph-kuruvilla
digitalkaoz
mikehaertl
schmunk42
Crisu83
mgrechanik
gonimar
motin
tonydspaniard
tom--
PrplHaz4
klimov-paul
mastermunj
domokun-san
index0h
loloroboros
kotslon
andersonamuller

Vote for exisiting Yii standard (tabs) - 3 votes

lucianobaraglia
Ragazzo
Theill11

@SonicGD

This comment has been minimized.

Show comment
Hide comment
@SonicGD

SonicGD Mar 15, 2014

Contributor

+1 for PSR-2. I also prefer tabs, but framework should follow standard.

Contributor

SonicGD commented Mar 15, 2014

+1 for PSR-2. I also prefer tabs, but framework should follow standard.

@slavcodev

This comment has been minimized.

Show comment
Hide comment
@slavcodev

slavcodev Mar 15, 2014

Contributor

+1 for PSR-2

Contributor

slavcodev commented Mar 15, 2014

+1 for PSR-2

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 16, 2014

Member

Let's go for PSR-2. Can someone create a PR for this with the latest code? Thanks!

Member

qiangxue commented Mar 16, 2014

Let's go for PSR-2. Can someone create a PR for this with the latest code? Thanks!

@qiangxue qiangxue added this to the 2.0 Beta milestone Mar 16, 2014

@lucianobaraglia

This comment has been minimized.

Show comment
Hide comment
@lucianobaraglia

lucianobaraglia Mar 16, 2014

Contributor

The majority is overwhelming.
Even though I don't like spaces, it seems the right way to go...

👍

Hope in the future the standard changes...

Contributor

lucianobaraglia commented Mar 16, 2014

The majority is overwhelming.
Even though I don't like spaces, it seems the right way to go...

👍

Hope in the future the standard changes...

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@schmunk42

schmunk42 Mar 16, 2014

Contributor

@qiangxue Great! Thank you very much.

Contributor

schmunk42 commented Mar 16, 2014

@qiangxue Great! Thank you very much.

@qiangxue qiangxue closed this Mar 16, 2014

samdark added a commit to yiisoft/yii2-coding-standards that referenced this issue Mar 17, 2014

@iJackUA

This comment has been minimized.

Show comment
Hide comment
@iJackUA

iJackUA Mar 17, 2014

Contributor

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

Contributor

iJackUA commented Mar 17, 2014

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

@schmunk42

This comment has been minimized.

Show comment
Hide comment
@iJackUA

This comment has been minimized.

Show comment
Hide comment
@iJackUA

iJackUA Mar 17, 2014

Contributor

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

Contributor

iJackUA commented Mar 17, 2014

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

@maximal

This comment has been minimized.

Show comment
Hide comment
@maximal

maximal Mar 17, 2014

Contributor

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.

Contributor

maximal commented Mar 17, 2014

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

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 17, 2014

Member

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

Member

samdark commented Mar 17, 2014

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

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Mar 17, 2014

Member

@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...

Member

cebe commented Mar 17, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 17, 2014

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

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

@maximal

This comment has been minimized.

Show comment
Hide comment
@maximal

maximal Mar 17, 2014

Contributor

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.

Contributor

maximal commented Mar 17, 2014

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

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 17, 2014

Member

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

Member

samdark commented Mar 17, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 17, 2014

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

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

@maximal

This comment has been minimized.

Show comment
Hide comment
@maximal

maximal Mar 17, 2014

Contributor

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

http://www.emacswiki.org/SmartTabs

Contributor

maximal commented Mar 17, 2014

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

http://www.emacswiki.org/SmartTabs

@tom--

This comment has been minimized.

Show comment
Hide comment
@tom--

tom-- Mar 17, 2014

Contributor

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.

Contributor

tom-- commented Mar 17, 2014

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

This comment has been minimized.

Show comment
Hide comment
@digitalkaoz

digitalkaoz Mar 17, 2014

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

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

@plandem

This comment has been minimized.

Show comment
Hide comment
@plandem

plandem Mar 17, 2014

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 :)

plandem commented Mar 17, 2014

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

This comment has been minimized.

Show comment
Hide comment
@maximal

maximal Mar 18, 2014

Contributor

Sorry, but one more try.

Tabs advantages:

  • Tabs are designed to be an indentation character.
  • Tabs can be configured to have different width.
  • Tabs keep source code size meaningful, not exaggerating characters count by 4-times with meaningless whitespace characters. With tabs, 5k file, say, is 4k source and 1k whitespace. With spaces, 5k file is 1-2 source and 4-3 k whitespace.
  • Many IDEs do the smart-tabbing automatically, making this approach transparent and clean.

Spaces advantages:

  • Code looks the same in different editors.
  • Any more? (Disregarding that they are standard, only logical and usability points).

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.

Contributor

maximal commented Mar 18, 2014

Sorry, but one more try.

Tabs advantages:

  • Tabs are designed to be an indentation character.
  • Tabs can be configured to have different width.
  • Tabs keep source code size meaningful, not exaggerating characters count by 4-times with meaningless whitespace characters. With tabs, 5k file, say, is 4k source and 1k whitespace. With spaces, 5k file is 1-2 source and 4-3 k whitespace.
  • Many IDEs do the smart-tabbing automatically, making this approach transparent and clean.

Spaces advantages:

  • Code looks the same in different editors.
  • Any more? (Disregarding that they are standard, only logical and usability points).

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

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 18, 2014

Member

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

Member

samdark commented Mar 18, 2014

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

@maximal

This comment has been minimized.

Show comment
Hide comment
@maximal

maximal Mar 18, 2014

Contributor

@samdark, thank you, Alexander.

Contributor

maximal commented Mar 18, 2014

@samdark, thank you, Alexander.

@lucianobaraglia

This comment has been minimized.

Show comment
Hide comment
@lucianobaraglia

lucianobaraglia Mar 18, 2014

Contributor

@maximal 👍 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?

Contributor

lucianobaraglia commented Mar 18, 2014

@maximal 👍 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

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Mar 18, 2014

Member

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

Member

samdark commented Mar 18, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@maximal

maximal Mar 18, 2014

Contributor

@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/.

Contributor

maximal commented Mar 18, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@lucianobaraglia

lucianobaraglia Mar 18, 2014

Contributor

@maximal spaces dinosaurs still rule the Earth... 😐

Contributor

lucianobaraglia commented Mar 18, 2014

@maximal spaces dinosaurs still rule the Earth... 😐

@kotslon

This comment has been minimized.

Show comment
Hide comment
@kotslon

kotslon Mar 18, 2014

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...

kotslon commented Mar 18, 2014

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

This comment has been minimized.

Show comment
Hide comment
@alpharder

alpharder Mar 18, 2014

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

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

@rawtaz

This comment has been minimized.

Show comment
Hide comment
@rawtaz

rawtaz Apr 20, 2014

Contributor

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.

Contributor

rawtaz commented Apr 20, 2014

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

This comment has been minimized.

Show comment
Hide comment
@rawtaz

rawtaz Apr 20, 2014

Contributor

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

Contributor

rawtaz commented Apr 20, 2014

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

@rawtaz

This comment has been minimized.

Show comment
Hide comment
@rawtaz

rawtaz Apr 20, 2014

Contributor

@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.

Contributor

rawtaz commented Apr 20, 2014

@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.

@armab

This comment has been minimized.

Show comment
Hide comment
@armab

armab Apr 20, 2014

Contributor

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.

Contributor

armab commented Apr 20, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment