Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Bob Majdak:
On SQL in PHP
May 16, 2013 @ 15:11:29

In a new post to his site Bob Majdak looks at using SQL in PHP and some of the challenges he's come across (some of them with his own tools). He talks about things line inline SQL, loading SQL by unique key or creating a "build object".

There is no right or wrong way, but no matter what there is no *pretty* way to do SQL inside of a PHP application. I have been having a personal debate with myself all week about how to make SQL statements nicer in an application without going to a huge DBAL package like Doctrine.

He looks at each idea and provides some of the pros and cons about each of them, noting that he hasn't quite decided on which is the best method. Some sample code is included to help clarify the points, showing the "find by unique key" version and how a more complex query might be created with the "builder object."

tagged: sql load unique key build object pros cons method inline

Link: http://catch404.net/2013/05/on-sql-in-php

Christian Weiske's Blog:
Working with .phar files
Aug 26, 2011 @ 14:07:41

Christian Weiske has a new post to his blog looking at a feature of PHP that's very useful yet doesn't seem to be widely used - phar archives. His post introduces you to phar and includes the good and the bad about their use.

It is possible to pack an entire PHP web application up in one single file and run it without unpacking it. This files usually have a .phar extension, which is an acronym for PHp ARchive, loosely based on jar (Java ARchive). [...] With PHP 5.3.0, the Phar extension is an official part of PHP. Shipping your applications as Phar thus is safe since 5.2 has reached its EOL already.

He mentions some of the pros (like one file, no unpacking needed) and cons (like no method for incremental updates, changing individual files inside the package is hard) of using them. He also talks about some of the tools you can use to create your own packages including PHP's own support, phar-util and Phing's phar task. He includes a few "things to consider" when making your packages and gives examples from the SemanticShuttle package to illustrate. Thrown in at the end are some benchmarks that show the difference between static file serving (with and without PHP) and the same sort of statistics with Phar packages included in the mix.

tagged: phar archive tutorial introduction pros cons benchmark

Link:

Mashable.com:
8 Experts Break Down the Pros and Cons of Coding With PHP
Nov 23, 2010 @ 18:06:44

Mashable has posted the third part of their "PHP experts" series with a look at what the eight people on their panel think are some of the pros and cons about developing with PHP.

In recent posts, our "PHP masters" gave helpful hints for beginners as well as some pointers for intermediate and advanced coders. For the last post in this series, we've turned to the same experts with some more general questions: What makes PHP a good language? What are some of PHP's drawbacks? And what are the best apps or cleverest hacks you’ve seen made with and/or for PHP?

Some of the reasons the panels gave were some common issues you hear about with PHP every day - how easy the language makes "spaghetti coding", the low barrier to entry (both good and bad), a problem with copy and pasting and - a very good thing - the documentation the project provides. Disclaimer: I was a member of the panel.

tagged: pros cons opinion language coding expert

Link:

Julian on Software:
PHP vs Java IMHO
Jul 12, 2006 @ 12:15:35

In the ever-raging PHP versus Java debate, there's no shortage of opinions to go around. Included in these thoughts is a new post from Julian with one of the more rational comparisons I've seen in a while.

In summary: a killer app in PHP will always sway me. But my recent hands-on experience with test-driven development has really underscored how essential it is to have good Agile development tool support.

He starts with PHP5, listing out the pros (performance, large community) and the cons (easy to write bad code, huge number of frameworks). Next up is Java - giving it the same treatment - the pros (rigorous typing, leads 'enterprise' tools) and the cons (behind the curve on tests, develpment timeframe slower).

There are several other he lists for each of of pros/cons mentioned above, so check out the full list in his post.

tagged: compare versus java php5 pros cons compare versus java php5 pros cons

Link:

Julian on Software:
PHP vs Java IMHO
Jul 12, 2006 @ 12:15:35

In the ever-raging PHP versus Java debate, there's no shortage of opinions to go around. Included in these thoughts is a new post from Julian with one of the more rational comparisons I've seen in a while.

In summary: a killer app in PHP will always sway me. But my recent hands-on experience with test-driven development has really underscored how essential it is to have good Agile development tool support.

He starts with PHP5, listing out the pros (performance, large community) and the cons (easy to write bad code, huge number of frameworks). Next up is Java - giving it the same treatment - the pros (rigorous typing, leads 'enterprise' tools) and the cons (behind the curve on tests, develpment timeframe slower).

There are several other he lists for each of of pros/cons mentioned above, so check out the full list in his post.

tagged: compare versus java php5 pros cons compare versus java php5 pros cons

Link:


Trending Topics: