Bugs are going to happen even to the best developer. That unexpected behavior is just part of this profession. But what sets you apart and defines you is your ability to problem solve. It’s about finding the root cause, that thing or things which are at the center of the problem, and then properly resolving it. In this daily tip, let me share with you my four (4) steps to problem solving. These steps are the same no matter if you are on the hunt for a minor issue to some intermittent, pain in the backside, wonky problem.
How much stuff can I cram into one video? Well, a lot with this one. You’ll do some reorganizing the code and files to get clean, quality code from the start. I’ll show you how to setup the DocBlock templates in PhpStorm. And you’ll do some testing too. Let’s get started.
Let me introduce you to Whoops. You are going to love this error display. Not only is it nice to look at versus the out-of-box PHP orange error table, but it also gives you a lot of useful information. You can click on the code and view it right in the display. You get great details too. It will help you debug your code. Here’s a tip for you: you can configure up different editor themes. I like the sublime one. But you can choose from sublime, emacs, textmate, and macvim.
In this video, you will play around with Kint and discover how it will help you to debug your code. Kint is a modern and powerful PHP debugging helper. It gives much more information than var_dump or print_r. Let’s check it out.
In this lab, you will build a custom WordPress Starter plugin, one which could be the starter for your projects. You’ll install Composer, Kint, and Whoops. You’ll look at file structure and how WordPress’ Plugin API recognizes which file is the plugin’s main file. You’ll look at PHP DocBlocks and more. This plugin is one you will use throughout your training here on Know the Code. Let’s get started.