5 ms·
Why is it that php, despise of being the most used server side language, (almost) never receives any love (i have noticed it too many times to ignore) whereas p
by Achshar 15y ago
Why is it that php, despise of being the most used server side language, (almost) never receives any love (i have noticed it too many times to ignore) whereas python and ruby, despite of getting alot of love, doesn't show usage numbers. i have seen alot of big sites using php, Facebook is the biggest i can think of right now, but python (.py extension) or ruby (i don't know file extension) is not that common (or at least i don't see it). i don't know either ruby or python so there might be some bias in what i see, but i strong feel there isn't.
- VMG 15y agohttp://en.wikipedia.org/wiki/Worse_is_better http://en.wikipedia.org/wiki/Worse_is_better
- icebraining 15y agoPython and Ruby based websites use routing frameworks, not isolated files, so you don't see extensions. PHP has routing frameworks too (Kohana, CakePHP, etc), but plenty of (most?) sites don't use them.
- Achshar 15y agoFile 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. example http://stackoverflow.com/questions/tagged/php http://stackoverflow.com/questions/tagged/php http://stackoverflow.com/questions/tagged/python http://stackoverflow.com/questions/tagged/python http://stackoverflow.com/questions/tagged/ruby-on-rails http://stackoverflow.com/questions/tagged/ruby-on-rails the difference is huge.
- icebraining 15y agoSure, I was just explaining that particular observation. I'd say the difference is that PHP, due to being easier to get into - you don't need a framework, understand OOP, etc - is used both by amateurs and professionals, while Ruby and Python tend to be mostly used by the latter. Hence, you get vocal opposition in communities composed of such professionals, while others don't really care enough about the languages and the craft to participate in them. (Note: nowhere did I criticize PHP or all PHP developers)
- Achshar 15y ago> due to being easier to get into - you don't need a framework, understand OOP what kind of framework? i was seeing khan academy videos that teach python and they did not use any framework and the basic things were same as in php (conditionals, loops, function, etc), no OOP. OOP might be used for some advanced stuff but that stands true for php too. Also a note from me too, i am not against python or ruby. They are great. I am just trying to make sense of what i observe daily.
- icebraining 15y agoYou need a framework and OOP if you want to use Python for the web. Without them you can't really move beyond simple terminal programs. The thing is that many people don't really want to learn to program: they do it as a way to accomplish other goal (in this case, create a website for some purpose). So they aren't likely to have the patience to learn in a structured way - often start by copy-pasting snippets and examples and learning as they need. PHP fits right into that mindset; in fact, it was originally designed for that: as a set of tools for people who just wanted to add some small feature to their mostly static personal site. And even if it has added a lot of advanced stuff, that quick-and-dirty approach is still easy.
- Pewpewarrows 15y agoBecause 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.
- tomp 15y agoPython websites made with Django don't have a fixed extension for the urls. I expect it's the same with ruby and many other more advanced frameworks.
- bcl 15y agoBecause not everyone is writing code for the web. And because this poll is about your favorite language, not the language you use the most.
- Achshar 15y ago> And because this poll is about your favorite language, not the language you use the most. yes, that's what i am wondering, why isn't php Favorited more often. > Because not everyone is writing code for the web. php can also be used for native stuff (IIRC). And both ruby and python are as suited for native development as php is.
- fisadev 15y agoThat's because python and ruby sites do the right thing: a page is not a script, the url should not point to a "file" ("index.php" and such). When using python or ruby, most of the time you use frameworks that let you define your urls, and not just put a script and let the url point to it. Urls should be readable and easy to remember, they are directions for the user. Wich script is running on the server is an implementation detail that shouldn't be part of the user interaction, he doesn't need to tell you wich script to run. "mysite.com/add_user" is waaaaay better than "mysite.com/add_user.php" This is one of many bad things php encourages you to do... and that's why most good programmers don't like php, because it makes easy to do bad things. Some big sites using python: youtube.com, addons.mozilla.org, dropbox.com, disqus.com, ... Big sites using ruby: twitter.com, jango.com, ...
- Achshar 15y agoYes that's a valid point. But that alone is not enough for php to be disregarded. Because one who wants to not have urls point to files on disk will change this behaviour. .htaccess makes it possible. This is a security problem, i agree. But not a major security problem. Because if it were, sites like Facebook would have been exploited long ago. It's certainly possible to do things right way. Which brings us back to "its developer's fault and not language's". to which what you said suits. > most good programmers don't like php, because it makes easy to do bad things
- mrodrigues 15y agoThe question is "what is your favorite language", not the language that is used the most, or the most easy to learn. Of course there are good PHP developers and good PHP code, but the language itself it's weak, full of flaws and promotes bad design (PHP encourages the coupling of processing with presentation). If PHP is your favorite language this is just a sign that you don't know other languages, not at a good level at least.