One Weird Trick to Debug WordPress Quickly

Have you ever needed to build a new feature or fix some bugs for a WordPress site? Chances are the code you need to work with is way too complicated to understand quickly.

wtf-code

You can use a combination of  var_dump()  and  wp_die()  to do some basic introspection, but that’s really just a snapshot of a moment in the code.

What you need to understand to fix the bug is to know where the application execution started, what was triggered and how you ended up at a certain point. What you need is a trace.

Continue reading One Weird Trick to Debug WordPress Quickly

Make Code Great Again

There’s very little code that’s completely independent of other code. A simple “hello world” in your favorite language relies on the code powering your language. As your objective gets more complex, you start relying on more and more code to get things done. Your code depends on other code, which depends on other code, which … you get the idea.

An unfortunate side-effect of code dependency is yours inherits the flaws of other code it relies on. As a result, your code sucks because the code it relies on sucks.

Instead of getting on a soapbox about poor code, since we’ve written and released our fair share of it, lets focus on how you can make code great again.

Continue reading Make Code Great Again

Laptop Failure Playbook

screen-repair

Something in my laptop died a few days ago. I’m hoping it’s a simple change and it’s back to its (very) old self. Thank God I was able to get my hands on an alternate machine to use in the interim.

While the scary prospect of not having a machine to work from was avoided, I had to go from a fresh installation of Windows 7 to something that resembled my work environment. No easy feat since this particular machine is a culmination of software and configurations from the last six years.

Continue reading Laptop Failure Playbook

CJS-Task 0.0.8 Release

The JavaScript ecosystem encourages creating and using small utility functions and libraries.

While this encourages code reuse and interoperability, you’re left with the responsibility of writing glue code to marshal oft misaligned paradigms to accomplish your objective.

CJS-Task was created with the desire to bring simplicity by acting as a high-quality glue between all the pieces you’ll use.

How? A few tricks.

Continue reading CJS-Task 0.0.8 Release

The First 419 Guy was an American Child

One day, however, a new sort of ad appeared in the pages of several dailies: an appeal from a certain Prince Bil Morrison.

The prince was of noble birth and hailed from the far reaches of Nigeria. All he wanted was some American pen pals.

So moving was the wording of the ad that the papers had published his mailing address free of charge. Should not the poor prince find some good old American correspondents?

Continue reading The First 419 Guy was an American Child

ES6 is Over-Engineering JavaScript

Don’t let acronym fool you. npm is more than node’s package manager; it’s the package manager for all of JavaScript.

It houses great big libraries like React, Electron and socket.io. It also contains itty-bitty snippets of code. Code so small you’d expect their behavior to be native to the language.

This has turned JavaScript into a language with a small, serviceable core and lots of useful extensions available in npm.

ES6 is expanding the core of JavaScript.

Not by adding things that currently don’t exist in the JavaScript + npm realm, but by introducing new ways to do things we could already accomplish before.

This seems like a very bad idea to me.

Continue reading ES6 is Over-Engineering JavaScript

JavaScript ES6 is Doing Too Much

Swiss Army Knife

This is a Swiss Army Knife. The Handyman, to be precise. According to the site, it has 24 functions. Can opener, scissors, nail file, pliers, wine opener, bottle opener, wood saw, toothpick, nail cleaner … the list goes on.

Conceptually, it’s really great to have one thing that does so much.

Realistically, Swiss Army Knives have not replaced the need for single-purpose devices in any of those categories.

It’s doing too much to be good enough at one task to replace a device crafted specifically to solve a single purpose in any of those categories.

I fear ES6 is introducing tools that make JavaScript do too much.

Continue reading JavaScript ES6 is Doing Too Much

Deeper

Have you watched Inception?

kvudiamroxpkjgivyqja

 

It’s a really interesting movie where people can enter the dreams of others. I don’t wanna ruin it for anyone but the ability to enter dreams is infinite.

You can enter the dream of someone who is sleeping in a dream. Dream within a dream.

My first dream was to design for the internet.

The moment I saw the Cartoon Network website in the late nineties, I knew that’s exactly what I wanted to do. I learned how to use Photoshop, Illustrator, picked up HTML + CSS, designed MySpace pages and built a static website.

The static website was the accomplishment of my dream. I designed a website, coded it up, published it on the internet and got paid handsomely for it.

Almost immediately after, I was unsatisfied.

Continue reading Deeper