5 ms·
Say wat you want of php. But it's (insert personal pejorative option) made for it. Sure Its a_little_inconsistent AndSomewhatChaotic But all the basics for th
by gcb 14y ago
Say wat you want of php. But it's (insert personal pejorative option) made for it.
Sure Its a_little_inconsistent AndSomewhatChaotic
But all the basics for the web are incredible accessible right away.
With every other language you have to start with a framework.
I find php easier than rails to prototype applications and do fast hacks that need a web face.
It's simply the right tool for the job on those occasions. Of course, later they become huge systems...
- eevee 14y agoThat's why e.g. Flask exists: it gives you the basics, plus light structure and templating and routing and XSS protection and deployment options and whatever else. With no setup and no boilerplate. It's about as much effort as typing `<?php`.
- chrisguitarguy 14y agoWhile that's true (and I do love Flask), PHP comes installed on every discount web host. Deploying a PHP app is as easy as using FTP, deploying a Python app can be -- but doesn't have to be -- complex. I'd say this is the bigger sticking point than the framework. Obviously Heroku and other PAAS providers are changing the game as far as deployment ease. It should be to see what happens in the next few years on that front.
- espeed 14y agoDeploying a PHP app is as easy as using FTP, deploying a Python app can be -- but doesn't have to be -- complex. Easy != Simple && Easy != Good See "Simple Made Easy" (http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy).
- eevee 14y agoIt's a chicken-and-egg problem. Best I can do is encourage more people to write more Python software, so those crappy free hosts are more inclined to support running it. Until then, I don't think it's terribly unreasonable to pay twenty bucks a month for a server to play with. That's less than AT&T wants to charge me for sending a thousand 160-byte messages.
- joering2 14y ago"crappy free hosts" ?
- espeed 14y agoDon't mess with "crappy free hosts" -- just run it on a free Heroku dyno (http://www.heroku.com/pricing http://www.heroku.com/pricing). Kenneth (http://kennethreitz.com http://kennethreitz.com) shows you can get good performance with Flask on the free dyno (http://flask.pocoo.org/mailinglist/archive/2012/2/22/flask-on-heroku-%2B-gunicorn-static-files/#cff05916ae6854557b93d0226cb87151 http://flask.pocoo.org/mailinglist/archive/2012/2/22/flask-o...).
- eli 14y agoThat's a fair bit more involved than "FTP files to my web host and they usually just work"
- espeed 14y agoIt's actually easier... $ git push heroku master
- eli 14y agoSure, well I would hope it's easy to do a one line deploy to any platform and with any language... once you set it up. You left out freezing requirements for pip, setting up cedar, etc. Nothing like that for a simple PHP app. I don't want to overstate the case; deploying Flask isn't hard, but deploying PHP is stupidly easy.
- mkopinsky 14y agoAs a Mercurial user who doesn't feel like learning git just for the sake of deploying toy Python apps, can anyone comment on whether hg-git or the like is a reasonable way of deploying to heroku?
- 14y ago
- BrandonM 14y agoThat's a nice sentiment that's completely inaccurate. Even 6 years ago when I first started programming Python, simple Python cgi scripts were very easy to write. It's as simple as: print """\ Content-type: text/html <html>...</html>""" With %(var)s interpolation, you can even slap in locals() easily to trivially put variables' values into the page.
- eli 14y agoThat doesn't seem like it will scale very well at all. Or am I missing something?
- justincormack 14y agoPHP doesn't scale well either. You can rewrite for scaling later.
- gcb 14y agoand you think that manually handling headers is more straightforward than php? I disagree.
- BrandonM 14y ago"Manually handling headers"? That is how people wrote websites in the early 2000s. Many cgi scripts were cobbled together in Perl. I found that I liked Python better. I understand that in PHP you just add some <?php ...> stuff to an otherwise normal HTML file, but the situation in Python, with its multiline strings that support variable interpolation, isn't much worse. Just add the lines I mentioned to the top (treat is as a recipe if you like), and the rest is better than PHP.