4 ms·
Perhaps someone should make 'PYP', a Python that's easy for PHP programmers. Like PHP, .PYP files would be templates with no limits on mixing presentation and
by gojomo 14y ago
Perhaps someone should make 'PYP', a Python that's easy for PHP programmers.
Like PHP, .PYP files would be templates with no limits on mixing presentation and logic. The filesystem hierarchy provides the default URL-routing.
But, you get the regularity/power/compactness of Python wherever you want it. (Perhaps, every line in a .PYP file beginning with '\' is meaningfully-indented Python.) If you ever want to hijack a part of the URL-space from the filesystem, there are routing utilities to do that.
Would such a glide-path from PHP to Python be a good thing? Or bad? ("The barbarians are at the gates!")
- voyou 14y agoSuch a thing exists: http://www.modpython.org/live/current/doc-html/pyapi-psp.html http://www.modpython.org/live/current/doc-html/pyapi-psp.htm... I don't think it's widely used, though, probably because the possibility of using PHP in this template-like way isn't actually a big advantage (serious PHP devs almost certainly don't use PHP that way); PHP's big advantage is that it's installed everywhere.
- gojomo 14y agoBut why is PHP installed everywhere? At least partially, it's because it offers such a low barrier to initial sloppy usage. Should a PYP offer that too? (And if there are other factors that make PHP easy to use everywhere, could a PYP mimic those as well?)
- wvenable 14y agoI think it missed the point. I seriously doubt Marco is mixing presentation and logic, using the file system for routing, etc.