Edward Barnard

Headshot of Edward Barnard

Ed Barnard had a front-row seat when the Morris Worm took down the Internet, November 1988. He was teaching CRAY-1 supercomputer operating system internals to analysts as they were being directly hit by the Worm. It was a busy week! Ed continues to indulge his interests in computer security and teaching software concepts to others.

twitter: @ewbarnard


Design Patterns by Moonlight: The Dragon Wrangling Pattern

By Edward Barnard

I’ve seen many instances of “gatekeeping” now, in the 2020s. Senior developers warn “there be dragons” while announcing a “hands off” policy toward critical areas of their code base. The code has become too fragile to touch, too costly to change. The Dragon Wrangling Pattern provides a framework for allowing newer developers, or persons new to the project, to contribute with much-lessened risk.

Published in Decrypting Cryptography, October 2021

Design Patterns by Moonlight: When There Be Dragons

By Edward Barnard

As our codebases become ever more complex, the cost of change rises as well. Any change or enhancement carries a risk of breaking something else. The problem is even more acute for people new to the project who’ve not yet learned the pitfalls waiting in that particular codebase. This month we’ll be examining the problem and considering a solution. Next month we’ll see a solution as a straightforward pattern.

Published in It’s Really an Upgrade, September 2021

Design Patterns by Moonlight: How I Do Interfaces

By Edward Barnard

How do the building blocks come together to form a whole? Most resources on Design Patterns look at each pattern in isolation, allowing you to focus on the pattern and its uses without being distracted by side issues. What’s missing, I have found, are examples of fitting those patterns into a working system. This month we’ll look at a feature involving the validation of user input. We’ll be using the PHP interface in quite a few different ways as we build out that feature.

Published in Trimming One’s Sails, August 2021

Sustainable PHP: Soylent Green

By Edward Barnard

Like many programmers, I am not a “people” person, but this article is about people. First, how might you discern what “people” aspects of your project are essential? Here’s my approach. Second, how might people inspire you and help make what you do more fun? We’ll see my approach as we make the transition from abstract discussions back to concrete details.

Published in Deep Dive Into Search, July 2021

Sustainable PHP: Wizard Thinking

By Edward Barnard

This month, we’re indulging in a bit of magic and a bit of weirdness. That’s my way of explaining what I call Wizard Thinking, something I’ve found to be an instrumental skill indeed.

Published in Testing Assumptions, May 2021

Sustainable PHP: Machine Learning and Yoda

By Edward Barnard

When you encounter extremely costly errors, take steps to prevent the error from happening in the future. The earlier we catch an error, the less expensive it is to fix. Here we discuss two costly situations: a typo in an if statement and upcoming PHP 8 breaking changes.

Published in Busy Worker Bees, April 2021

Sustainable PHP: When the World Shifts

By Edward Barnard

Last month, we used Herbert O. Yardley’s “The Education of a Poker Player” to learn about testing business rules. This month we’ll explore what happened when the world shifted, and Yardley lost not just his job but his career. The lesson here will be “don’t be like Yardley”—yet Yardley’s story is, by all accounts, fascinating. Agnes (Meyer) Driscoll, like Yardley, was breaking codes on behalf of the USA. The world, too, passed her by. She failed to make the transition from pencil-and-paper to digital computing. Yet she’s fondly remembered as “the neglected giant.” We’ll begin with my own story of how my world shifted at the turn of the Millennium, bringing me to PHP.

Published in Lambda PHP, March 2021

Sustainable PHP: Testing Business Rule

By Edward Barnard

There’s an old joke that runs, “We just got a new project. You two start coding while I go find out the requirements.” This month we talk about evaluating and implementing business rules, thus meeting project requirements. We focus on discerning what’s important and what isn’t, and recognizing interactions that can quickly get out of hand. For our working example, we’ll be evaluating standard poker hands. Well-known card games make great examples because they’re easily understood by non-technical people, and it’s instantly apparent whether something is modeled correctly or not.

Published in Dealing with Data, February 2021

Sustainable PHP: Database Playback Testing

By Edward Barnard

While completing the Deep Analysis we discussed last month, I was faced with the inability to test. That’s because—I discovered–accounting data cannot be erased—even in the sandbox. There’s no way to begin each test with a clean test environment. This month we walk through a relatively convoluted solution. We’ll capture the accounting data as we send it through the API, along with capturing data at various points along the way.

Published in Newfangled Views, January 2021

Sustainable PHP: Deep Problem Analysis

By Edward Barnard

Sometimes, I need to write experimental code in order to explore and understand how the system works. This is particularly true when dealing with third-party software. Sometimes those experiments become large with many thousands of lines of “experimental” code. Here are my principles and guidelines for making that experimental code a success.

Published in PHP 8 Bits and Git, December 2020

Sustainable PHP: Developing Domain Events

By Edward Barnard

Domain Events are one of the mainstays of modern Domain-Driven Design. They’re powerful, simple, useful. However, when developing them, we need to consider infrastructure. We’ll examine the need for explicit database transactions, view a table design, and provide a way to do our future selves a favor!

Published in SOLID Foundations, November 2020

Sustainable PHP: Refactor to Competitive Advantage

By Edward Barnard

Technical debt is always, and continuously, a challenge. Needs change. This month we’re looking at an approach for being continually prepared for change—refactoring, with unit tests in place.

Published in Running Parallel, October 2020

Sustainable PHP: Build A Composite

By Edward Barnard

How might we keep the next PHP project from evolving into the dreaded Big Ball of Mud? This month we’ll explore and build a possible foundational structure, a “composite.” Then, having built out this structure, we’ll realize that we might still be over-engineering things a bit—but this structure remains a necessary step along the way.

Published in Under the Scope, September 2020

Sustainable PHP: The Quest

By Edward Barnard

This month, “The Quest,” takes us on a quest to avoid the Big Ball of Mud. We’ll begin by learning what the Big Ball of Mud is. Our quest will discover that Domain-Driven Design (DDD) can be our solution, but the current state of the art does not quite (to the best of my knowledge) “bridge the gap” between pure DDD and our typical framework-based PHP development. Next month, in “Build a Composite,” we’ll explicitly bridge that gap with PHP code using a standard PHP framework.

Published in Data Discipline, August 2020

Sustainable PHP: We Got Robbed

By Edward Barnard

Modern PHP software is well capable of large projects. We, therefore, need to approach architecture and design thoughtfully. That observation, unfortunately, runs at odds with our current “agile” methodologies. Here, we take a look at what went wrong and how it got that way. We’ll see the solution is “obvious.”

Published in Warp Driven Development, July 2020

Sustainable PHP: The Cost of Change

By Edward Barnard

PHP projects generally focus on rapid development. The PHP ecosystem allows us to develop new ideas in mere hours or even minutes. However, over the years, many PHP projects reach the point where changes take radically longer. There’s a high risk of breaking something else—which is the worst possible outcome when the company depends on that online presence. Here we start at the beginning with the Manifesto for Agile Software Development.

Published in Advanced Design & Development, June 2020

History and Computing: Transcontinental Railroad

By Edward Barnard

We’re looking at the background behind the U.S. Department of Justice plan to consider antitrust action against the giants of high tech. We’ll see how ocean transportation gave way to transcontinental transportation. That’s the background we’ll need for seeing how transcontinental transportation became the antitrust action that’s setting a precedent for big tech.

Published in Unsupervised Learning, May 2020

History and Computing: Silicon Valley Takedown

By Edward Barnard

On November 18, 2019, U.S. Deputy Attorney General Jeffrey A. Rosen laid out a game plan dealing with tech giants such as Amazon, Apple, Facebook, and Google actively killing competition and forming monopolies. Congress has discussed the possibility of needing new laws to deal with advancing technology. Rosen’s speech, by contrast, showed us our current laws have already proven themselves up to the task of returning high tech to being fair and competitive. Should “big tech” change in a significant fundamental way, that affects all of us.

Published in Machine Learning and OpenAPI, April 2020

History and Computing: My NSA Mug Shot

By Edward Barnard

The secret to finding and fixing the problem was in discerning patterns in the noise. I can’t share the actual code that fixed the problem. What I can do, though, is walk you through an exercise in finding patterns in the noise of a seemingly-random number. We’ll have fun!

Published in How Magento is Evolving, March 2020

History and Computing: The Y2K Deadline

By Edward Barnard

Twenty years later, we’ve mostly forgotten Y2K. Nothing happened. However, there were years of effort behind the non-event. Corporate delay made the endeavor far more complicated because skills had not been passed along to the next generation. What was so difficult? I’ll show you, with a few lines of code from my piece of Y2K.

Published in Cultivating the Developer Experience, February 2020

History and Computing: Mastering the Craft

By Edward Barnard

Truly mastering a skill means passing that skill onto others. What if the skill is so prohibitively difficult it’s not possible to pass on, not in your lifetime? Nathaniel Bowditch faced this problem 225 years ago. We’ll see the problem and how difficult it was. We’ll see how Bowditch created a way which each of us can emulate today.

Published in New Habits, January 2020

Pragmatic PHP: Abstract Thinking

By Edward Barnard

Software is built of abstractions layered on top of more abstractions. We, therefore, all do abstract thinking one way or another. But there is one form of abstract thinking which can help us to understand—and communicate—how the whole system works. We’ll use the flow of a river as an analogy to help communicate that type of understanding.

Published in Expedition PHP, December 2019

Pragmatic PHP: Think Like a Computer

By Edward Barnard

There’s a skill fundamental to software development I’ve always found useful. This skill is essential when working with every programming language, including PHP and when working across PHP frameworks. Like all skills, mastery comes from study and practice. We’ll even discuss how beginners can practice this skill with just HTML and CSS.

Published in Object Orientation, November 2019

Pragmatic PHP: Testing Singletons

By Edward Barnard

This month wraps up our singleton coverage. We’ll see the self registry variant (a self-contained registry pattern implementation). We’ll find ways to test singletons and learn how to test database memoization without requiring an actual database.

Published in Coding Without Fear, October 2019

Pragmatic PHP: Studying Singletons

By Edward Barnard

Practice makes perfect, except when writing PHP code! Our new column Pragmatic PHP explains patterns and variations I’ve used over the years. The better we understand a pattern, the better we can successfully solve the problem before us. This month we’ll take a deep dive into the Singleton Design Pattern. Even though it’s generally considered an anti-pattern, we’ll see useful variations I use time and again. Can global state, static methods, and properties be unit tested? Certainly. We’ll see how.

Published in Master of Puppets, September 2019

Internal Apparatus: Generated Singletons

By Edward Barnard

This month we study the Singleton Design Pattern, but with a twist. We start with a correct implementation but get it wrong by refactoring. We’ll examine the PHP generated code, each step of the way, to understand what went wrong. We’ll observe at least two reasons the Singleton Design Pattern is now considered an anti-pattern. We’re preparing to learn useful variations next month by seeing precisely how it works under the hood.

Published in Renovating Applications with Symfony, August 2019

Internal Apparatus: A Walk Through the Generated Code

By Edward Barnard

The PHP compiler/interpreter reads through our PHP code and produces an intermediate form. PHP’s virtual machine then interprets this intermediate form. PHP’s “generated code” feature allows us to walk through this intermediate form, better understanding exactly what PHP does with the software we write. We’ll begin with a three line example, observing the generated-code changes as we transform our example into a function call and then a static method call. We’ll implement a recursive algorithm to see how the code generator handles the situation.

Published in Find the Way With Elasticsearch, July 2019

Internal Apparatus: Memoization

By Edward Barnard

Memoization is another form of memory use. I see it regularly used for improving application performance, but it’s also used to improve compiler performance. To learn the concept, we’ll use a PHP project with database tables, then look at other ways to use the technique.

Published in How to Tame Your Data, June 2019 —Available for Free

Internal Apparatus: Memory Abstractions

By Edward Barnard

We normally don’t care about abstractions in software, because they exist to hide details we shouldn’t need to care about. However, sometimes, we do need to know the detail. An essential part of how PHP works involves memory management. This month we’ll see new ways to think of memory itself; we’ll also introduce a learning tool we’ll be using in upcoming articles. We’ll be simulating an ancient mainframe computer, and its hard-wired operator console, using modern text messages.

Published in Serverless, ReactPHP, and Expanding Frontiers, May 2019

Internal Apparatus: Patterns in the Code

By Edward Barnard

The PHP compiler source code includes many patterns that can be frustrating and intimidating, because they are so different from typical PHP code, until we understand the structure and context. C’s preprocessor has a significant role in these unfamiliar patterns. We look at several of these patterns in the compiler’s PHP Array implementation.

Published in The New Frontend Fundamentals, April 2019 —Available for Free

Internal Apparatus: Hash Table Collisions

By Edward Barnard

We continue our deep dive into how PHP implements arrays as hash tables. We’ll see how the collision chain works. We’re not ready to dig into the C implementation just yet, so we’ll see how to build and rebuild the hash table using PHP code. This month we’re learning how PHP arrays are stored and manipulated; next month we’ll see the C code itself.

Published in Building Bridges, March 2019

Internal Apparatus: Beginning the Deep Dive

By Edward Barnard

Understanding C code requires far more than understanding the language syntax—we need to understand the environment and context. Along the way, we’ll learn more about how computers work. We’ll be taking a deep dive into how PHP implements arrays. We begin our deep dive this month by looking at the PHP executable file and PHP’s packed hash table.

Published in Out on a Limb – February 2019, February 2019

Internal Apparatus: How PHP Works: Show Me the Code

By Edward Barnard

We all use PHP; it’s open source, which means anyone can take a look. However, it’s not as easy as with the various PHP frameworks, because PHP is written in C and makes heavy use of C preprocessor macros. We’ll see it’s relatively readable once we know how and where to look.

Published in DevOps Depths – January 2019, January 2019

Education Station: Interview Coding Challenges

By Edward Barnard

Meanwhile, the days where employees stay with the same company 20-30 years are long gone. We move around or move on from contract to contract. For many of us, this means formal job interviews. Many of those interviews include coding challenges; that can be a problem. Let’s talk about that!

Published in Better Practice – December 2018, December 2018

Education Station: The Day the Internet Died

By Edward Barnard

The more things change, the more they remain the same. We’re taking a 30th Anniversary Tour of the Morris Worm. We’ll find that the same attacks and defenses remain in use today. It behooves us all, as modern software developers, to understand our history.

Published in Generics and Project Success – November 2018, November 2018

Education Station: Producer-Consumer Programming Techniques

By Edward Barnard

This month we have a “cookbook” of producer-consumer programming examples. We work through a complete example of timing production web page loads. We then consider techniques for message versioning, funneling, and feature migration.

Published in Internal Journeys – October 2018, October 2018

Education Station: Producer-Consumer Programming

By Edward Barnard

Producer-consumer programming is an excellent technique for offloading work from your main application. You can scale resources to meet increased demand. You can smooth out spikes by placing your backlog in a queue. You can set aside long-running tasks such as thumbnail generation. We’ll develop a simple CakePHP application that produces and consumes via a free CloudAMQP (RabbitMQ) account. Although we use CakePHP, the principles are universal to any modern PHP framework.

Published in Magniphpicent 7.3 – September 2018, September 2018

Education Station: That’s Logical

By Edward Barnard

This month we practice working “close to the hardware.” We’ll see why this is becoming more important to today’s software developers. We’ll use the PHP bitwise operators to manipulate single-bit binary numbers. We’ll then take a more general look at ways to learn what we need to learn.

Published in Masterful Code Management – August 2018, August 2018

Education Station: Build an Algorithm

By Edward Barnard

If you have trouble making change for a dollar without a calculator, and don’t care, this article may not be for you. Otherwise, come along with me! We’ll be converting between numbering systems. We’ll create an algorithm for converting between decimal (integer) and hexadecimal numbers.

Published in Navigating State – July 2018, July 2018

Education Station: Build an API, Part Three

By Edward Barnard

In this series, we look at using Behavior-Driven Development (BDD) and specification by example to develop a RESTful API. In Part Three, we focus on the HTTP verbs directing any RESTful API. Understanding where and when to use HTTP verbs will inform how we structure our API and affects the developer experience.

Published in Command and Control – June 2018, June 2018

Education Station: Build an API, Part Two

By Edward Barnard

In this series, we look at using Behavior-Driven Development (BDD) and specification by example to develop a RESTful API. In Part Two we introduce Behavior-Driven Development as a way of communicating with non-developers, our stakeholders.

Published in Treasure, Old & New – May 2018, May 2018

Education Station: Build an API, Part One

By Edward Barnard

In this series, we look at using Behavior-Driven Development (BDD) and specification by example to develop a RESTful API with JSON-formatted request and response. In Part One we introduce these concepts, design our database, and implement a minimal working API.

Published in Testing in Practice – April 2018, April 2018

Twitter for PHP Development

By Edward Barnard

The Internet Research Agency indictment carries strong implications for the software development community. We’ll educate ourselves by drilling down into examples of computational propaganda with Twitter. Then, we’ll relax and learn how we can use Twitter to further our professional development by connecting to the greater PHP community.

Published in Long Running PHP, March 2018

Education Station: Shifting and Masking with a Side of Crypto

By Edward Barnard

The basics can be tricky. This month we take a careful walk-through of a few lines of cryptographic code in PHP. This leads us through the difference between ones’ complement and two’s complement representation. We achieve weirdness by combining logical AND with integer addition.

Published in Know Your Tools, February 2018 —Available for Free

Education Station: What is a Real Programmer?

By Edward Barnard

We expect a shortage of software engineering talent in 2018. Those with a deeper understanding of how things work will most benefit from the shortage. Let’s bring in 2018 by taking on one of those fundamentals, binary arithmetic, but with a twist: We’ll use XOR and AND logic for our implementation.

Published in Setting Up to Succeed, January 2018

Learning Machine Learning, Part Three: Data Wrangling

By Edward Barnard

Part One and Part Two of Learning Machine Learning explored the machine learning (ML) workflow. We built and evaluated a K-nearest neighbors classification model. By far the most work for this classification project, behind the scenes, has been wrangling the input and output data. Since this sort of PHP/MySQL data wrangling is nothing like building a website, we’re using Part Three to build our wrangling skills.

Published in Talking Code, December 2017