<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Paul M. Jones | Legacy</title>
    <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;tag&#x2F;legacy&#x2F;" />
    <updated>2026-05-08T09:12:58-05:00</updated>
            <entry>
        <title>Hacking, Refactoring, Rewriting, and Technical Debt</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2017&#x2F;09&#x2F;05&#x2F;hacking-refactoring-rewriting-and-technical-debt&#x2F;" />
        <updated>2017-09-05T07:00:59-05:00</updated>
        <summary>(Not so much &quot;lessons&quot; here, as &quot;observations and recollections.&quot;)
I.
From ESR, How To Learn Hacking:



Hacking is done on open source. Today, hacking skills are the individual micro-level of what is called âopen source developmentâ at the...</summary>
    </entry>
            <entry>
        <title>How Terrible Code Gets Written By Perfectly Sane People</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2017&#x2F;08&#x2F;29&#x2F;how-terrible-code-gets-written-by-perfectly-sane-people&#x2F;" />
        <updated>2017-08-29T07:00:39-05:00</updated>
        <summary>From Christian Maioli Mackeprang, the following:

Legacy code can be nasty, but Iâve been programming for 15 years and only a couple of times had I seen something like this. The authors had created their own framework, and it was a perfect storm...</summary>
    </entry>
            <entry>
        <title>Efficient use of mysqli_result::$num_rows</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2016&#x2F;12&#x2F;22&#x2F;efficient-use-of-mysqli-resultnum-rows&#x2F;" />
        <updated>2016-12-22T09:35:25-06:00</updated>
        <summary>I frequently see this pattern in legacy applications using mysqli:
$result = $mysqli-&amp;gt;query(&quot;
    SELECT *
    FROM table_name
    WHERE conditions = &#039;whatever&#039;
&quot;);
if ($result &amp;amp;&amp;amp; $result-&amp;gt;num_rows &amp;gt; 0) {
    return;
}

The developer...</summary>
    </entry>
            <entry>
        <title>Exporting Globals in PHP</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2016&#x2F;08&#x2F;09&#x2F;exporting-globals-in-php&#x2F;" />
        <updated>2016-08-09T09:43:29-05:00</updated>
        <summary>I am currently modernizing a legacy PHP application for a client. (The codebase was written earlier this year, in fact; new code can be &quot;legacy&quot; from the outset.) The original developer pulled a dirty trick with global that I had not seen before, and...</summary>
    </entry>
            <entry>
        <title>Why Do PHP Developers Think MVC Is An Application Architecture?</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2016&#x2F;03&#x2F;15&#x2F;why-do-php-developers-think-mvc-is-an-application-architecture&#x2F;" />
        <updated>2016-03-15T11:15:12-05:00</updated>
        <summary>I’ve pointed out before that Model-View-Controller is a user interface pattern, not an application architecture. But why would PHP developers get the idea that MVC is an application architecture in the first place? (This may apply to all server-sid...</summary>
    </entry>
            <entry>
        <title>Configuration Values Are Dependencies, Too</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2015&#x2F;12&#x2F;08&#x2F;configuration-values-are-dependencies-too&#x2F;" />
        <updated>2015-12-08T10:15:49-06:00</updated>
        <summary>As part of my consulting work, I get the opportunity to review lots of different codebases of varying modernity. One thing I’ve noticed with some otherwise-modern codebases is that they often “reach out” from inside a class to retrieve configur...</summary>
    </entry>
            <entry>
        <title>Modernizing Serialized PHP Objects with class_alias()</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2015&#x2F;06&#x2F;30&#x2F;modernizing-serialized-php-objects-with-class-alias&#x2F;" />
        <updated>2015-06-30T09:14:58-05:00</updated>
        <summary>Several weeks ago, a correspondent presented a legacy situation that I&#039;ve never had to deal with. He was working his way through Modernizing Legacy Applications in PHP, and realized the codebase was storing serialized PHP objects in a database. He co...</summary>
    </entry>
            <entry>
        <title>MLAPHP Boot Camp!</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2015&#x2F;06&#x2F;23&#x2F;mlaphp-boot-camp&#x2F;" />
        <updated>2015-06-23T10:50:14-05:00</updated>
        <summary>You may have seen my introductory talk on steps toward modernizing a legacy application at Nashville PHP or at php[world]. That was the presentation that formed the first few chapters of Modernizing Legacy Applications in PHP.
The MLAPHP book has bee...</summary>
    </entry>
            <entry>
        <title>Modernizing Legacy PHP: From Service Locator To Dependency Injection</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2014&#x2F;06&#x2F;23&#x2F;moderizing-legacy-php-from-service-locator-to-dependency-injection&#x2F;" />
        <updated>2014-06-23T08:23:56-05:00</updated>
        <summary>In an earlier article I described how to start moving away from singletons in favor of dependency injection. It occurs to me that the process for moving away from Service Locator is almost exactly the same, except that we use the container outside th...</summary>
    </entry>
            <entry>
        <title>Legacy Refactor Question: What About Singletons?</title>
        <link href="http&#x3A;&#x2F;&#x2F;paul-m-jones.com&#x2F;post&#x2F;2014&#x2F;06&#x2F;03&#x2F;legacy-refactor-question-what-about-singletons&#x2F;" />
        <updated>2014-06-03T10:36:10-05:00</updated>
        <summary>In my talk and my book on refactoring legacy PHP code, one of the early steps is to start removing globals and replace them with dependency injection (not a container, just injecting dependencies by hand.)  I addressed the use of the global keyword a...</summary>
    </entry>
    </feed>
