Hacker News new | ask | show | jobs
by intranation 6254 days 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.
1 comments

Here 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.