yiisoft / router

Router is a request matcher and URL generator
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Routing simplicity is gone #6

Closed lubosdz closed 5 years ago

lubosdz commented 5 years ago

I know there is a lot of efforts to "unify" routing management & follow so called best practices a la Symfony & Laravel .. , but after reviewing Yii3 implementation I have to acknowledge, that the beauty & simplicity of routing implementation of Yii1 & Yii2 - is simply gone. Learning curve has increased significantly. Sorry.

samdark commented 5 years ago

It is. Routing isn't final and we'll definitely have multiple attempts making it simpler.

samdark commented 5 years ago

@lubosdz there is a dedicated forum for design discussions: https://forum.yiiframework.com/c/yii-3-0/design-discussions btw.

hiqsol commented 5 years ago

Please don't make too fast conclusions. Yii team is and always was very open for discussion. I personally going to push routing until it is better and simpler then yii2. What I really want to tell you that anyone can influence it too. Emotional comment is interesting but you could be more constructive. For example I'm going to implement simple array based configuration over classes that @samdark is implementing right now. What exactly beauty and simplicity did you mean we're about to lose?

lubosdz commented 5 years ago

Aha, here is router specific discussion - precise link: https://forum.yiiframework.com/t/routing-preview-discussion/126177

That's cool, that ultimate goal would be "better & simpler routing than Yii2".

@hiqsol Design at Yii2 router is quite flexible and yet much simpler than PSR-7. I understand PSR-7 means exchangability and more general usage, but on the other hand it comes at the price of complexity. Complexity = costy. Implementing PSR-7 might become difficult for less experienced programmers without debugging (means spending unnecessary time on something what could work out of the box).

My rebelling opinion would be - assuming that more simple implementation cannot be achieved - not to follow PSR-7 and enhance original Yii2 implementation with minimum changes & maximum backward compatability. E.g. adding the most required enhancements ... Personally I find PSR-7 is over-conventioned & supressing developer's creativity. If I can find more time on my hands I will try to test Yii3 routing, perhaps some ideas will come up ... thanx guys, pls dont take my comments wrong, I know you do a great job :-)

samdark commented 5 years ago

Personally I find PSR-7 is over-conventioned & supressing developer's creativity

That's correct but it has good sides as well:

  1. Battle-tested implementations.
  2. You don't have to care about low level details.
  3. Compatible with alternative runners such as RoadRunner and Swoole out of the box.
  4. Easy to test.
  5. Compatible with Codeception out of the box.
  6. Many ready to use libraries out there.