I Like PHP
91–100 of 269 posts
Re: I Like PHP
#92> I write PHP code very sporadically Explains it. PHP is fine if you jump in, write a few lines, and then don't ever have to maintain it yourself. Woe to the guy who does have to maintain it.
I would never use PHP for anything big/complex, my post was mostly in response to the universal sneering and mocking that PHP always gets. I think it's unjustified.
Since I only modify my web sites a few times a year, I am pretty sure that I would be much more reluctant making these modifications on a RoR app than a PHP one.
Re: I Like PHP
#93What worries me about PHP is that innovative ideas don't appear to be coming from the PHP community. They come from Python, or Ruby, or Erlang, or Java projects and are copied by PHP developers afterwards. I worry there's a risk that PHP is being left behind as the developers who solve new and challenging problems turn to other languages.
Furthermore -- and this is just my sense of how things are where I live -- while it's possible (and not even difficult) to write quality PHP code, it seems to be difficult to find developers who care about quality. My manager complains about this constantly and I'm inclined to believe him since, when I was a freelance developer, I saw tons of PHP code that was simply and unambiguously terrible. Conversely, a developer who wants to write quality code in PHP has to look pretty hard to find a PHP shop that recognizes quality and values it. I suppose that these issues aren't tied to a particular language, but they seem more pronounced with PHP.
Re: I Like PHP
#94Earlier quoted context omitted.
Here is some PHP code: $x = "0"; if(!$x){ echo "0 is false"; } If you understand why it's crazy that PHP prints "0 is false" when you execute that, you're probably better off jumping ship now. If you don't, you'll probably appreciate the low barrier to entry for PHP more than any benefit you'd gain.
Actually, here's a more insane version: $x = 0; if(!empty($x)){ echo '"0" is empty'; }
Re: I Like PHP
#95Earlier quoted context omitted.
> Did you ever read Python's documentation? Yes. it's rather fucking good. > Show me one popular web programming language which has a full page, up to date, with examples and user comments and version incompatibility info, per function. Have you ever read Python's documentation? In the last ten years? Python's docs have a complete and readable description of the language[0] including its data model and the various co…
Don't forget being able to do this from within the interpreter: >>> print abs.__doc__ abs(number) -> number Return the absolute value of the argument. >>> print xrange.__doc__ xrange([start,] stop[, step]) -> xrange object Like range(), but instead of returning a list, returns an object that generates the numbers in the range on demand. For looping, this is slightly faster than range() and more memory efficient.
In [1]: abs?
Type: builtin_function_or_method
Base Class:
String Form:
Namespace: Python builtin
Docstring:
abs(number) -> number
Return the absolute value of the argument.Re: I Like PHP
#96PHP's greatest strength is that it doesn't require OO. Seriously, for most simple web application tasks (and even some complicated ones) OO adds more confusion than it removes, and I say this as someone who certainly sees the value in OO for complex apps. Most web apps are ultimately more like shell scripts or console applications than desktop/mobile applications. It's no coincidence that most of the former are writt…
For those who can't ride a bicycle, tricycles are great.
Once you understand how to use a framework/language like RoR, I don't see how PHP is more useful (unless you have size constraints). ActiveRecord::Base.connection.execute("SELECT foo from bar where x = y") is just as simple as mysql_query("SELECT foo FROM bar WHERE x = y"), and you get the benefit of abstracting away the database in database.yml so you can run it in different environments.
Re: I Like PHP
#97me too, i like php. it's a decent templating language with some very advanced features. it even supports namespaces!
which is far from encouraging safe best practices.PHP namespaces aren't any better: http://pornel.net/phpns
Re: I Like PHP
#98There's a regular stream of "defending PHP" posts but they all seem to miss the point. No one bashes PHP because it can't do these things, or that it isn't easy. People bash PHP because there are objectively better languages and platforms out there and objectively bad decisions made by those guiding the PHP language. If you want to defend PHP in any meaningful way then you can't just list things that can be done easi…
The problem is that people go too far with the bashing- People tend to just sneer at anything PHP-related, and don't acknowledge that great work is being done every day in PHP. An app written in PHP by a 8/10 programmer is going to be better than an app written in (sexy other language) by a 7/10 programmer.
Depends entirely on your metric. It's far too easy to introduce subtle bugs, especially security oriented ones, in PHP. If I had a dollar for every XSS, remote file inclusion, CSRF, arbitrary file read, etc vulnerability I found in a "good" PHP app, I'd be a very wealthy man. Some things are mitigated by using a good framework, but in most cases people get them horribly, horribly wrong.
Re: I Like PHP
#99Earlier quoted context omitted.
...which leads me to think that the poster is confusing "mainstream" with "GoDaddy".
I'm not. I'm using a fairly "non-noob" ISP (ssh access, crontab, etc...) and they still don't give me access to much more than PHP. I can install Java but I can't even run it as a CGI because of the HTTP request memory constraints they impose. This is pretty standard, I don't blame them for doing this, and I would go with a VPS if actually needed all this. Same for Ruby on Rails, obviously.
To my downvoter, here's a list of "mainstream" providers, at the Godaddy-level, and language support:
Dreamhost: RoR, PHP, Perl, Python [1]
Godaddy @ $8/month: PHP, Perl, Python, RoR [2]
a2Hosting @ $3/month: PHP, Perl, Ruby, Python
That seems pretty mainstream to me.
[1] http://beta.dreamhost.com/web-hosting/ [2] http://www.godaddy.com/hosting/web-hosting.aspx [3] http://www.a2hosting.com/services/web-hosting/
Re: I Like PHP
#100As someone who made a good living for many years by building stuff with PHP... I couldn't get away from it fast enough. Rails+Heroku is the new PHP, if you want a batteries-included web framework and easy hosting.
Not rhetorical: does anyone here use PHP for starting new projects?