Re:Juno: A Lightweight and Simple Web Framework for Python
by intranation on Wednesday May 13, 2009 @04:54AM
(#606656)
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.
Re:Juno: A Lightweight and Simple Web Framework for Python
by RommeDeSerieux on Saturday May 16, 2009 @07:32PM
(#612729)
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.
Re:Juno: A Lightweight and Simple Web Framework for Python
by misuba on Wednesday May 13, 2009 @12:26PM
(#607107)
What I don't get is why web frameworks put routing into the code at all. Most of them don't do anything interesting with it (Rails is the most prominent exception), and if you're just gonna map a few things with regexes, well... what's so difficult about mod_rewrite?
Re:Juno: A Lightweight and Simple Web Framework for Python
by RommeDeSerieux on Saturday May 16, 2009 @07:35PM
(#612731)
Portability between servers and reusable apps are the first examples that came to my mind. A reusable app would need an extra installation step and need to duplicate its routes in more than one syntax for different webservers.
Luckily this is Python so it's possible to monkeypatch the implementation.