<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Professional PHP</title>
	<atom:link href="http://www.procata.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.procata.com/blog</link>
	<description>PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.</description>
	<lastBuildDate>Fri, 10 Dec 2010 17:23:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Richard Thomas</title>
		<link>http://www.procata.com/blog/archives/2010/12/10/richard-thomas/</link>
		<comments>http://www.procata.com/blog/archives/2010/12/10/richard-thomas/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 17:11:04 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=337</guid>
		<description><![CDATA[I&#8217;ve received some sad news.  Three weeks ago, A colleague of mine, Richard Thomas, passed away of a heart attack.  Those in the PHP community may have known him by his cyberlot handle or by his phpjack web site.
I worked with Richard for a year and a half.  Richard liked solving problems and was always quick [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve received some sad news.  Three weeks ago, A colleague of mine, Richard Thomas, passed away of a heart attack.  Those in the PHP community may have known him by his <a href="http://twitter.com/cyberlot">cyberlot</a> handle or by his <a href="http://www.phpjack.com/">phpjack</a> web site.</p>
<p>I worked with Richard for a year and a half.  Richard liked solving problems and was always quick to offer solutions when help was needed.  He was an enthusiastic programmer with good attitude. He was well liked.</p>
<p>Richard enjoyed attending PHP conferences.  Richard was active on the Solar framework, writing articles and contributing code.  We had several conversations about a chat project of his, about writing games and various ideas he had.  </p>
<p>Richard is survived by his wife Lisa and four year old daughter Nicollette.  Donations are being accepted to assist them. Even if you haven&#8217;t had contact with Richard, consider making a donation if you&#8217;ve done freelance work, as Richard was doing at the time of his death. Donations can be sent to:</p>
<p>Niki Fund, 4818 Davis Place #G, Renton WA, 98055</p>
<p>Richard passed away at his computer, doing the work he loved to do.  He was 37 years old.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2010/12/10/richard-thomas/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>ZendCon: Writing Maintainable PHP Code</title>
		<link>http://www.procata.com/blog/archives/2009/10/19/zendcon-writing-maintainable-php-code/</link>
		<comments>http://www.procata.com/blog/archives/2009/10/19/zendcon-writing-maintainable-php-code/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 00:57:46 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[zendcon]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=305</guid>
		<description><![CDATA[I&#8217;ve finally made it to my first Zendcon.  Its nice to see some familiar faces and also nice to put new faces to familiar names.
I gave my maintainable PHP talk this morning.  I love doing this talk.  Thanks to everyone who attended. I&#8217;ve put the slides (pdf) up on my talks page.
Much [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally made it to my first Zendcon.  Its nice to see some familiar faces and also nice to put new faces to familiar names.</p>
<p>I gave my maintainable PHP talk this morning.  I love doing this talk.  Thanks to everyone who attended. I&#8217;ve put the <a href="http://www.procata.com/talks/zendcon-oct2009-maintainable.pdf">slides</a> (pdf) up on my <a href="http://www.procata.com/talks/">talks</a> page.</p>
<p>Much of the material is based on Test Pattern <a href="http://www.procata.com/writings/">columns that I&#8217;ve written</a> for php|architect.  Here are some of the specific columns.</p>
<dt><a href="http://www.phparch.com/magazine/index/40">Organizing For Change</a></dt>
<dd>This is where I developed the outline for the talk</dd>
<dt><a href="http://www.phparch.com/magazine/index/43">Dependency Injection</a></dt>
<dd>This is a more in depth discussion of code reuse and dependency injection</dd>
<dt><a href="http://www.phparch.com/magazine/index/65">Modeling Dependencies</a></dt>
<dd>This is where I talk about coupling, layered design and abstraction</dd>
<dt><a href="http://www.phparch.com/magazine/index/69">A Closer Look at Cohesion</a></dt>
<dd>This is where I developed my explanations of cohesion and the single responsibility principle</dd>
<dt><a href="http://www.phparch.com/magazine/index/73">Searching the Code</a></dt>
<dd>Good designs are searchable</dd>
<p>One thing I like about both writing on and presenting on the same material is that I get feedback from the presentations that I can put back into the writing and vise versa.  I&#8217;m looking forward to finding some better ways to explain layering and the depend on abstractions principle.  If you saw the talk, was there anything you particularly liked or needed work?  Leave a comment here or on the <a href="http://joind.in/877">joined.in</a> page.</p>
<p>Here are some of the books I mentioned in the talk.</p>
<dt><a href="http://www.amazon.com/gp/product/1932394753?ie=UTF8&#038;tag=procata&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=1932394753">PHP in Action: Objects, Design, Agility</a></dt>
<dd>This is a really good next step if you&#8217;re interested in maintainable code, testing, and object oriented design.</dd>
<dt><a href="http://www.amazon.com/gp/product/0201485672?ie=UTF8&#038;tag=procata&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0201485672">Refactoring: Improving the Design of Existing Code</a></dt>
<dd>This is the classic treatment of Refactoring.  Probably everyone considering themselves a professional programmer should read this.  The examples are in Java, though.</dd>
<dt><a href="http://www.amazon.com/gp/product/0131177052?ie=UTF8&#038;tag=procata&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0131177052">Working Effectively with Legacy Code</a></dt>
<dd>This is a good book if you want to start testing and refactoring in a large system that doesn&#8217;t currently have tests.  Again, the examples are in Java.</dd>
<p>I sat in on the <a href="http://joind.in/talk/view/884">PHP Code Review</a> talk this afternoon.  I thought it was a great complement to my talk.  I tend to be a bit theoretical and this talk was very practical, but we covered a lot of the same principles.  Nice talk.  Nice scheduling, Zend.</p>
<p>I&#8217;m really looking forward to tomorrow.  Unfortunately, I have to go back to work on Wednesday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2009/10/19/zendcon-writing-maintainable-php-code/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Looking Towards the Cloud</title>
		<link>http://www.procata.com/blog/archives/2009/05/02/looking-towards-the-cloud/</link>
		<comments>http://www.procata.com/blog/archives/2009/05/02/looking-towards-the-cloud/#comments</comments>
		<pubDate>Sat, 02 May 2009 19:11:45 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[ec2]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=295</guid>
		<description><![CDATA[Some people love their automobiles.  They can tell you all all about their technical specifications.  They buy upgrades and after market parts.  Its a lifestyle and a hobby.  I am not one of those people.  For me an automobile is purely a means to an end.  I am here, [...]]]></description>
			<content:encoded><![CDATA[<p>Some people love their automobiles.  They can tell you all all about their technical specifications.  They buy upgrades and after market parts.  Its a lifestyle and a hobby.  I am not one of those people.  For me an automobile is purely a means to an end.  I am here, I want to be there.  Having lived the last year without a car (my truck is in storage and will be for sale soon), I can say I don&#8217;t much care whether I get there in my car, or a taxi, or a zip car.  This is the benefit of modern urban living, I suppose.</p>
<p>So, just as I look at an automobile as a means to an end, I look at servers as a means to an end.  I guess that makes me a Software Guy.  I know there are Hardware Guys out there.  They&#8217;re doing great things and I&#8217;m thankful for them.  But, for the most part, I am interested in what computers can do for us, not how they do it.</p>
<p>I don&#8217;t think I&#8217;m alone in my attitude.  That&#8217;s why I think that computing as a commodity a strong future.  We can leave things like <a href="http://www.youtube.com/watch?v=zRwPSFpLX8I">data center efficiency</a> to someone else and focus on the things that are really important to us.  Oh, if you&#8217;re at facebook scale, you&#8217;re probably going to have to do <a href="http://www.facebook.com/note.php?note_id=76191543919&#038;ref=mf">serious cross stack optimization</a>.   And if you are at the hobby end, current cloud offerings may be pricy.</p>
<p>But, consider this.  What can you buy with $100,000 per year?  One programmer or 120 ec2 instances.  (more with reserved instance pricing.)</p>
<p><img src='http://www.procata.com/blog/wp-content/images/cloud.043.jpg' alt='Cloud Computing Versus Programming Talent' class='aligncenter' /></p>
<p>At a certain scale, cloud computing makes alot of sense.  $100,000 is just a number. Oh, I know, you have this guy in Belarus and he works for less.  But, the fundamental equation is the same.  Programming is expensive and computing power is a commodity.  Did I mention I&#8217;m a software guy?</p>
<p>Are you interested in how to use PHP in the cloud?  Clay Loveless recognized the advantages of cloud computing early, jumping on ec2 as one of the early adaptors.  He&#8217;s recently written a great <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2433">Introduction to AWS for PHP Programmers</a>.  I&#8217;d encourage you to check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2009/05/02/looking-towards-the-cloud/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>Holiday Tech Support</title>
		<link>http://www.procata.com/blog/archives/2009/04/11/holiday-tech-support/</link>
		<comments>http://www.procata.com/blog/archives/2009/04/11/holiday-tech-support/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 17:18:48 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[tech-support]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=294</guid>
		<description><![CDATA[I don&#8217;t see my family as often since I&#8217;ve moved to San Francisco.  This weekend I&#8217;m home for the Easter holiday.  Its nice to see everyone.  Additionally, I have a backlog of tech support for my parents and grandparents.  I&#8217;ve installed software purchased months ago, done updates that they weren&#8217;t even [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t see my family as often since I&#8217;ve moved to San Francisco.  This weekend I&#8217;m home for the Easter holiday.  Its nice to see everyone.  Additionally, I have a backlog of tech support for my parents and grandparents.  I&#8217;ve installed software purchased months ago, done updates that they weren&#8217;t even are of, installed a router and fixed rats nests of cables.  I&#8217;ve restored TV setups to working order and am about to fix a vacuum cleaner.  Are you the tech support guy for your family?  What are you fixing this weekend?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2009/04/11/holiday-tech-support/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Closures are coming to PHP</title>
		<link>http://www.procata.com/blog/archives/2009/03/22/closures-are-coming-to-php/</link>
		<comments>http://www.procata.com/blog/archives/2009/03/22/closures-are-coming-to-php/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 22:09:16 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[closures]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=293</guid>
		<description><![CDATA[Dagfinn has a post looking at using the new closure feature of PHP 5.3.  He compares using foreach for iteration versus array_map. &#8220;Interesting,&#8221; he concludes, &#8220;but not necessarily better than conventional alternatives.&#8221;
I agree for that case.  Consider instead, a more complicated operation that requires a setup and a tear down after.
&#160;
setup&#40;&#41;;
operation&#40;&#41;;
teardown&#40;&#41;;
&#160;
Now what happens [...]]]></description>
			<content:encoded><![CDATA[<p>Dagfinn has a <a href="http://blog.agilephp.com/2009/03/19/real-programming-with-php-53-part-1-array-processing/">post</a> looking at using the new closure feature of PHP 5.3.  He compares using foreach for iteration versus array_map. &#8220;Interesting,&#8221; he concludes, &#8220;but not necessarily better than conventional alternatives.&#8221;</p>
<p>I agree for that case.  Consider instead, a more complicated operation that requires a setup and a tear down after.<br />
<pre class="php">&nbsp;
setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
operation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
teardown<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre></p>
<p>Now what happens if we need to be able to customize operation?  That&#8217;s common enough, one way of doing this is to create a template method.</p>
<p><pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> MyExample <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> operation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> teardown<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> doit<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">setup</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">operation</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">teardown</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre></p>
<p>Now, we can subclass MyExample and override operation() with custom logic.  This is well and good, but what the customization we need is fairly small.  Creating a new class carries a certain weight.  Especially if you are religious about one class per file.  </p>
<p><pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> MyExampleExtension <span style="color: #000000; font-weight: bold;">extends</span> MyExample <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> operation<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">// custom logic</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre></p>
<p>Plus, you now have to deal with some creational patterns to make sure your custom class is used in the right context.</p>
<p><pre class="php">&nbsp;
<span style="color: #0000ff;">$myObject</span> = <span style="color: #0000ff;">$registery</span>-&gt;<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'MyExample'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$myObject</span>-&gt;<span style="color: #006600;">doit</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre></p>
<p>So, instead of encapsulating the pattern, its also very common to just copy and paste:</p>
<p><pre class="php">&nbsp;
setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
custom_operation1<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
teardown<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">//...</span>
setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
custom_operation2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
teardown<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre></p>
<p>But that&#8217;s not good on the duplicate code front.  So here is an alternate implementation, but using a <del datetime="2009-03-24T17:34:07+00:00">closure</del> anonymous function as a callback.</p>
<p><pre class="php">&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> MyExample2 <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> setup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> teardown<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> doit<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$operation</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">setup</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0000ff;">$operation</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0000ff;">$this</span>-&gt;<span style="color: #006600;">teardown</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;</pre></p>
<p>The advantage of MyExample2 is that extending is that the setup and teardown pattern is encapsulated in one spot.  You konw that if setup is called, teardown will also be called.  But, extending the operation is very light weight.</p>
<p><pre class="php">&nbsp;
<span style="color: #0000ff;">$myObject</span> = <span style="color: #000000; font-weight: bold;">new</span> MyExample2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$myObject</span>-&gt;<span style="color: #006600;">doIt</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">/* custom logic 1 */</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// ...</span>
<span style="color: #0000ff;">$myObject</span>-&gt;<span style="color: #006600;">doIt</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">/* custom logic 2 */</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre></p>
<p>There is  another significant benefit to this and that is locality of reference.  Here, the custom1 logic and the custom2 logic appears in context, not far away in some custom class or function declaration.  So you get encapsulation and reuse for the common code parts, but without the sprawl and overhead of declaring structures that will only be used once in a context far away their declaration.</p>
<p>Closures and anonymous functions decrease the activation energy to write good code.</p>
<p>That&#8217;s not to say that closures and anonymous functions can&#8217;t be abused.  If you keep seeing the same logic over and over in an anonymous block, you should probably give it a name in the form of a class, method or function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2009/03/22/closures-are-coming-to-php/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>php &#124; tek Wrapup</title>
		<link>http://www.procata.com/blog/archives/2008/05/26/php-tek-wrapup/</link>
		<comments>http://www.procata.com/blog/archives/2008/05/26/php-tek-wrapup/#comments</comments>
		<pubDate>Tue, 27 May 2008 05:57:30 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[phptek]]></category>
		<category><![CDATA[talks]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=290</guid>
		<description><![CDATA[I really enjoyed myself at this year&#8217;s php &#124; tek.  The conference seemed even better than last year.  Here are the slides from my talks&#8230;

Exceptional PHP
Coding for Success: Writing Software You’ll Be Able To Understand Next Month

Here are some of the books I mentioned&#8230;

Refactoring: Improving the Design of Existing Code
php&#124;architect&#8217;s Guide to PHP [...]]]></description>
			<content:encoded><![CDATA[<p>I really enjoyed myself at this year&#8217;s php | tek.  The conference seemed even better than last year.  Here are the slides from my talks&#8230;</p>
<ul>
<li><a href="http://www.procata.com/talks/phptek-may2008-exceptional.pdf">Exceptional PHP</a></li>
<li><a href="http://www.procata.com/talks/phptek-may2008-maintainable.pdf">Coding for Success: Writing Software You’ll Be Able To Understand Next Month</a></li>
</ul>
<p>Here are some of the books I mentioned&#8230;</p>
<ul>
<li><a href="http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology/dp/0201485672/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1211867585&#038;sr=1-1">Refactoring: Improving the Design of Existing Code</a></li>
<li><a href="http://www.phparch.com/c/books/id/0973589825">php|architect&#8217;s Guide to PHP Design Patterns</a></li>
<li><a href="http://www.amazon.com/PHP-Action-Objects-Design-Agility/dp/1932394753/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1211867300&#038;sr=1-1">PHP in Action: Objects, Design, Agility</a></li>
<li><a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1211867382&#038;sr=1-1">Design Patterns: Elements of Reusable Object-Oriented Software</a></li>
<li><a href="http://www.amazon.com/Implementation-Patterns-Addison-Wesley-Signature-Kent/dp/0321413091/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1211867430&#038;sr=1-1">Implementation Patterns</a></li>
<li><a href="http://www.amazon.com/Fundamentals-Object-Oriented-Design-Addison-Wesley-Technology/dp/020169946X/ref=sr_1_1?ie=UTF8&#038;s=books&#038;qid=1211867490&#038;sr=1-1">Fundamentals of Object-Oriented Design in UML</a></li>
</ul>
<p>I&#8217;m already looking forward to next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2008/05/26/php-tek-wrapup/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>php &#124; tek 2008</title>
		<link>http://www.procata.com/blog/archives/2008/05/20/php-tek-2008/</link>
		<comments>http://www.procata.com/blog/archives/2008/05/20/php-tek-2008/#comments</comments>
		<pubDate>Tue, 20 May 2008 16:17:31 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2008/05/20/php-tek-2008/</guid>
		<description><![CDATA[Well, I&#8217;ve made it to PHP&#124;tek in Chicago.  I flew in last night, had a beer with Jason and then used the WiFi in the lobby to spin up an extra large EC2 instance (via RightScale) to do some benchmarks for one of my talks.  I&#8217;m using the the XL instance because it [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.procata.com/blog/wp-content/uploads/2008/05/elephant.jpg' alt='PHP Elephant' align='right' hspace='20' />Well, I&#8217;ve made it to PHP|tek in Chicago.  I flew in last night, had a beer with <a href="http://blog.casey-sweat.us/">Jason</a> and then used the WiFi in the lobby to spin up an extra large EC2 instance (via <a href="http://www.rightscale.com/m/">RightScale</a>) to do some benchmarks for one of my talks.  I&#8217;m using the the XL instance because it it is <a href="http://oren.blogs.com/praxis/2008/04/the-amazon-ec2.html">not shared</a> with other users.</p>
<p>I&#8217;m still putting the final touches on my slides.</p>
<ul>
<li><a href="http://tek.phparch.com/c/schedule/talk/d1s6/1">Exceptional PHP</a></li>
<li><a href="http://tek.phparch.com/c/schedule/talk/d2s5/0">Coding for Success: Writing Software You&#8217;ll Be Able To Understand Next Month</a></li>
</ul>
<p>I&#8217;m blogging this from <a href="http://www.cdatazone.org/">Rob Richards&#8217;</a> Working With Web Services presentation.  Oh yeah, I work with Rob.  Oh yeah, since, I haven&#8217;t posted anything in six months &#8230;  In January, I moved to San Francisco and started work at <a href="http://www.mashery.com/">Mashery</a>.  I realized from talking with Jason last night that I really haven&#8217;t mentioned that here.  They&#8217;ve been keeping me pretty busy, hence the lack of blogging.</p>
<p>php|tek is <a href="https://twitter.com/phptek">on twitter</a>.  So, I&#8217;ve finally signed up <a href="http://twitter.com/Selkirk">there</a>.  I don&#8217;t get it.  <img src='http://www.procata.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One last thing, Mashery is <a href="http://www.mashery.com/jobs">Hiring</a> good PHP and Javascript programmers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2008/05/20/php-tek-2008/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Sarah Snow Stever</title>
		<link>http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/</link>
		<comments>http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 06:36:04 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/</guid>
		<description><![CDATA[
I am very sad.  Two weeks ago, my cousin Sarah had a stroke and died.  She was 35, two years younger than me.
As kids, Sarah and I, (along with her sister Rachel) would spend weeks in the summer staying at my grandparents house, playing and doing the things that ten year olds do [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.procata.com/blog/wp-content/uploads/2007/11/sarah-sm.jpg' title='Sarah'><img src='http://www.procata.com/blog/wp-content/uploads/2007/11/sarah-sm.jpg' alt='Sarah' /></a></p>
<p>I am very sad.  Two weeks ago, my cousin Sarah had a stroke and died.  She was 35, two years younger than me.</p>
<p>As kids, Sarah and I, (along with her sister Rachel) would spend weeks in the summer staying at my grandparents house, playing and doing the things that ten year olds do on a farm.  We sat around the campfire at family reunions.  We played cards and games, talked and argued.  I always looked forward to seeing all my cousins at holidays and family gatherings, but Sarah and Rachel were special then because they were closer to my age.</p>
<p>As adults, Sarah and I also did stuff together on occasion.  We still sat around the campfire at the family reunions and visited during the holidays.  But, we also went to bars and restaurants, Sarah always knew the best bars.  We went to Cedar Point and shared an automobile accident.  She would cut my hair and I would fix her computer. But mostly, we just talked.  Sarah was just plain easy to talk to and always interesting.</p>
<p>In recent years Sarah moved to Atlanta to build a life for herself there.  She opened a salon there and infused it with her character and personality.  It was a place where she was at home and happy.  I&#8217;m sure her clients felt happy and at home there as well. (<a href="http://ashleywebb.blogspot.com/2007/11/sarah-snow-stever.html">A client  remarks on Sarah&#8217;s passing</a>)</p>
<p>But, the most important thing about her move to Atlanta was meeting her husband, Kevin there.  I&#8217;ve only met Kevin a few times, but the one thing that I know about him is that he made Sarah happy.</p>
<p>I haven&#8217;t seen Sarah as much in the last few years.  Atlanta is far from Michigan and she disliked flying.  She came to fewer and fewer holiday functions.  Despite her many invitations to visit Atlanta, I didn&#8217;t go.</p>
<p>That is until September, when I went to the php|works conference in Atlanta.  One of the reasons I wanted to go to the conference was to be able to see Sarah.  After the conference, I stayed with her for a couple days.</p>
<p>Sarah showed me her Salon and I could see how much she loved it.  She introduced me to the dogs that she saved.  We went out to eat and visited the local Atlanta attractions.  But mostly, we talked.  We talked about family, dating, kids and careers.  We talked about her writing, the gym she liked, the church she had joined and the things she wanted to do.</p>
<p>Sarah tried very hard to convince me to move to Atlanta.  I think she felt that all I needed to do was to move there and I would meet the love of my life and l could live there happily to the end of my days.  After all, she did.</p>
<p>There is so much that I still want to do with Sarah.  I feel like I&#8217;ve always taken it for granted that that she would be around for us to &#8220;do that later.&#8221;  I guess not.  I&#8217;ll miss Sarah.</p>
<p><a href="http://obits.mlive.com/AnnArbor/DeathNotices.asp?Page=Lifestory&#038;PersonId=97964436">Sarah&#8217;s obituary</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2007/11/23/sarah-snow-stever/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Benchmarking PHP&#8217;s Magic Methods</title>
		<link>http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/</link>
		<comments>http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/#comments</comments>
		<pubDate>Mon, 05 Nov 2007 00:01:02 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[performance-optimization]]></category>
		<category><![CDATA[profiling]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/</guid>
		<description><![CDATA[Larry Garfield has an interesting set of benchmarks covering many of PHP&#8217;s magic methods.  His results correspond pretty well to my own benchmarks in the area.  The thing to take away is that its not necessarily the overhead of the magic methods, but rather what you do inside them.  Its hard to [...]]]></description>
			<content:encoded><![CDATA[<p>Larry Garfield has an interesting <a href="http://www.garfieldtech.com/blog/magic-benchmarks">set of benchmarks</a> covering many of PHP&#8217;s <a href="http://php.net/oop5.magic">magic methods</a>.  His results correspond pretty well to my own benchmarks in the area.  The thing to take away is that its not necessarily the overhead of the magic methods, but rather what you do inside them.  Its hard to do anything useful inside a magic method, such as __get or __call that isn&#8217;t <b>10 to 20 times slower</b> than the &#8220;non-magic&#8221; solution.</p>
<p>There are probably more than a few naive programmers who would read results like this and start to avoid these constructs in their own code for performance reasons.  These are the same kinds of people obsessing over a few single or double quotes, who eschew &#8220;slow&#8221; objects in favor of switch statements that are many times slower than the polymorphic method calls they are trying to avoid.</p>
<p>But, that&#8217;s not the end of the story.  Larry ran his benchmarks using 2,000,000 iterations.  The <b>N</b> really matters here.  Sure, iterators are slower than arrays, but you aren&#8217;t going to be iterating over two million things.  I tend to fetch my database records in lots of 25 or 50.  You aren&#8217;t going to be making two million invocations of __call.  But how many will you make?  Under what value of N does the performance of these techniques cease to matter?  Is it ten, one hundred, one thousand, or ten thousand?  You may be surprised at how few calls your program actually does and how little impact it has on performance.</p>
<p>As <a href="http://netevil.org/">Wez</a> and <a href="http://www.travisswicegood.com/">Travis</a> point out in their comments, profiling is the way to find out the potential impact and to discover your true N.</p>
<p>Paul M. Jones has a <a href="http://paul-m-jones.com/blog/?p=182">good example</a> of what I&#8217;m talking about.  There, call_user_func_array appears to be a bottleneck, but it turns out that its the function being called, htmlspecialchars, not the calling process that consumes the balance of the time.  In that case, the function was &#8220;only&#8221; called 300 times.  I find that order of magnitude to be fairly typical.  Something to be aware of, perhaps, but not something to obsess over.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2007/11/04/benchmarking-phps-magic-methods/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>The Endpoints of the Scale of Stupidity on Video</title>
		<link>http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/</link>
		<comments>http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 20:55:22 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/</guid>
		<description><![CDATA[A quote from Cal Henderson (via simonwillison) presents a &#8220;Web Application Scale of Stupidity:&#8221;

&#124; OGF (One Giant Function) ---- Sanity ---- OOP (Object Oriented Programming) &#124;

The scale that Cal is talking about is actually better known as modularity:

&#124; Few large modules ----  Sanity? ---- Many Small Modules &#124;

If you haven&#8217;t listened to Alan Kay [...]]]></description>
			<content:encoded><![CDATA[<p>A quote from Cal Henderson (via <a href="http://simonwillison.net/2007/Nov/2/cal/">simonwillison</a>) presents a &#8220;Web Application Scale of Stupidity:&#8221;<br />
<code><br />
| OGF (One Giant Function) ---- Sanity ---- OOP (Object Oriented Programming) |<br />
</code></p>
<p>The scale that Cal is talking about is actually better known as <a href="http://sunnyday.mit.edu/16.355/parnas-criteria.html">modularity</a>:</p>
<p><code><br />
| Few large modules ----  Sanity? ---- Many Small Modules |<br />
</code></p>
<p>If you haven&#8217;t listened to Alan Kay talk about the benefits of many small modules, you should do so now.  Alan Kay coined the term Object Oriented.  Love OO or hate OO, if you have an opinion on it, you should know what he was thinking.  Hint, it wasn&#8217;t C++.</p>
<p><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-2950949730059754521&#038;hl=en" flashvars=""> </embed></p>
<p>On the other end of the scale, One Giant Function is generally known as <a href="http://www.laputan.org/pub/foote/mud.pdf">Big ball of Mud</a>(PDF)  Here is Brian Foote&#8217;s presentation on the paper (read the paper first).</p>
<p><embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=8693679271218408739&#038;hl=en" flashvars=""> </embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2007/11/02/the-endpoints-of-the-scale-of-stupidity-on-video/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

