Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Marco Pivetta:
Eliminating Visual Debt
Jun 05, 2017 @ 16:53:12

In a new post to his site Marco Pivetta talks about "visual debt" in your code. "Visual debt" is described in this video as the difficulty in understanding caused by complicated code.

Today we're talking about Visual debt in our code.

As an introduction, I suggest to watch this short tutorial about visual debt by @jeffrey_way. The concept is simple: let's take the example from Laracasts and re-visit the steps taken to remove visual debt.

The code example the post starts with, while a working piece of code, leans towards being more complex than necessary to complete the task. Marco spends the rest of the post walking you through the simplification of this code. He shows how to remove pieces that aren't as necessary, refactor it to remove the enforcement of contracts and some further things you can do to simplify the code.

He ends the post by saying that his suggestions are all sarcasm on his part and shouldn't be followed. By removing things like return type hinting and functionality that enforces good behavior you risk odd issues and poor usage down the line.

tagged: visual debt elimination sarcasm opinion

Link: https://ocramius.github.io/blog/eliminating-visual-debt/