Welcome Guest, Not a member yet? Register   Sign In
Poll: Improved routing?
You do not have permission to vote in this poll.
yes
82.98%
39 82.98%
no
8.51%
4 8.51%
maybe
8.51%
4 8.51%
Total 47 vote(s) 100%
* You voted for this item. [Show Results]

Magic Routing toggle
#25

(07-11-2015, 06:39 PM)PaulD Wrote: The controller/method system has been a really limiting pain for me recently and setting routes manually seems like a really exciting idea. I really hope that gets implemented in CI4.

So, set your routes manually. Really, the only thing disabling magic routing would do is prevent routes from being created for you automatically. Regardless of whether this is ever implemented, you can still manually create and block routes in your config/routes.php file.


(07-11-2015, 06:39 PM)PaulD Wrote: As for BC, if it can be done to add a toggle to turn back on the method controller routing, then that is fine, but it should be off by default and if it cannot be done, so be it. Along with sv3tli0 and skunkbad, I think BC should be the afterthought, not the driving factor. Besides, I like the idea of all the extra billing from rewriting old apps :-)

Backwards compatibility rarely works (and always takes extra effort) if it is an afterthought. It usually works better and often takes less extra effort (or no extra effort) if it is considered a priority from the start. Configuring it to not do magic routing by default is a minor thing, easily handled with a quick mention in the upgrade notes. Rewriting the routing code so "magic" routing can't be done at all just seems like a waste of effort, since that code has already been written and well-tested.

Even if I could make some extra money from rewriting old apps, I hate doing busy-work, which is one of the reasons I became a developer in the first place. I'd probably forward-port the "magic" routing code rather than write out 130+ routes that just map a URI segment to a controller of the same name. I renamed all of my controller files to go from CI2 to CI3, but I didn't do it by hand...

It usually takes less effort to consider backwards compatibility up front than to bolt it on as an afterthought. Plus the code is already working and fairly well-tested, so why re-write the code to remove a feature when all someone asked for was the ability to disable it?

Besides, even with an upgrade that has perfect backwards compatibility, it's pretty likely that most customers would want a developer familiar with the code base to oversee the upgrade. I'd rather have a short, easy job that goes smoothly for everyone than have my customer/employer and myself pulling our hair out because someone decided it was better to hard-code every route than do a simple file lookup based on an easy-to-predict pattern.
Reply


Messages In This Thread
Magic Routing toggle - by albertleao - 04-06-2015, 08:04 PM
RE: Magic Routing toggle - by orionstar - 04-07-2015, 03:39 AM
RE: Magic Routing toggle - by includebeer - 04-07-2015, 04:50 PM
RE: Magic Routing toggle - by albertleao - 04-08-2015, 09:04 AM
RE: Magic Routing toggle - by gadelat - 04-08-2015, 12:11 AM
RE: Magic Routing toggle - by Hobbes - 04-09-2015, 01:04 PM
RE: Magic Routing toggle - by includebeer - 04-11-2015, 04:05 PM
RE: Magic Routing toggle - by dmyers - 04-13-2015, 07:34 AM
RE: Magic Routing toggle - by sv3tli0 - 04-12-2015, 04:26 AM
RE: Magic Routing toggle - by includebeer - 04-12-2015, 08:44 AM
RE: Magic Routing toggle - by ivantcholakov - 04-12-2015, 10:08 AM
RE: Magic Routing toggle - by sv3tli0 - 04-13-2015, 12:48 AM
RE: Magic Routing toggle - by dmyers - 04-13-2015, 02:02 PM
RE: Magic Routing toggle - by albert.freeman - 04-13-2015, 03:14 PM
RE: Magic Routing toggle - by albertleao - 04-13-2015, 09:11 PM
RE: Magic Routing toggle - by sv3tli0 - 04-13-2015, 11:55 PM
RE: Magic Routing toggle - by includebeer - 04-15-2015, 04:30 PM
RE: Magic Routing toggle - by albertleao - 04-15-2015, 04:33 PM
RE: Magic Routing toggle - by sv3tli0 - 04-15-2015, 10:23 PM
RE: Magic Routing toggle - by mwhitney - 05-11-2015, 09:52 AM
RE: Magic Routing toggle - by skunkbad - 04-15-2015, 08:52 PM
RE: Magic Routing toggle - by noah - 05-06-2015, 02:06 PM
RE: Magic Routing toggle - by PaulD - 07-11-2015, 06:39 PM
RE: Magic Routing toggle - by mwhitney - 07-13-2015, 11:58 AM
RE: Magic Routing toggle - by kenjis - 07-12-2015, 02:38 PM
RE: Magic Routing toggle - by PaulD - 01-25-2017, 05:29 PM
RE: Magic Routing toggle - by albertleao - 01-26-2017, 01:14 AM
RE: Magic Routing toggle - by PaulD - 01-26-2017, 11:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB