Perl tutorials suck (and cause serious damage)
Before reading this entry, please note that this problem has been solved. You can now find fresh tutorials at the:
Perl Tutorial Hub
And now back to your scheduled rant:
PREFACE
On monday a blog post made the rounds that claimed "Perl users were unable to write programs more accurately than those using a language designed by chance." Naturally that is not the entire truth. As it turns out they "trained" their test subjects using examples of code that they considered representative of what a user would find when trying to learn Perl from the internet. That code looked like this:
$x = &z(1, 100, 3);sub z{
$a = $ [0];
$b = $ [1];
...
for ($i = $a; $i <= $b; $i++){
...
if ($d > $e) {
$d;
}
$e;
}
Naturally the outcry (including from me) went: "But that is Perl 4 code, of course the test subjects had a friggin hard time with it!" But were they wrong in choosing that example to teach with? Was that representative of what a complete perl beginner would find online?
THE PROBLEM
Turns out, that yes, it was representative. The code above represents exactly the very first thing found when looking for Perl learning material.
How so? In a post yesterday i asked for help in finding out what a perl newbie would try first when wanting to learn Perl. Google Trends is a great tool, as it shows comparatively how often certain search terms are used. And it turns out that among the highest performing search terms there is one that is at least twice as often used as any other search term:
And quite frankly, the results for that search suck. Incredibly so.
The first result, a site by the University of Leeds, in the UK, carries this warning at the top: "This tutorial was written in the early 1990's for version 4 of Perl. Although it is now significantly out of date, it was a popular source of information for many people over many years. It has therefore been left on-line as part of the historical archive of the Internet." 21 years later, in 2011, it is still the very first thing Google brings up when looking for perl tutorials and that is exactly what newbies world-wide do first.
Make no mistake though, it is not just the first result that is terrible. Result two ( perltutorials.org ), features Perl 4 code as well and result three ( tizag.com ) attempts to teach "PERL", also using Perl 4 reminiscent code. Search result four is a highlight, in that it is Gabor Szabo's excellent fledgling Perl tutorial series with videos. But the very next result goes back to 2000, with an article on perl.com, which already features 5.10 and nicer forms of `for`, but still eschews talking about strict, warnings, or even using `my`. After that comes Learning Perl, which is a bit barebones, but features a nice modern Hello World. Yet right next up is a link to a free online copy of the book Beginning Perl, which might sound nice, but is anything but, thanks to being the edition from 2000, which teaches Perl 5.6.
I could go on, but it doesn't get any better. Only worse.
If you've wondered why the public perception of Perl is that of an old language, this is the reason. Our public face to anyone new to Perl and wanting to learn is dominated by material from the turn of the century, or earlier.
SOLUTIONS
Now, i honestly do not know how to best solve this, but i can bring up some ideas.
Content Creation
Now, as far as i am aware there is no current, definitive and in-depth Perl tutorial anywhere. Please correct me if there is one.
Gabor Szabo has made a good start, but it's only a start. Right now his series is tiny and he is only one person. Another good attempt it learn.perl.org, bug again, too small in scope. It provides a few bites, a few examples, basically just a taste of Perl and then tells the peruser to look at other sites. These approaches suffer from a few flaws in that they fail to properly capture and provide for the newbie.
So, we need a good modern Perl tutorial. Not just books. We need something in the style of the Leeds University document, but with all the anachronisms filtered out and current knowledge inserted. Something like the Python Tutorial. And most importantly, it needs to be a community effort. It cannot hinge on just one person.
Possible options i see are to either create a wiki on a domain like tutorial.perl.org/com and take pains to ensure that editing and updating it is easy and effortless. Alternatively it could be done by ways of a github repo, possibly even within the perl core repo, which is then exported to HTML regularly.
Using a structure like this, the community at large could concentrate on writing the textual content, while people like Gabor can still contribute videos. It could be a very nice mix of the python tutorial and RailsCasts.
Make it good enough, publicize it and Google search results would right themselves on their own.
Outreach
Another option would be to reach out to the maintainers of those sites and convince them to take down their sites or at the very least add links that prominently point to more modern content. Alternatively they could be asked to cooperate with the Perl community in making it possible to change and update the contents of those sites.
Then there's also the matter of the people linking to those sites, outreach could also be done to them by ways of finding out with www.backlinkwatch.com who links to them, and then convince those sites to remove/change their links to newer materials.
SEO
Failing the above two, there are still measures that could be taken to aggressively alter Google's view on what's relevant to perl tutorials. This could be in the form of burying results we do not care about, or promoting results we do care about. It is in my eyes a last resort and might involve money expenditure, but given the circumstances i do not see it as entirely unwarranted.
Edit: A suggestion from Reddit: "the new +1 feature for search results may come in handy. Get the entire community to +1 the same link."
QUESTIONS
Some questions still going through my head:
- Are there perl tutorial sites i do not know about that have good and copious content?
- If so, how could we effectively advertise them, so Google picks up on them?
- Are there other options i did not think about?
And with that, i close this entry and leave it to you to ponder and provide feedback and most importantly: Help repair the image of Perl.
Back links are another big ticket item. Posts linking to good perl tutorials from perl.org site (such as this one) will go a long way to increase their page rank.
I wrote one - in Hebrew. and it was for Perl 5.8.
http://www.shmuelfomberg.com/perlhebtut/
I think that it is pretty good.
Need an English translation? :-)
@roborooter: Yes, but in order to backlink one has to have something good to backlink to first. :)
@Shmuel: If you'd throw it into a wiki, then an english translation along with some updating of the content would be great. You could ask all of Israel.pm for help on the mailing list. :)
The best Perl tutorial I know: http://onyxneon.com/books/modern_perl/
It just doesn't advertise itself as "perl tutorial".
*sigh*
I keep having to repeat this: Telling the Perl newbie "It's your fault, you're not searching right!" is not an option. We have to figure out how someone who doesn't know Perl goes about doing it and then provide quality material.
Thanks for bringing attention to this issue. One solution could be creating/finding a solid tutorial and placing it prominently at perldoc.perl.org. This is the approach that has successfully been taken with the python tutorial. Perl is a much more complex language, so it would take a lot more effort to do this, and everyone will fight over what to include or exclude, but this is something that really needs to be done.
Have you considered contacting the people who run the Leeds server with some of these suggestions?
;-)
Here are 2 tutorials that I have not seen mentioned:
Learn Perl http://learnperl.scratchcomputing.com/ uses and emphasizes modern Perl throughout.
Perl Beginner's Site http://perl-begin.org/ is more in-depth, but seems like it could use a "modern Perl" update. It waits until Part 2 to discuss strict and warnings, and nowhere that I can find mentions the say keyword, nor "use [version]".
I had the similar search issues with "Perl Web Server" query back in 2010 when I started PSGI/Plack.
I briefly discussed that at Orlando Perl Workshop (slide 121-) and called for some SEO inbound links as well as putting them into a title tag of our page.
http://www.slideshare.net/miyagawa/plack-at-perl-oasis-2010/121
Today the query still shows 2 irrelevant Perl web server projects as #1 and #2, but we're on #4, much better.
I wrote some material for a Perl course that I teach; http://evc-cit.info/cit042 (see the "Additional Readings" section, which uses my material and some perldoc material).
Anyone who wishes to use my material may feel free to do so.
I 100% agree that there are good tutorials out there and that they arent coming to the top of the list.
Can i therefore propose three courses of action (i use learn.perl.org as the perl foundation sanctioned site for learning perl).
- Have the 'known good' tutorials link each other, or perhaps have learn.perl.org link them and perhaps provide a 'certified good tutorials' image link. Automate this as much as possible.
- Have learn.perl.org list BAD tutorials, allow people to submit them, and seek to contact the author to take it down or otherwise mark it as deprecated.
- Perhaps the perl foundation can purchase google (and other) adwords.
Front-end web development has a similar issue: the abomination known as w3schools.com gets passed around from newbie to newbie. Eventually some of the standardistas made a site, w3fools.com and have been pushing it hard. It also similarly has trouble listing good alternatives: each one they list has problems too.
Matt's Scripts are getting used in new Perl code, from what I see of newbs asking questions in the forum I'm in. Why? I think he comes out on the top still. Also, some newbs who have been directed to that (excellent effort BTW, Mongers) NMS page, point out that Matt's copywrite says the current year, while NMS is 2006. They wonder if Matt's is now up to date?
Too bad I can't trust Google, with their tracking and crap... if I type in Perl tutorials in google, first hit is Perlmonks tutorials link. But I go to Perlmonks. I can't trust that's what newbs see (and, be aware, *neither can we*!). DuckDuckGo will give unfiltered results, but they may be mostly Bing results (not sure, they may tweak for Perl specifically). Leeds is #2 on google though. Once a single decent tut is anywhere, someone adminning that site could (easily?) put a link in that table at the top. And make the rest of the text light grey. Someone still wants to read it, they'll have to ctrl-a it or wget it or turn CSS off... not things I'd expect a newb to bother doing. Text is still there for posterity then.
BTW I have a thread on a web developer forum that can be updated with any better links anyone comes up with, just let me know. Though again I notice if I type in "perl resources sitepoint", the older (deprecated) thread comes out on top. Luckily we added a note "this is obsolete" and a link to the current one, so people hitting the old thread shouldn't have a real problem. Also showing up are decade-old tutorials for CGI etc by the main site. Would be nice if someone could offer to write something newer/Modern Perly for Sitepoint? Like how about an Intro To Dancer? They pay their authors. RubySource for example recently had a Get Started With Sinatra. Why not Perl?
Links to better tuts (when there are any that address the specific topic) could maybe be pushed in answers in places like SO and reddit where I've noticed Perl people getting active (excellent).
Maybe PHP.net is something to emulate. Newbs love it, apparently.
This issue has been raised before and after it came up at the last LPW I decided to have a look at the availability of library books.
A similar problem applies. Many local libraries have Perl books which are ten or more years old and therefore misleading.
Beginners are the most likely to be mislead so I decided to check the availabilty of "Learning Perl" which is about as basic as it's possible to get.
I checked Portsmouth, Hampshire, Essex and Surrey area libraries (not little local libraries). Portsmouth and Essex had the 3rd edition, Hampshire didn't have it and Surrey had the 5th edition.
The solution turned out to be simple. It was just a question of asking. I asked a member of each library to request the 6th edition. (I didn't bother with Surrey because the 5th edition is probably OK.) In each case the library agreed to put it on order.
I was also able to read the ticket in the Portsmouth copy and verify that it was being issued a couple of times a year and that updating it is therefore worth while.
I don't have any more contacts so I can't request books in any more areas. It would be useful if some other people would request a copy in their area.
This post is about web-based material. Perhaps the answer there is also as simple as asking the hosts to update their sites.
A library donation program could be another funded program?
That said, here in Australia most public libraries don't include computing books any more as they suffer an 80%+ theft rate and are outdated too quickly for their cost.
When i was at university, i think they had a standing order of all O'reilly releases (and some other publishers) as they always had the latest books across most categories. I was impressed when they had current editions of BSD books.
Perlmonks is a messy site though. Ive tried to get in to it, i really have... so even if it was well SEO'd - its quite an eye-sore.
How about a hack-o-thon to improve some of the sanctioned websites and knit them together more? and tie them to social media perhaps?
I'm at work right now and still mulling things over, but i want to say this:
Thanks to everyone for the responses. I'll be responding more in detail to each of you tonight.
Meanwhile i'm also thinking about how to resolve this problem. The short of it is: There are tutorials out there, but not all of them are fit to serve as "The Tutorial". I'm thinking about setting up a "Perl Tutorial Hub" site, which would be a wiki linking to and detailing other tutorials, including information on how up-to-date they are. Additionally, since it'll be a wiki (probably ikiwiki), it'll be a premier site to build "The Tutorial".
I've already sent out an email to maybe get that onto http://tutorial.perl.com, but i'll have to see how things pan out.
Leeds would, I am sure, cooperate.
The JS community had this exact same problem--all the search results would go to crappy out-of-date docs or sites like W3Schools. Chris Williams, organizer of JSConf, started a campaign called "PromoteJS" to solve these problems--which has largely succeeded. The idea is more or less to sprinkle a ton of links to the de-facto resource (in the case of JS, the MDN docs) and the search engines will do the rest. Check it out here: http://promotejs.com/.
Assuming something like this would be of interest to the Perl community, what would be the best target for links?
Seems like the obvious answer is to start posting blog articles that link to good tutorials on modern Perl programming techniques, and to contact people hosting old, outdated pages and ask them to update the info or take it down.
I'll start: http://earlruby.org/learn-perl/
Just for completeness here is the link to 2 discussions on Reddit about this post.
@Earl, seeing your anchor-less link here first I thought you don't know how to improve search results but then I clicked through to your site and saw that, there you used it in a nice way.
Thank you very much!
How to list ways to learn Perl by Earl C. Ruby III.
This discussion is very enlightening. I've been using Perl since 2005 and I have to admit that I first learned everything from the Camel book and then later from other Perl guys (and gals). It never even dawned on me that someone would google "perl tutorial" much less that they would be getting results that are *decades* old!
Question: does Google have any mechanism for SEO that includes a way for web admins to flag their own sites as "historical" or "outdated" or anything like that? Just curious.
I'll be happy to click on a "promoteperl.com" link or do anything else I can to help Google get their results straightened out. Thanks for bringing this to our attention.
-MC
I'd like to suggest that there seems to be a strong SEO component to this issue.
For example learn.perl.org doesn't actually use the text "Perl tutorial" on the front page, which is bad if people are searching for a "perl tutorial" instead of trying to "learn perl"
Perl tutorial is tucked into a keywords meta tag, but (using a SEO checking tool) in comparison the term "tutorial" is the second most popular term on the Leeds site with "perl tutorial" being the most used 2 word phrase. In comparison the "learn" site concentrates on "learn perl", "perl learning" and "install perl".
So while "learn" has a Page Rank of 7 compared to "Leeds" PR 5, it is very unlikely to turn up in results for "perl tutorial" because that isn't the term that it is targeting. Try "learn perl" instead and you'll see it right away.
I am by no means an SEO expert, but it seems that if Google Trends says that "Perl tutorial" is what people are searching for then that should be what the "learn" site should be using.
(and of course this applies to any of the other great tutorial sites out there)
Meta keywords are almost entirely useless. Because, as so many other things, they were ruined by spammers.
Yahoo bots do look at it, but they don't count as anything towards perceived relevancy.
Have the 'known good' tutorials link each other, or perhaps have learn.perl.org link them and perhaps provide a 'certified good tutorials' image link. Automate this as much as possible.