Complexity of `Router.add` method


#1

Hey guys,
I’ve looked into this method Router.add method and it seems very complexity in my opinion, would be better it split into a few private methods? what do you think? for example _add_parameter, _merge_route and etc.


#2

I don’t necessarily disagree. But I don’t see too much benefit in breaking it up just yet. There’s some discussion about replacing the router altogether. In fact I’d really like to do it because I think we can make it much faster.

Complexity and speed are both potential benefits to a router redo. But there’s also some issues like Middleware modifications and superfluous router calls that I’d like to clean up. Of course while maintaining backwards compatibility.