Category: PHP, PHP, MySQL, MySQL

This chapter covers: In Chapter 1 we've looked at definitions for the terms core code and infrastructure code. What I personally find useful about these definitions is that you can look at a piece of code and find out if the definitions apply to it.

The following figure shows that user code is in the middle of a lot of infrastructure code: Even if we try to ignore most of the surrounding infrastructure while working on and testing user code, we'll often find that this code is hard to work with.

What remains in the middle, after "defragmenting" the user code is only core code: This is code that can be executed without relying on any actual infrastructure, and without making any connection to the world surrounding the application.

Knowing when code is pure or not will make a difference, because pure code can be unit-tested, and most of it can end up in the core of your application.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners