PS-3-Standard for best practice #56

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
10 participants
@TiMESPLiNTER

I wrote a new PSR-3 standard to propose the best practice for some php related coding things.

@teplyakoff

This comment has been minimized.

Show comment Hide comment
@teplyakoff

teplyakoff Nov 8, 2012

May be 'Standard' and 'Best practice' are different things?

May be 'Standard' and 'Best practice' are different things?

@TiMESPLiNTER

This comment has been minimized.

Show comment Hide comment
@TiMESPLiNTER

TiMESPLiNTER Nov 8, 2012

Good question... I don't know... for me it's "nice code" because it smplifys code overview and logic. It belongs to the repo admins what they do with my proposal...

Good question... I don't know... for me it's "nice code" because it smplifys code overview and logic. It belongs to the repo admins what they do with my proposal...

@Incognito

This comment has been minimized.

Show comment Hide comment
@Incognito

Incognito Nov 8, 2012

This looks out-of-scope.

👎

Most of what I can see in all of the PSRs focus on code style guides such as whitespace, and name conventions. This is suggesting a way to use calls and in what order and under what conditions.

I'm unsure what motivation you have for this. It might be because you want only one return part in the code to return output, but my feeling is that's more about architecture of a specific code problem than it is readability and a common coding style between frameworks.

This looks out-of-scope.

👎

Most of what I can see in all of the PSRs focus on code style guides such as whitespace, and name conventions. This is suggesting a way to use calls and in what order and under what conditions.

I'm unsure what motivation you have for this. It might be because you want only one return part in the code to return output, but my feeling is that's more about architecture of a specific code problem than it is readability and a common coding style between frameworks.

@TiMESPLiNTER

This comment has been minimized.

Show comment Hide comment
@TiMESPLiNTER

TiMESPLiNTER Nov 8, 2012

Well I like to know what I expect from a framework which follows the PSR standard also in how the framework sends output to the browser. With this proposal not to use output-buffer and return the output at one specific point in the framework I can be sure nowhere else is output sent to the browser than in one specified method.

Well I like to know what I expect from a framework which follows the PSR standard also in how the framework sends output to the browser. With this proposal not to use output-buffer and return the output at one specific point in the framework I can be sure nowhere else is output sent to the browser than in one specified method.

@Incognito

This comment has been minimized.

Show comment Hide comment
@Incognito

Incognito Nov 8, 2012

Would you suggest psr should also mandate full OOP, DI, and a DBAL?

On 11/8/12, Pascal notifications@github.com wrote:

Well I like to know what I expect from a framework which follows the PSR
standard also in how the framework sends output to the browser. With this
proposal not to use output-buffer and return the output at one specific
point in the framework I can be sure nowhere else is output sent to the
browser than in one specified method.


Reply to this email directly or view it on GitHub:
#56 (comment)

-Brian G.

Would you suggest psr should also mandate full OOP, DI, and a DBAL?

On 11/8/12, Pascal notifications@github.com wrote:

Well I like to know what I expect from a framework which follows the PSR
standard also in how the framework sends output to the browser. With this
proposal not to use output-buffer and return the output at one specific
point in the framework I can be sure nowhere else is output sent to the
browser than in one specified method.


Reply to this email directly or view it on GitHub:
#56 (comment)

-Brian G.

@TiMESPLiNTER

This comment has been minimized.

Show comment Hide comment
@TiMESPLiNTER

TiMESPLiNTER Nov 9, 2012

Don't know what DI stands for. But OOP definitely yes. I mean a framework with OOP and one in procedural style are heavily compatible. Or you say there are standards for procedural frameworks and for OOP ones. DBAL I'm not sure about. It makes a framework very heavy and complex and in my opinion it's not a must for a framework that it has to provide DBAL out of the box.

I mean for someone who want's to write a simple lightweight framework which probably never uses a DB it's an obstacle. (I know it's most of the time unlikely to not use a DB today.)

Don't know what DI stands for. But OOP definitely yes. I mean a framework with OOP and one in procedural style are heavily compatible. Or you say there are standards for procedural frameworks and for OOP ones. DBAL I'm not sure about. It makes a framework very heavy and complex and in my opinion it's not a must for a framework that it has to provide DBAL out of the box.

I mean for someone who want's to write a simple lightweight framework which probably never uses a DB it's an obstacle. (I know it's most of the time unlikely to not use a DB today.)

@Incognito

This comment has been minimized.

Show comment Hide comment
@Incognito

Incognito Nov 9, 2012

I'm all for best practices but again I have to say this sounds out-of-scope for what the PSRs are. You're talking about standards for best practices in an architecture sense, which even if decided upon there's likely to be many cases where we want to break those rules (as happens in standard development). Eventually rather than having all code look the same, we'll end up in a place where we only use one framework one way, or we might end up looking like Java.

My thoughts are that best practices are great, but architecture mandates don't fit into a style guide.

I'm all for best practices but again I have to say this sounds out-of-scope for what the PSRs are. You're talking about standards for best practices in an architecture sense, which even if decided upon there's likely to be many cases where we want to break those rules (as happens in standard development). Eventually rather than having all code look the same, we'll end up in a place where we only use one framework one way, or we might end up looking like Java.

My thoughts are that best practices are great, but architecture mandates don't fit into a style guide.

@sebinsua

This comment has been minimized.

Show comment Hide comment
@sebinsua

sebinsua Nov 9, 2012

I agree with @Incognito that this shouldn't be in scope for PSRs. Although it should be pointed out that there doesn't yet exist a bylaw that explains the scope of the PSR system.

I do think it would be a good idea to create something very like the The Zen of Python but for PHP? ...The Zen of PHP. However I think it would better fit in a project such as PHP The Right Way.

sebinsua commented Nov 9, 2012

I agree with @Incognito that this shouldn't be in scope for PSRs. Although it should be pointed out that there doesn't yet exist a bylaw that explains the scope of the PSR system.

I do think it would be a good idea to create something very like the The Zen of Python but for PHP? ...The Zen of PHP. However I think it would better fit in a project such as PHP The Right Way.

@philsturgeon

This comment has been minimized.

Show comment Hide comment
@philsturgeon

philsturgeon Jan 3, 2013

Contributor

I'd say this is massively out of scope and I would like to see it closed.

This is exactly what PHP The Right Way is for.

Contributor

philsturgeon commented Jan 3, 2013

I'd say this is massively out of scope and I would like to see it closed.

This is exactly what PHP The Right Way is for.

@dragoonis

This comment has been minimized.

Show comment Hide comment
@dragoonis

dragoonis Jan 4, 2013

Member

If a second voting member agrees that this should be closed then we can do it.

Member

dragoonis commented Jan 4, 2013

If a second voting member agrees that this should be closed then we can do it.

@deminy

This comment has been minimized.

Show comment Hide comment
@deminy

deminy Jan 9, 2013

I won't suggest to include this into the PSR system. There are many (built-in) features/extensions in PHP like output control, should we define best practices in PSR for each of those features/extensions?

Besides that, the proposal suggested might be good for most cases, but not always. Suppose a service is going to write 2GB data back to the client (no matter if the data is from a server-side file or a server-side resource), should PHP code hold all data (and concatenate it) into a PHP variable before sending it back? I doubt it.

-1

deminy commented Jan 9, 2013

I won't suggest to include this into the PSR system. There are many (built-in) features/extensions in PHP like output control, should we define best practices in PSR for each of those features/extensions?

Besides that, the proposal suggested might be good for most cases, but not always. Suppose a service is going to write 2GB data back to the client (no matter if the data is from a server-side file or a server-side resource), should PHP code hold all data (and concatenate it) into a PHP variable before sending it back? I doubt it.

-1

@philsturgeon

This comment has been minimized.

Show comment Hide comment
@philsturgeon

philsturgeon Jan 9, 2013

Contributor

I've not heard of a system trying to log 2GB of data in one go. How would you suggest this interface should change to help this?

Sent from my iPhone

On Jan 8, 2013, at 9:08 PM, Demin Yin notifications@github.com wrote:

I won't suggest to include this into the PSR system. There are many (built-in) features/extensions in PHP like output control, should we define best practices in PSR for each of those features/extensions?

Besides that, the proposal suggested might be good for most cases, but not always. Suppose a service is going to write 2GB data back to the client (no matter if the data is from a server-side file or a server-side resource), should PHP code hold all data (and concatenate it) into a PHP variable before sending it back? I doubt it.

-1


Reply to this email directly or view it on GitHub.

Contributor

philsturgeon commented Jan 9, 2013

I've not heard of a system trying to log 2GB of data in one go. How would you suggest this interface should change to help this?

Sent from my iPhone

On Jan 8, 2013, at 9:08 PM, Demin Yin notifications@github.com wrote:

I won't suggest to include this into the PSR system. There are many (built-in) features/extensions in PHP like output control, should we define best practices in PSR for each of those features/extensions?

Besides that, the proposal suggested might be good for most cases, but not always. Suppose a service is going to write 2GB data back to the client (no matter if the data is from a server-side file or a server-side resource), should PHP code hold all data (and concatenate it) into a PHP variable before sending it back? I doubt it.

-1


Reply to this email directly or view it on GitHub.

@KingCrunch

This comment has been minimized.

Show comment Hide comment
@KingCrunch

KingCrunch Feb 10, 2013

👎

👎

@jayzeng

This comment has been minimized.

Show comment Hide comment
@jayzeng

jayzeng Feb 10, 2013

These are "perhaps" best practices for your organizations, but I don't see how they can become standard or generate best practices for the community.

jayzeng commented Feb 10, 2013

These are "perhaps" best practices for your organizations, but I don't see how they can become standard or generate best practices for the community.

@skyzyx

This comment has been minimized.

Show comment Hide comment
@skyzyx

skyzyx Feb 27, 2013

Contributor

I am a voting member, and I agree that this should be closed.

@dragoonis, go for it.

Contributor

skyzyx commented Feb 27, 2013

I am a voting member, and I agree that this should be closed.

@dragoonis, go for it.

@dragoonis

This comment has been minimized.

Show comment Hide comment
@dragoonis

dragoonis Feb 27, 2013

Member

Since multiple people have conveyed that this is clearly out of scope and not suited for the FIG group, it's closed.

Thanks for your efforts @TiMESPLiNTER

Member

dragoonis commented Feb 27, 2013

Since multiple people have conveyed that this is clearly out of scope and not suited for the FIG group, it's closed.

Thanks for your efforts @TiMESPLiNTER

@dragoonis dragoonis closed this Feb 27, 2013

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