2017
What are Containers, and how are they useful?
Linux Containers have become increasingly important over the last few years, in particular driven by Cloud applications. But what are containers, and how can they be useful?
This is an expanded, English-language version of a presentation I had to prepare during my studies. As such there are likely to be some misunderstandings. I am looking forward to be contacted with corrections.
This is a fairly low-level view at container concepts, and not a tutorial for a specific technology like Docker.
Transforming Syntax updated
Back in 2013 I published a Marpa parser tutorial called Transforming Syntax, which discusses how a language can be parsed with Marpa and then transpiled to another language.
After all that time I have finally moved the tutorial to this blog. The tutorial was edited and updated on that occasion. In particular, it now promotes better best practices for Perl and Marpa. Mistakes were corrected and the AST objects greatly simplified. The code was improved and tested. In retrospect, four years of using Marpa do make a difference.
I hope Transforming Syntax continues to be useful as one of the many wonderful Marpa tutorials out there.
What is a Source Code Comprehension Tool?
Code Comprehension Tools make it easier to understand and explore existing code bases by providing overviews, cross-references, and visualisations. They assist software engineers during software maintenance, in contrast to tools that help during initial development.
Perl Docstrings: Put your POD into Heredocs
Python's docstrings are great, but have no real equivalent in Perl. However, we can make POD sections easily accessible to Perl code by putting the POD into heredocs:
my $some_function_docs = <<'=cut';
=head2 some_function
Write documentation here.
=cut
This article explains why that works, and how this might be used in your Perl modules.
Unix is my IDE: script everything
I don't like remembering stuff. That is what computers are for. An ode to automation.
Inspired by this, I finally got around to publish a couple of small development utility scripts at https://github.com/latk/Unix-is-my-IDE.
How to check for an array reference in Perl
So you've got a Perl $variable
.
Can we use it as an array or hash reference?
If you do an online search for possible solutions,
you'll find a number of suggestions, most of them wrong.
TL;DR:
checking if ref $variable eq 'ARRAY'
is almost always a bug.
Depending on your use case, you want:
reftype $variable eq 'ARRAY'
from Scalar::Util as a check for physical array references, or_::is_array_ref $variable
from my module Util::Underscore as a check for logical array references.
Dist::Zilla on Travis CI
With Dist::Zilla (dzil), testing Perl projects on Travis CI can be a bit tricky. Here's my approach.
Should I Separate Unit Tests from Integration Tests?
When does it make sense to keep integration tests separate from your unit tests, and when is it OK to make no distinction?
Well, it's all about getting fast feedback.