8 ms·
Because Python and Ruby sites are built properly, and don't expose their filenames as extensions in the url (.py or .rb). In fact, their urls don't even map to
by Pewpewarrows 15y ago
Because Python and Ruby sites are built properly, and don't expose their filenames as extensions in the url (.py or .rb). In fact, their urls don't even map to actual files to begin with, which immediately avoids several large security holes in PHP-built sites. With PHP you have to do some clever url rewriting and redirecting all your traffic through one central "index.php"-like script.
PHP is the training wheels of the server-side language world. You can pick it up and almost immediately see results on any number of popular hosting providers that provide support out of the box for it. That's why you see it so much.
- tmh88j 15y ago>Because Python and Ruby sites are built properly. Are you implying that there's not a single bad Python or Ruby programmer?You can dislike PHP all you want, but don't pretend that a website can't be written poorly using Python or Ruby. The programmer is the one who makes it after all, not the language. >In fact, their urls don't even map to actual files to begin with. I take it you've never looked into Cakephp.
- Pewpewarrows 15y agoNo, I'm not implying that. Of course it's possible for a poorly written site to be built with Python or Ruby. But I've never seen a single one expose its implementation details through filename extensions, or map urls directly to files on disk: both things that PHP does by default. Yes, I've used Cakephp. It's a slight improvement.
- Achshar 15y ago> PHP is the training wheels of the server-side language world. You can pick it up and almost immediately see results on any number of popular hosting providers that provide support out of the box for it. yes that makes sense. But i wonder, does that imply python or ruby are more difficult to understand than php? I believe they must be on the same level of sophistication and understandability. And if python, (or ruby) for example, was "better" (as in gets more developer love) then shouldn't it's availability on hosting services increase? Its not like either of php or python is new and needs time to settle down. If availability on hosting providers were to increase, it would have increased long ago. and as for file extensions, as i noted in another comment in this thread, file extension is just a part of my observation. It also includes tutorials, how-tos, questions/answers on stack overflow-like sites, etc. all of these are more for php than any other language.
- Pewpewarrows 15y agoAgain, because PHP has such a low barrier of entry, more developers use it. So it's only logical that you'd see more tutorials and questions for it.
- Achshar 15y agocan you elaborate a little on how does it have low barrier of entry? as my current understanding stands, python has all the basic things like loops, conditional, functions, variables etc just like php. What makes python difficult to start learning? (or if put another way: what makes php easier to start learning?)
- Pewpewarrows 15y agoThe languages themselves are pretty equivalent. But with PHP it's easier for newbies to grok things when you can just point a web server at a directory that has a "blog.php" file in it, and visit "myserver.com/blog.php" to execute that script and see results. With python you have to understand the basics of what WSGI is and how it works, which is pretty poorly documented for people just starting web development. The "visit a file from my browser's address bar" motif is easier to grasp than "my url gets interpreted as a string that I then parse and route to a function imported from some other file".
- Achshar 15y agoThat makes sense. thanks for clearing it up. I didn't know it was necessary to have url formatting to write python. but then its not a language problem. its a framework problem. And php can have its framework too. But I guess it doesn't matter if its a language problem or a framework problem when we choose our favourite language :)
- keymone 15y agoit's not a problem. it's a solution to a problem.