Monday, 3 May 2021

The problem learning Perl using Google

Google search isn't always the best way to find what you're looking for, and learning Perl is a case in point. In this article I'll explain the problem of Google search when learning Perl, and the better alternatives to use.


The problem

In the first quarter of 2021 I ran a survey on behalf of The Perl Foundation to understand how Perl - as a community and ecosystem - can be more welcoming to beginners. From the results we found that one of the main challenges beginners face is that it's very hard to find the best approach to Perl coding problems through a Google search.

... in detail

Imagine you've decided to build an object oriented module in Perl. It'll be your first, so you google "object oriented perl". Running this query on the first day of May, 2021, your first hit is https://www.perltutorial.org/perl-oop/ and every other link on the first page of search results has similar content. These pages tell you about "bless", the function at the core of Perl which creates an object.

The problem is that these search results present the way object oriented Perl would be written 20 years ago.  These days there are packages - most prominently Moose and Moo - which are the main tools experienced Perl developers currently use for object oriented development. The resulting code is much easier to write, read and maintain.

The cause

Why has Google given us such an outdated view of the Perl ecosystem? It's because Perl took the online world by storm with the dot-com bubble in 1995-2001. At that time, a Perl script was just about the only way to put together a dynamic website, and that's when a lot of articles were written explaining how to do things in Perl. They were linked to from many other pages - and through the principles of how Google ranks search results - all these links give them a great deal of traction when using Google search to find information about Perl.

Since then, modern and maintainable ways of doing things in Perl have been established, but because Perl is now a small fish in a large pond of competing languages, the number of links pointing at its modern documentation can't compete with those from the beginning of this millennium.

Advice for beginners

As a beginner, ask questions in the various online discussion groups, mailing lists or chat. Share code samples and ask whether you're heading in the right direction. It sounds time consuming and harder than a Google search, but the excitement and joy of getting a simple, clean solution is well worth the effort!





1 comment:

  1. This is one of the reasons why I wrote the Perl Search Engine (https://search.perlhacks.com/). It only returns results from sites that are known to have good (and up-to-date) Perl coverage.

    ReplyDelete