I also blog over at The Perl Shop Blog. Most of what I write about Perl anymore is over there.
My recent pieces include:
-
Test::Class Hierarchy Is an Antipattern – This 2000+-word essay I initially serialized as a trilogy of posts. It’s about an antipattern that is peculiar to the Perl world, and one of the reasons Perl programmers don’t seem to like
Test::Class
.I try not to rant at the TPS blog, but here I will allow myself a brief polemic: Just about every other serious development ecosystem has some version of xUnit that is its standard. Even GoLang, which doesn’t even support proper inheritance, has a standard testing framework in which each test module contains a list of test functions. No one else has standardized on test scripts, as the Perl community has—much less on long-winded and labyrinthine test scripts. And there’s nothing special about Perl that makes the patterns and models that the rest of the world uses to manage test code inapplicable to Perl. There are two possibilities here: either everyone else is wrong, or else Perl culture is firmly mired in the 1990’s on this point.
-
Long Import Lists (and available strategies for managing them) – How can we use long lists of symbols from an imported package and still keep the code readable? I prefer explicitly listing the symbols, but with long symbol lists and long module names, this can get messy pretty fast. This piece explores alternatives including importing everything, importing nothing, using import tags, and various forms of namespace aliasing.
-
Testing Insights from B::DeparseTree – Rocky Bernstein had posted about his experiences refactoring and testing
B::DeparseTree
, and I thought his piece contained several insights on testability and writing good tests. Here are my 5 takeaways from that article (with references to Martin Fowler and Gerard Meszaros). -
How Viable is Perl? – How viable are unpopular programming languages? We in the Perl community certainly get a lot of flak, and we’ve been battling the idea that Perl is a dying ecosystem for years now. (The dying ecosystem idea is a whole other post that I haven’t yet written, but I highly recommend VM Brasseur’s keynote at TPC 2018.) However, a programming language doesn’t need to be popular in order to be viable. There are plenty of languages that are less popular than Perl that are widely recognized as viable options for production systems.
I’m also still working on Testing Strategies for Modern Perl… slowly working my way through it. I’m about 4,200 words through chapter 3, which focuses on reusing test code. I’ve talked about factoring common data out of test methods, how to refactor tests safely, creating custom test assertions, parameterized setup, table-driven tests, and shared test modules. I have 3 sections left to complete—on test fixtures, inheritance, and the Test Hierarchy antipattern (see above)—plus a conclusion and an introduction. The book also has a new cover! (That’s the image shown here.)