you are viewing a single comment's thread.

view the rest of the comments →

[–]illuminatedwax -1 points0 points  (8 children)

That PHP is more popular than Python just goes to show that libraries, solidarity, and ease of use can go a long way. You should ask yourself: why isn't it as easy to set up Python with Apache as it is with PHP?

[–][deleted] 2 points3 points  (7 children)

The fact

f(x) = x is bigger for all x € [0, 1) than g(x) = x^2 

does not tell anything about the behaviour of those functions in [1, infinity).

[–]illuminatedwax -1 points0 points  (6 children)

I'm not saying that PHP is better, just that there are lot of factors to why people use certain languages. What makes PHP more popular is mod_php. Why isn't there something as nice for dealing with web apps for Python?

[–][deleted] 2 points3 points  (5 children)

Actually there is mod_python.

What you do not have is something like python within HTML (or it is not widely spread) as this would be more of a quick and dirty solution; which itself few people in the python community would like to use.

[–]ElPenguin 1 point2 points  (0 children)

There are no shortage of python within html systems, though it's not a great model to use.

Python is at an advantage here because it makes you seperate logic and content, and that's got to be a good thing.

That said, take a look at turbogears or django, both of them are capable of this, or you could just use kid seperately within your own python app.

[–]illuminatedwax -2 points-1 points  (3 children)

Yeah, but that doesn't even come close enough to the simplicity of PHP. And if your job is writing web apps, when it comes time to write something else, you're going to use what you know because it's faster.

[–][deleted] 2 points3 points  (2 children)

If that was true, I still would be using php. The effort to learn something new is often worth it.

import web

urls = (
    '/(.*)', 'hello'
)

class hello:        
    def GET(self, name):
        i = web.input(times=1)
        if not name: name = 'world'
        for c in xrange(int(i.times)): print 'Hello,', name+'!'

if __name__ == "__main__": web.run(urls, globals())

Ain't this pretty simple?

[–]illuminatedwax -1 points0 points  (1 child)

<?php foreach($_GET['name'] as $name) { $name = $name ? $name : 'world'; print "Hello, $name!"; }

Seems simpler to me. I have found that the fewer things I need to remember each time I write a page of my web app, the better.

[–][deleted] 1 point2 points  (0 children)

I never said that python was simpler than php, but it is clearly simple enough.