News for hackers. Stuff that matters.
Re:Juno: A Lightweight and Simple Web Framework for Python by KrisJordan on Wednesday May 13, 2009 @10:24AM (#606924)
They're not used as executable code. They're used as meta data. Not much different than an XML file sitting beside of a script, except that

1) it's more DRY because for external files to say something about a construct in code there is repeated information, i.e. <route><to><class>Foo</class><method>bar</method></to><from><method>GET</method><url>some/url/here</url></to></route>,

2) because you're using the PHP language to specify metadata about a PHP construct refactoring is easier, i.e. change the name of a function and you don't have to go update your routing somewhere else,

3) having the metadata inline with code turns out to be mentally lightweight once you get over the initial shock of seeing metadata in a comment.

There are no comments on this comment yet.