Live data from Hacker News

I only know PHP. How do I write a Web application in Python?

me.veekun.com

21–30 of 196 posts

Re: I only know PHP. How do I write a Web application in Python?

#21
post #13
post #5

What's wrong with mysql?

Apparently, it isn't PostgreSQL; If you have no need for Postgres features and you're not familiar with it, sticking to MySQL is fine.

MySQL was a lot worse before 2004 or so. It wouldn't do transactions, nor proper joins, if I remember correctly.

I think the bad reputation still sticks to it.

Re: I only know PHP. How do I write a Web application in Python?

#23
post #19

Nice littel overview, but... "Unicode sucks. This is a universal truth." And here I stopped reading. Unicode is the best thing around, what sucks it that Py2 does not implement it very well. Py3 does, and that is the main reason I really would like to use it and hope Django will soon fully support it. (Because: there are other languages beside the European ones)

Fair point. Correction: working with encodings sucks.

Py3 isn't magnitudes better with Unicode; it's better about converting incoming bytes, and it makes literals into real strings. But the former isn't necessarily a good thing, and you can get the latter with a `__future__` import. Always dying on implicit conversions is definitely nice, though.

Re: I only know PHP. How do I write a Web application in Python?

#24
post #4

Earlier quoted context omitted.

That'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`.

While 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 fr…

Deploying 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).

Re: I only know PHP. How do I write a Web application in Python?

#25
post #17

"I only know PHP" "I just trashed PHP rather harshly" "I want to learn python" Well, you're doing it wrong. How can you trash PHP if you know no other languages ?! You're following articles, posts saying PHP is bad and.. you decide then that's right it's bad! Ever though about thinking on your own first? Like, actually trying a language (python, why not) then deciding if it's better? This kind of stuff always amaze m…

This is part of an FAQ series. The bolded part ("I only know PHP...") is the question I'm answering.

I'll leave you to contemplate the irony here.

Re: I only know PHP. How do I write a Web application in Python?

#26
post #4

Earlier quoted context omitted.

That'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`.

While 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 fr…

It'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.

Re: I only know PHP. How do I write a Web application in Python?

#28
post #5

What's wrong with mysql?

It's very lax by default, it's full of strange corner cases that are often forgiven because they're documented, it guesses what you mean with disastrous results when it's wrong, and its biggest feature seems to be its own inertia.

Re: I only know PHP. How do I write a Web application in Python?

#29
post #7

"MySQL is the PHP of databases". Strange, I just had this sentence popping in my head yesterday. I'm seriously considering writing a list of its wrong doings. Great article overall.

Please write that list. I'd be very interested in reading it.

Re: I only know PHP. How do I write a Web application in Python?

#30
post #10

I'd say the necessity of this post is why PHP is as popular as it is. With PHP, there are no package managers I have to install; there is no template language to learn; there is often no version control; there is no "framework"; etc. You just drop in a .php file and, most likely, it will just run. If I need a quick dynamic page on my server, it's much easier to do this in PHP than in Python or Ruby. Until Python or R…

I agree on the simplicity of php. The barrier to write php is low. All you need is notepad and browser. This may be a transition from writing html.

Compare this to other languages where you need multiple tools before you can even begin.

This doesn't make php better. It just may explain why less people make the jump.

Post reply on HN