Categories


Archives


Recent Posts


Categories


Pestle 1.5.3 Released

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

A small bug fix release for everyone’s my favorite Magento 2 code generation tool and ad-hoc PHP module system. This fixes a small bug in the magento2:generate:schema-add-column command that only triggered when using pestle’s interactive mode.

This bug, although small, was interesting to the software builder in me for a a few reasons.

First — this fell through the automated tests because there’s no easy/obvious way to automate the tests of an interactive command line application. Not that it’s impossible, just that the lack of easy/obvious tooling around doing so meant I spent time on other things instead of building a CLI testing framework from scratch.

Second — this is one of those bugs that wouldn’t have happened in a more strongly typed language/system. PHP accepted the function call to inputFromArray because it assumes the function will be defined at runtime. In a more strictly typed language this sort of problem would have been caught at compile-time or before running the program.

Third — and the ultimately maddening thing to a programmer — is this bug has existed for years without tripping anyone up or not tripping them up enough to open an issue. Software doesn’t need to be correct to provide value. The majority of what makes this work difficult is deciding how right your programs need to be before unleashing them on the world.

Copyright © Alan Storm 1975 – 2020 All Rights Reserved

Originally Posted: 13th October 2020