Earlier quoted context omitted.
Have a play around with a framework such as Symfony [1]. That's the most natural way of learning a better style of PHP web development. [1] http://www.symfony-project.org/
Any particular reason you're linking to Symfony instead of Symfony2? I find the latter so much easier to read and work with it's not even funny.
I Like PHP
111–120 of 269 posts
Re: I Like PHP
#112Is PHP that much worse where it's worth it to jump onto the ruby ship? I'm just starting to code one of my current projects, but in PHP. Should I consider ruby instead?
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.
I thought this is what the triple equals is for?
Re: I Like PHP
#113"I don’t even bother writing tests for most of the PHP I write (obviously, I would be a bit more thorough if this code were destined to be used in a more mission critical web site). Not writing tests is not the only software taboo that I break when I write PHP: I happily mix up presentation and logic all the time. That’s just how PHP is supposed to work" And this is why everybody else hates PHP. It tempts you to writ…
This is unfortunately true. I'm a PHP programmer (currently writing a book, A Highly Negative Book About PHP , that I've been billing as "like Essential Java but tells you what not to do") and, I like to think, a fairly good one; reading this article made me cringe because this guy is emblematic of most of the problems in the PHP community. He: -accepts uncritically gobs of code dredged up via Google -considers somet…
In fact, i reject any other explaination. Sticks fingers in ears. Lalalalala, it's satire, nobody is this incompetent. Lalalalala, can't hear you.
Re: I Like PHP
#114"I don’t even bother writing tests for most of the PHP I write (obviously, I would be a bit more thorough if this code were destined to be used in a more mission critical web site). Not writing tests is not the only software taboo that I break when I write PHP: I happily mix up presentation and logic all the time. That’s just how PHP is supposed to work" And this is why everybody else hates PHP. It tempts you to writ…
This is unfortunately true. I'm a PHP programmer (currently writing a book, A Highly Negative Book About PHP , that I've been billing as "like Essential Java but tells you what not to do") and, I like to think, a fairly good one; reading this article made me cringe because this guy is emblematic of most of the problems in the PHP community. He: -accepts uncritically gobs of code dredged up via Google -considers somet…
Re: I Like PHP
#115PHP'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…
x.length vs strlen($x)
x.gsub('foo', 'bar') vs str_replace('foo', 'bar', $x)
x.strip vs trim($x)
x.upcase vs strtoupper($x)
All four of the PHP functions use a different form: strX, str_X, X, and strtoX. Some of this could be solved with consistent function names, like always using str_X, but then that makes me wonder why one wouldn't just want to have all string functions available as object-oriented methods on strings. Python takes a different tactic, and has a non-object-oriented len() method, but this isn't just used to get the length of a string, it will also get you the length of a list, tuple, or dictionary.
Re: I Like PHP
#116> But just like C, PHP is lousy for the medium to large. Any software project with a duration in months or greater that is entirely in PHP is going to be painful.
Yeah, C is terrible for medium to large projects like, say, Linux.
Re: I Like PHP
#117I submit that PHP's popularity has much more to do with mod_php and its ubiquity across cheap web hosts than any intrinsic merits as a language. As 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 pro…
Re: I Like PHP
#118Earlier quoted context omitted.
It's a feature of PHP because PHP isn't a compiled language. C, Java, anything .NET... They all require an added step in the middle.
in .net you can run your site off source files, and the server will compile as needed
Re: I Like PHP
#119PHP'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…
A tricycles greatest strength is that it doesn't require balancing on two wheels. 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 yo…
Re: I Like PHP
#120I like PHP because it's got a C-like syntax, which is a personal preference of mine. I also like it because it exposes the nuts-and-bolts of web development without any fuss, unlike, say, ASP.NET (though last I touched that was 3 years ago so doubtless things have changed since), and that it has a basic templating system built in, and that it's easy to install and deploy to. It definitely is deeply flawed for many re…
For ASP.NET, indeed, WebForms can be a bit violent since it's essentially an abstraction that tries, with mixed sucess, to make you forget you're writing for the Web. ASP.NET MVC, which came out 2 years ago, is much closer to RoR and other similar frameworks, and is a better abstraction in my opinion.