Posts

The modern PHP developers toolbox

The tools a modern PHP developer needs to strive.

Apr 26, 2019

What Is Big O
What Is Big O

Big O is used to notate the 'time and space complexity' of algorithms. It provides us with key insights into how fast an algorithm is, without getting bogged down with details.

Feb 12, 2019

Running Homestead from a separate directory

When creating a PHP website, there is a good chance that you wish to use a virtual machine. This has many benefits, like managing multiple versions of php, or extensions etc.

Feb 6, 2019

Math Is Fun

$\sqrt{x} = \frac{x}{\sqrt{x}}$ Seeing the above equation may look completely logical, or not. When i saw it a few days ago, i thought it was wrong. When i understood that it was correct, i thought it was the most beautiful thing ever. I’m not 100% sure why this intrigued me so much, but it just looks great.

Feb 6, 2019

Semantic versioning

Chances are, if you are writing software, you have some dependencies on other peoples code. There is no reason to reinvent the wheel, so you use the code someone else wrote. One of your options is to copy paste it, but then you won’t get any updates if they release a new version. This is where dependency managers come into play. With a set of instructions, they retrieve the needed dependencies for you, and allow you to lock into specific versions, and update when you want. Before we head into dependency managers, lets first talk about semantic versioning (semver).

Nov 9, 2018

Add an editorconfig to your project

One of the hardest things to spot during a pr are whitespace issues. Did someone use tabs instead of spaces, trailing whitespace etc. So, why not make it easy on yourself and help any contributors by adding an .editorconfig file that automatcially fixes those things for you.

Aug 17, 2018

What is a default object?

What is a clean solution to display a ‘default’ message to the user, when something they try to access isn’t there (anymore)? We could let the our repository throw an exception, catch it somewhere, and then let our controller handle it. Maybe we could return null, and pass that all the way up and add a fall back message for the content in the view somewhere? Why not try a better solution and work with a default object.

Aug 10, 2018

Noop polyfills

A while ago a reddit post showed up, where someone installed version 9.99.99 of paragonie/random_compat. Seeing a package update from 2.* to 9.99.99 may be a bit confusing, but given how autolaoding, polyfills and composer work in php, this is actually quite a clever way of dealing with things. Lets take a look at version constraints, autoloading and composer to see why.

Aug 5, 2018

Deploying to Github pages with Travis
Deploying to Github pages with Travis

If you want to write a blog, or have another kind of static website, you need to deploy it somewhere. So why not host it on Github pages? It’s free and has https by default.

Jul 31, 2018

Infection 0.9 is out!
Infection 0.9 is out!

I wrote about infection a while ago, and not too long after that, 0.9.0 was released. Lets look at the new features, and how we can use them in our projects!

Jul 25, 2018