News for hackers. Stuff that matters.
Re:Taking PHP Seriously [pdf] by goshx on Friday September 27, 2013 @10:22PM (#6460623)
Just checking: do you have any experience with it? When was the last time you tried working with PHP in a team?
Re:Taking PHP Seriously [pdf] by jrockway on Friday September 27, 2013 @10:43PM (#6460671)
I've done more projects in PHP than I would care to admit. I ported the University of Chicago's "Uncommon Application" from Cold Fusion to PHP using an OO data access model, MVC, and explicit templates. (This was a long time ago before people realized that MVC was a bad idea.)

I've also hacked up a bunch of open source projects (wordpress, joomla). No tests, so you never know what you've fucked up, and you spend more time checking for regressions than actually adding that one feature you want. That's not how you do large scale software development, that's how you add pack on billable hours by charging your client for the same work 100 times.

Really, it's boils down to taste more than anything else. I've yet to see a tasteful application written in PHP.

If I were to summarize it with one anti-pattern, it's that PHP encourages people to mix unrelated parts of the program into one place, making testing, maintenance, and understanding nearly impossible. I should be able to test your app's interface without having a database. I should be able to write a database query without reading any code that touches HTML. And it's something I never see in PHP code.

Re:Taking PHP Seriously [pdf] by jasonlotito on Friday September 27, 2013 @11:14PM (#6460743)
> I've also hacked up a bunch of open source projects (wordpress, joomla) … > I should be able to write a database query without reading any code that touches HTML. And it's something I never see in PHP code. … > I should be able to test your app's interface without having a database.

So the answer is No, you don't have any experience with professional PHP, and you haven't used it in more than half a decade. Could have just said that.

Re:Taking PHP Seriously [pdf] by badclient on Friday September 27, 2013 @11:08PM (#6460722)
You say MVC is a bad idea and yet you complain that php encourages mixing of things? I follow MVC and just ported a fairly large django app to php. Using smarty, I barely had to touch the Django templates. They worked almost out of the box. So if you think Django templates and structure is fine, let me tell you you can get a very similar set up using codeigniter and php.
Re:Taking PHP Seriously [pdf] by jrockway on Saturday September 28, 2013 @07:20PM (#6463464)
MVP is a better idea than MVC. I'm not suggesting moving towards mixing code.
Re:Taking PHP Seriously [pdf] by jtreminio on Friday September 27, 2013 @10:52PM (#6460691)
That's because you're stuck writing crap code in crap libraries.

Really, you judge PHP off of Wordpress and Joomla?

Re:Taking PHP Seriously [pdf] by badclient on Friday September 27, 2013 @11:20PM (#6460763)
Exactly. He's comparing php to a framework. PHP isn't a framework. If he tried to write code in python or ruby without a framework or template engine, he'd have the same complaint. If he tried php with a framework or template system, he'd realize its not all that different. I just rewrote a Django app in php with very tiny modifications to the templates thanks to codeigniter and smarty.
Re:Taking PHP Seriously [pdf] by pearjuice on Saturday September 28, 2013 @05:05AM (#6461374)
>CodeIgniter Abandon ship immediately.
Re:Taking PHP Seriously [pdf] by Gigablah on Saturday September 28, 2013 @05:24AM (#6461402)
CodeIgniter is still okay. Smarty, on the other hand...
Re:Taking PHP Seriously [pdf] by pearjuice on Saturday September 28, 2013 @03:59PM (#6462945)
Still okay? Sure, if you like frameworks with no future at all, hacked together architecture, legacy PHP 4 code nested so deep there should be a total rewrite to remove all of it and a community which is as kindergarten as it gets.
Re:Taking PHP Seriously [pdf] by jasonlotito on Friday September 27, 2013 @11:15PM (#6460746)
Ever notice how everyone who complains about PHP are usually complaining about WordPress, Joomla, or other such apps?
Re:Taking PHP Seriously [pdf] by sergiosgc on Saturday September 28, 2013 @06:33AM (#6461485)
Because these apps exist. WordPress, for example, is unparalleled in other language domains. What is the WordPress of Ruby? And in python? Is it Django? Where's the plug-in directory for Django, equivalent to [1]?

I work with WP, I'm the first to recognize it's an old codebase with all defects this entails, but popularity has value. Value that PHP critics dismiss too lightly.

[1] http://wordpress.org/plugins/

Re:Taking PHP Seriously [pdf] by jasonlotito on Saturday September 28, 2013 @08:44AM (#6461673)
I'm not dismissing WordPress's value. Rather, I'm dismissing those that dismiss PHP out-of-hand and their lists of reasons include WordPress.
Re:Taking PHP Seriously [pdf] by LeafStorm on Friday September 27, 2013 @10:50PM (#6460681)
Anecdata: I just wrote a PHP application where the HTML never touched the database at all. And I'm right now working on a Java application where the database is mixed into the HTML just like the worst of the worst PHP, except because it's Java all the code is two times longer.
Re:Taking PHP Seriously [pdf] by debaserab2 on Friday September 27, 2013 @11:25PM (#6460774)
What is "tasteful" source code? What characteristics make a code base tasteful? Do you have any samples?
Re:Taking PHP Seriously [pdf] by goshx on Friday September 27, 2013 @11:01PM (#6460708)
To me it boils down to the developer doing the job. Stating the obvious: you can do a great job in any language, just like you can do a crappy job in any language. I have seen tasteful applications written in PHP (hardly ever an open source application, unfortunately), what I have yet to see is a language with 100% tasteful applications.
Re:Taking PHP Seriously [pdf] by adamors on Saturday September 28, 2013 @07:54AM (#6461595)
> If I were to summarize it with one anti-pattern, it's that PHP encourages people to mix unrelated parts of the program into one place, making testing, maintenance, and understanding nearly impossible.

Haha, you are actually the problem you complain about.

Half assed "developers" who try to build anything large scale with WP or Joomla, people who can't be bothered to keep up with the changes that happened in the past 5-10 years but still complain about how shitty everything is.