whateverthing.com

May 3, 2020

Arrow Functions are a new syntax for short anonymous functions introduced in PHP 7.4.

Anonymous functions, if you're not familiar with them, are special functions written inside other sections of your code that you can pass around kind of like variables.

Usually these functions are very short and purpose-built. They're not supposed to contain a huge amount of logic.

Where arrow functions stand out is that they allow you to write concise single-operation anonymous functions like you might use when doing sorting or map/reduce operations.

April 21, 2020

PHP 7 and 8 are huge leaps forward for the language. Gone are the days of hacking together an entire web application in a single file (although you can technically still do that, if you're feeling retro). Now there are so many fancy new language features that you might find yourself adrift in the sea of changes.

I'd like to introduce some of these new features one at a time, to give them a chance to catch your attention and capture your imagination.

Today's subject: the Null Coalesce operator, a little ditty from PHP 7.0 that looks like ??.

March 18, 2020

Way back in 2011, I created Beryllium\CacheBundle for Symfony 2. It got a bit of traction, but superior options soon appeared, and then PSR-6 landed and promised a whole new world of caching. PSRs, or "PHP Standard Recommendations", are a group of framework interoperability interfaces provided by the PHP Framework Interoperability Group (FIG).

I wasn't exactly a fan of PSR-6.

The PSR was well-engineered, but it seemed like overkill for my projects. And on top of that, I was no longer working on the project that had needed caching in the first place.

March 14, 2020

Ever wondered about a day in the life of a remote worker?

I've been a remote software developer for 3+ years, and most days I just sit at my desk at home and get stuff done.

Every once in a great while, though, I venture out into the world. Some days it's just for lunch. Some days it's a short photo walk to brighten up my day. But on some rare days ... I get a bit more adventurous.

This YouTube video is from just such a day:

The Adventure

It was a calm spring day, so I packed up my crab fishing gear and headed to Pedder Bay, a local marina that offers affordable hourly boat rentals.

I rented a sixteen foot "Double Eagle" with a 50 horsepower Yamaha motor.

Soon after exiting the marina, I put my crab trap in the water near some other traps. In the video, I joke that the footage was "not found" - really, it just wasn't possible (or safe) to capture footage and put the trap in the water at the same time. The line I was using also got tangled up as I was dropping the trap, so I had to spend some time un-knotting it.