#1: Perl, Balance and Evolution

The search for balance

Humans have many tendencies. Some affect certain areas more than others and bring direct consequences. Some people embrace these tendencies, while others do not, and this is natural. Above all, we’re not here to judge but to learn. In this respect, diversity is beautiful.

One global tendency is the trust in and fascination with trends. Some people love following what is trendy. While constant change may not always yield solid results, particularly for certain applications, the implied learning process often brings valuable practices.

Another common tendency is status quo bias — an aversion to change. Some people simply don’t want to change at all. “What worked for the past generation works for me too, and if it isn’t broken, we don’t change it.” While this mindset helps preserve historical practices and has benefits in some contexts, it doesn’t apply to everything.

As usual, distinguishing the effects of choices and tendencies is not always easy, and it often requires another factor: time.

Those who know me personally or from my work in other areas besides programming will likely have heard me complain about how the field of baroque instrument building suffers from extreme preciosity and fear of change. While this is useful for preservation, it’s dangerous when it relies on unstable foundations, leading to assumptions about the past. In this case, overcoming the aversion to change could modernize the field and bring many improvements.

Diametrically opposite to this is modern computer programming. Things move quickly, trends come and go. Many programmers are more interested in learning what’s new rather than focusing on the fundamentals. While this approach has its advantages, it suffers from the same issue: working with unstable foundations. However, this is natural in programming, as we’re dealing with constantly evolving technologies, unlike the traditional process of historical instrument building.

And then, there is Perl.

Perl has been my go-to programming language for countless projects because it always helps me achieve balance. It’s a beautiful language that allows for great diversity (there’s more than one way to do it!), and most importantly: it’s mature, stable, and complete. Personally, I dislike trends and try to steer clear of them. Perl is perfect in that sense, and I believe many people would benefit from learning it. They might discover that we programmers are still solving the same problems as we did decades ago, and using something trendy isn’t always the most efficient way to do so.

That said, Perl is now experiencing something possibly unprecedented in programming: change aversion. Yes, we now have a mature (or “old”) enough language that programmers are beginning to display status quo bias. Programming status quo bias — unbelievable and paradoxical, given how recent computer technology is compared to the span of world history. But it was inevitable.

The result: a severe imbalance. When this is combined with egos, outdated resources, and legacy designs, it has led to a steady decline in the number of new programmers adopting Perl.

Corinna

One of the first questions newcomers or curious people may have when exploring Perl is related to its object-oriented features. There is an official answer, but a more fitting one might be: “it’s complicated.”

Perl is an object-oriented language. However, the mechanism of blessing hashes is quite low-level. It works, and in many cases, that’s sufficient. But in more complex situations, it leads to repetitive code and limits usability.

In this sense, Perl suffers from one of its own strengths. It is easy to implement and distribute solutions, so many object-oriented systems have emerged. Some became more popular than others, but they all stretch the possibilities of Perl as far as they can go. The result: a paradox of choice. And let’s not forget the status quo bias among programmers who have been using Perl for decades.

As the language has aged, and the world has moved on, one benefit we’ve seen is evolution — and programming paradigms have evolved too. Our experience with them has grown. In this regard, the wait has been worthwhile.

Thankfully, a solution exists. Corinna exists. We finally have a modern, fully-featured object-oriented system in Perl — better than we could have hoped for. It is modern and unique. This text does not aim to explain all of its details though, and so, in case for the kind reader Corinna is a new term, I highly recommend checking its documentation.

Corinna is currently being integrated into the Perl core, and even now, a small (experimental) feature set is already available for use.

The real world

How usable is it in practice? Well, I hope the very existence of this post serves as proof.

As some may know, I also make a living by building systems, many of which involve websites. Having such an elegant object-oriented system built into Perl has allowed me to work with modern solutions, all within the Perl language. And what language could be better for handling this sort of data, anyway?

One system, necessary to provide the basic infrastructure for websites, is a web framework. So, Minima was born. I needed it (more on this in the history section of its documentation).

Minima is a web framework built using the modern object-oriented features that Perl offers. It provides essential infrastructure without getting in the way of user interactions with PSGI. Its minimalism has proven to yield excellent performance, and yes, I’m using it in production.

Perl has so much to offer. It’s alive and well and is receiving a fantastic update. Its enemies? Unfortunately, there are some. And the biggest of them harks back to where we began: status quo.

How can we help? By using it, writing about it, and giving feedback — all of which are much needed at this stage. Also, give thanks to Curtis Poe and the Corinna authors, as well as Paul Evans for his excellent implementation of Corinna.

And finally, if anyone asks whether Perl is an object-oriented language, feel free to answer that it is — and that it’s one of the best.

Comments section coming soon. Feel free to contact me in the meantime.