2 ms·
Regular expressions are overkill in most cases, and clutter the code. Do you really always know you need a 6 character long integer in a URL? what you really wa
by intranation 17y ago
Regular expressions are overkill in most cases, and clutter the code. Do you really always know you need a 6 character long integer in a URL? what you really want is an ID, which may be a 6 character integer. Simple keyword-based routing is fine for 99% of cases.
- RommeDeSerieux 17y agoHere is a simple example which pops up too often: i need a "flatpages" controller which will display a page based on its url. Or, as another example, a category tree. With regexes, this is a piece of cake. With routers that try to hide regexes, i have to undo the work done by the router.