3 ms·
It surprised me to see Clojure had the longest example and PHP had the shortest.
by meric 14y ago
It surprised me to see Clojure had the longest example and PHP had the shortest.
- adambard 14y agoI was working forwards from the Ruby example for all of these, so I may have implemented the Clojure one in a weird way. PHP cheats a bit to be the shortest, since it just looks up files to execute and renders stdout as the result, removing the need for routing.
- antihero 14y agoWell, that's one of the few "advantages" of PHP. Though PHP allows this to happen easily, it's a fairly terrible idea for production code - the shortest isn't always the best. In reality you'd use a macroframework like Symfony or a micro like Ham https://github.com/radiosilence/Ham https://github.com/radiosilence/Ham
- cpress 14y agoThere is a microwork made from Symfony components called Silex: http://silex.sensiolabs.org http://silex.sensiolabs.org. Edit: I mis-read; reworded for clarity.
- duaneb 14y agoI wasn't surprised to see PHP do well as having the shortest path to a responsive site (in the most minimal sense) is PHP's greatest feature.