Hi, I'm Matthieu Napoli!

These are thoughts and experiments about web development and programming.

17 May 2018

Serverless and PHP: introducing Bref

Serverless basically means “Running apps without worrying about servers”. Obviously there are still servers involved, the main difference is that you do not maintain the servers and reserve their capacity. They are scaled up or down automatically and you pay only for what you use.

This article intends to explain what serverless means for web applications and more specifically for PHP.

02 November 2017

My "speaker checklist"

I follow a checklist whenever I am planning to speak at a conference. I am sharing it so that hopefully it can help you too.

The steps marked with 💥 are the one I failed before and don’t want to fail again :) It also let me justify why something that sounds silly may be part of the list!

The checklist is quite long and might seem paranoid or more stressful than helpful, but it’s actually the contrary: the more you anticipate things, the less reasons you have to stress.

19 June 2017

Using non-breakable spaces in test method names

Yes. This article is about using non-breakable spaces to name tests. And the fact that it’s awesome. And why you should use them too.

public function test a user can add a product to a wishlist()
    // ...

The code above is valid PHP code and works. Non-breaking spaces (aka   in HTML) look like spaces in editors but are actually interpreted like any other character by PHP.

12 November 2015

Approaching coding style rationally

Let’s talk about how to format code and name things.

I remember when PSR-1 and PSR-2 became a thing. Jeez that “use only spaces” thing was just ridiculous, I knew that tabs where better (right?). And those crazy formatting rules were the opposite of what I was used to. Nonsense! One day I did the jump and after a few weeks, I just didn’t care anymore. I was over it, just like everyone else did, and PSR-2 was my new religion.

Fast forward a few years and I’m at a talk where the speaker argues to use snake case for naming test methods. Dude, you crazy? We just finally got consistent style across all the PHP world! And we all know that camelCase looks much better right? How can I go against PSR-2? It turns out, after trying it, that this was a wonderful idea…

Habits are sometimes making us blind. We think X looks prettier than Y but that’s just the habit speaking. In this article I’ll try to take a rational approach at coding style. That means leaving the “it looks ugly/better” at the door.

12 April 2015

Silly CLI 1.1 comes with dependency injection

I have just released Silly CLI 1.1 and I think it’s awesome, here’s why.

What is Silly?

If you missed it, Silly is a small project I started a month ago. The idea is simple: it is a CLI micro-framework.

Much like Silex or Slim let you create a web application in a single file using closures as controllers, Silly let you create a CLI application in a single file using closures as commands:

$app = new Silly\Application();

$app->command('greet [name] [--yell]', function ($name, $yell, $output) {
    $text = $name ? 'Hello '.$name : 'Hello';
    if ($yell) {
        $text = strtoupper($text);