Web development

All about everyone's favorite pseudo-platform, the World Wide Web.

Book review: Functional Programming in PHP

I was asked by php[architect] a while back to review "Functional Programming in PHP, 2nd Ed" by Simon Holywell. I've been sitting on this review for a while, so it's time to finally get it done.

Continue reading this review on SteemIt.

Larry 12 November 2018 - 4:29pm
Don't use mocking libraries

I am all for testing. Whether you always write unit tests in advance as Test Driven Development (TDD) advocates call for, write them after, write them alongside, a little of each, I don't care. Tests are your friend. You want tests, and specifically you want good tests.

There's a lot of opinions on what constitutes a "good" test, of course, and much is subjective to the type of code you're working on. However, since the release of PHP 7 I've found that while writing tests... I am never using a mocking library. In fact, I'm going to go as far and say that

Larry 14 September 2018 - 7:25pm
Never type hint on arrays

Let's be controversial: In modern PHP, you should never type-hint an array.

Before you start throwing tomatoes, hear me out.

Continue reading on Steemit

Larry 27 July 2018 - 11:18pm
Quick and easy PHP code generation testing

Recently I was working on some PHP code (for the PHP-FIG) that involved code generation. Lots of systems these days are doing code generation (compiled dependency injection containers, ORM classes, etc.), but surprisingly I've avoided having to touch that code myself until now.

Of course, like any good developer I was writing tests for it as I went. That meant needing to test that the generated code was valid PHP syntax and did what I wanted it to do.

(Continue reading this post on Steemit.)

Larry 22 June 2018 - 9:40pm

Moving to a new Platform

Submitted by Larry on 2 May 2016 - 10:02am

After my last post, a number of people asked if I was leaving Drupal all together. Perish the thought. :-) However, after a decade at Palantir.net and the five-year Wagnerian Saga that was the Drupal 8 development cycle (complete with singing), I have been asking myself "What next?"

Well, what do I like to do? I like to build. I like to teach. I like to make things better. I like to work with smart people, as colleagues, as community partners, and as customers. I want to be able to have an impact in making something better for other people.

To that end, I am pleased to announce that today is my first day as Director of Runtimes, Integrations, Engines, and Services for Platform.sh.

Anyone can code

Submitted by Larry on 24 December 2015 - 5:22pm

One of Pixar's best movies is the 2007 "Ratatouille", the story of a rat named Remy who teams up with an unskilled nobody human to become a gourmet chef. Toward the climax of the film (spoiler alert!), the uber-critic Anton Ego visits their restaurant and is blown away by the quality of the food, producing the next day a genuinely humble and reflective review. While the whole review is one of the highlights of the film, there's one segment in particular I want to call out:

In the past, I have made no secret of my disdain for Chef Gusteau's famous motto, "Anyone can cook." But I realize, only now do I truly understand what he meant. Not everyone can become a great artist; but a great artist can come from anywhere. [emphasis added]

It's one of the central themes of the film, and Pixar I believe captures that line beautifully. It's true, not everyone is a good cook. Not everyone can be a good cook. However, good cooks come from a myriad of sources and backgrounds (and apparently species).

And the same concept applies to almost any skilled field, including that of programming.

Drupal 8: Happy, but not satisfied

Submitted by Larry on 3 December 2015 - 2:55am

Two weeks ago (hey, I've been busy and trying to sleep for once), after 1716 days of work by more than 3312 people the Drupal community finally released Drupal 8, the latest release of the best community-driven web software in the world. The blogosphere is already filled with congratulatory blog posts celebrating the immense accomplishment, and deservedly so.

A number of people recently have asked me how I feel about Drupal 8's release, especially around the PHP community. Overall, my answer has to be that I'm happy, but not satisfied.

Just how insular is the PHP community?

Submitted by Larry on 24 August 2015 - 4:21pm

Periodically, there is a complaint that PHP conferences are just "the same old faces". That the PHP community is insular and is just a good ol' boys club, elitist, and so forth.

It's not the first community I've been part of that has had such accusations made against it, so rather than engage in such debates I figured, let's do what any good scientist would do: Look at the data!

Update 2015-08-25: The Joind.in folks have given me permission to release the source code. See link inline. I also updated the report to include a break down by continent.

The next era of PHP

Submitted by Larry on 30 May 2015 - 6:57pm

2015 is turning into a watershed year for PHP. Many projects either have or will release new major versions, including Zend Framework, Symfony, Laravel, Guzzle, Drupal, Slim, and many others. And of course there's PHP 7 itself, coming this fall.

I'll talk more on those later, but for the moment I want to focus on one other major new development this year: PSR-7.