PHPNews

Fake it by stubbing the mock, dummy

I recently lead a workshop at ZendCon titled Start testing your PHP Code . I have given this workshop a few times. What I continually receive questions about are the different types of mocks (testing objects). There are indeed differences. I often borrow the definitions from Martin Fowlers TestDouble post (who …

Continue reading »

Written by Jason McCreary - - Aggregated on Tuesday November 14, 2017


Writing Clean Code (Part 2)

In Part 1 of Writing Clean Code I outlined three simple practices of formatting, naming, and avoiding nested code. All in an effort to improve code readability. In Part 2, I want to go a little deeper and cover grouping . When I say grouping, I’m really talking about the Object Oriented Programming paradigm of …

Continue reading »

Written by Jason McCreary - - Aggregated on Tuesday October 17, 2017


SMS admin in 8 lines of code

I’m passionate about the products I build. But I try to balance my time between them. This can be difficult with a SaaS product. Especially a paid SaaS product like Laravel Shift . You don’t want to miss out on revenue. While Shift is a fully automated service, there are times where human intervention is required. …

Continue reading »

Written by Jason McCreary - - Aggregated on Wednesday September 20, 2017


Committing to the wrong branch

Lately CodeRabbi has been tweeting some Git aliases. We all know where I stand on aliases . Be that as it may, his recent tweet received a lot of replies proposing different solutions. This contributes to the steep learning curve with Git - what’s the proper way to do something? I try to address in Getting …

Continue reading »

Written by Jason McCreary - - Aggregated on Tuesday September 5, 2017


References from "Writing Clean Code"

I held my first of a series of Workshops by JMac yesterday on Writing Clean Code . I plan to edit and release a recording of the workshop over the weekend. In the meantime, I wanted to share some of the references I made during the workshop. Implementation Patterns by Kent Beck Filled with principles …

Continue reading »

Written by Jason McCreary - - Aggregated on Thursday August 24, 2017


Writing Clean Code

I recently started a new job. With every new job comes a new codebase. This is probably my twentieth job. So I’ve seen a lot of codebases. Unfortunately they all suffer from the same fundamental issue - inconsistency . Likely the result of years of code patching, large teams, changing hands, or all of the above. …

Continue reading »

Written by Jason McCreary - - Aggregated on Monday August 14, 2017


Starting an online workshop for Git

A few years ago I helped a development team switch from SVN to Git. I was responsible for converting over 100 repositories to Git, establishing a workflow, and training the team. The first two were actually the easiest. The Shrek blog post and svn2git helped convert the repositories and for 99% of projects GitHub …

Continue reading »

Written by Jason McCreary - - Aggregated on Wednesday July 5, 2017


15 years of unprofessional trading

When I was a kid I mowed neighborhood lawns. I made almost $100 a week. I put all my money in a school box under the bed. One day, my grandpa noticed my method of savings. He immediately took me to the bank to open a savings account. He suggested I keep the money from one lawn and save the rest. After jobs during …

Continue reading »

Written by Jason McCreary - - Aggregated on Friday June 2, 2017


An edge case for cache busting

Let’s say we’re architecting a high-performance website. We know from Steve Sounders’ books we see the most performance gains by focusing on frontend optimizations. To start improving performance, we may do the following: Concatenate and minify assets. By condensing all of our JavaScript and CSS into …

Continue reading »

Written by Jason McCreary - - Aggregated on Sunday May 14, 2017


An edge case for cache busting

Let’s say we’re architecting a high-performance website. We know from Steve Sounders’ books we see the most performance gains by focusing on the frontend optimizations. So we may do the following: Concatenate and minify assets. By condensing all of our JavaScript and CSS into a single file (respectively…

Continue reading »

Written by Jason McCreary - - Aggregated on Friday April 21, 2017


Compensation tips

In the past week a few people have asked my advice regarding compensation. Coincidentally, I personally have had to think about compensation as I recently changed jobs. During my career I’ve changed jobs 14 times across 12 companies. These were strictly full-time positions. I’m not counting the various contract …

Continue reading »

Written by Jason McCreary - - Aggregated on Friday April 21, 2017


Using git bisect

A few weeks back I gave a talk at Laracon Online entitled You don’t know Git . During the talk I demoed several unfamiliar Git commands. While I did cover git bisect , I didn’t provide a demo. Demoing git bisect is challenging. The command has several subcommands and requires context about the code. As such, …

Continue reading »

Written by Jason McCreary - - Aggregated on Wednesday April 12, 2017


Stop aliasing core Git commands

A core feature of Git is the ability to create aliases . This effectively allows you to customize Git’s command set. As a developer, of course, you’re going to want to do this. However, lately I’ve come across numerous claims stating aliasing core commands is the Right Way to use Git. Unfortunately, even Pro …

Continue reading »

Written by Jason McCreary - - Aggregated on Sunday March 19, 2017


Lumen is dead. Long live Lumen.

You’ve already read the title, so I’ll just say it, I think Lumen is dying, if not already dead. Now let me tell you why… Limited adoption As the creator of Laravel Shift I get a unique pulse on the Laravel community. Something I noticed is the ratio of Laravel to Lumen Shifts is pretty staggering - about …

Continue reading »

Written by Jason McCreary - - Aggregated on Monday February 27, 2017


Accepting Adam's TDD Challenge

Last week at Laracon Online Adam Wathan gave a talk entitled “Lies you’ve been told about testing” . Following the talk, Adam posted a challenge . Amid Adam’s post, he makes a single claim and presents a challenge. The claim isolated unit testing is incompatible with TDD The challenge Write a …

Continue reading »

Written by Jason McCreary - - Aggregated on Monday February 27, 2017


A closer look at git rebase

Most of the comments to my recent articles on 3 Git commands I use every day and When to make a Git commit have mentioned using git rebase . So, let’s talk about git rebase . Jumping right in, I use git rebase for two reasons: To bring a stale branch up to date. To change a set of unmerged …

Continue reading »

Written by Jason McCreary - - Aggregated on Tuesday February 14, 2017


When to make a Git commit

You don’t have to look through too many commit histories on GitHub to see people are pretty terrible about making commits. Now I’m not going to talk about writing commit messages. Here’s the post on that. I want to talk about the equally important topic of when to make commits. I get asked this a lot …

Continue reading »

Written by Jason McCreary - - Aggregated on Tuesday January 10, 2017


Git - Command line vs GUIs

In the introductory video for Getting Git I talk about using Git from the command line instead of through a GUI. I label GUIs as evil wizards and slay them with a custom die command. But why ? What’s wrong with GUIs? I didn’t randomly label GUIs as evil wizards . This term comes from one of the first …

Continue reading »

Written by Jason McCreary - - Aggregated on Tuesday January 10, 2017


Pivoting from Laravel Shift

These past few months I’ve pivoted from Laravel Shift . This doesn’t mean I’m no longer developing Shift. More that I’m taking a small break to shift my focus (pun intended) to a separate, but related product. I’m doing so for a few reasons and thought sharing them might help others make similar decisions on …

Continue reading »

Written by Jason McCreary - - Aggregated on Sunday January 8, 2017