GrandFather has asked for the wisdom of the Perl Monks concerning the following question:
I've been asked to put together a Perl training day for various workmates. The suggested format is that I provide a set of questions and reference material (that may include links to online material) and that I supervise the session. At present I anticipate providing a mixture of questions with some to be answered by individuals and some to be used as discussion points for the whole group. Individual's answers will generally require code.
The initial participants (if things go well we may run it again for a different group) will be a group of four people with various previous Perl experience ranging from none through "can write nice PHP web apps in Perl" to "can write useful tools in Cish Perl". Most of them have extensive experience with other languages (C++ in particular, except the PHP guy).
The objective of the course is to get them more familiar with Perl techniques and reference resources so they can more effectively write and adapt Perl utilities and work with some of the larger Perl applications we use.
So the question is: what should I feed them? A Super Search turned up a few related posts from which I will get some ideas (strange responses to inhouse perl training and Where and how to start learning Perl for a start). What are the key elements of Perl you think should be included?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Design a Perl training day
by BioLion (Curate) on Mar 30, 2011 at 07:26 UTC | |
This kind of relates to what biohisham said, but I have run a few courses and attended a few more, and the best ones are usually those that work through a problem. This way it can be tailored to what people will do, and gives them the chance to experiment within their own ability and 'learn to teach themselves' - i.e. you can show them the best forums and documentation. Identifying the best problem(s) is the important part, and others here will have a much better idea of the best resources to get people familiar with. I guess the important point is that the problem should teach them the basics and allow room for allowing people to learn and develop if they already/quickly get the basics. Hope this helps,
Just a something something...
| [reply] |
|
Re: Design a Perl training day
by biohisham (Priest) on Mar 30, 2011 at 07:05 UTC | |
So, if you do more of data/text processing then touching on file/folder management, regular expressions, loops, I/O operations, buffering, different ways to open and read files, data structures and persistence so modules like DB_File, Storable..etc come to mind. If you are on the web programming side, CGI, Socket programming, IPC, DNS resolution are maybe what needs to go under the spotlight. If you are on the Graphical side, Tk and company But notwithstanding, developing the way to think a situation through is worthwhile, I mean, you may not teach them everything but make them aware of the topics and resources that they can reach to and how they go about it, so perldoc, CPAN, The Monastery and references to interesting books need to be mentioned... Excellence is an Endeavor of Persistence. A Year-Old Monk :D . | [reply] [d/l] |
|
Re: Design a Perl training day
by jethro (Monsignor) on Mar 30, 2011 at 09:31 UTC | |
One thing I would definitely include is how to find and select modules appropriate for the task (involving CPAN, checking out the module and asking around on sites like perlmonks). This should be new terrain to the C++ guys at least (AFAIK). Also there should be a question geared toward showing the advantage of using 'foreach' or 'map' to using 'for (;;)'. While JavaFan got a point about TMTOWTDI, using for(;;) on a fixed array is just not using the power of perl And you should show them the power of hashes (if they not already know that). Using hashes is what differentiates intermediate perl programmers from beginners | [reply] |
by GrandFather (Saint) on Mar 30, 2011 at 11:41 UTC | |
Yes, those are very much elements that I had in mind and good confirmation that my initial ideas aren't too far off the mark. CPAN will get coverage, but most of these people are accustomed to using the Boost library which provides some inoculation against the "ain't written here" syndrome that often mitigates against using resources like CPAN. Probably I'll use Getopt::Long as an example module - something that's pretty much immediately useful and easy to understand and use. Using for in for (;;), for (x .. y) and for (@array) variants to compare and contrast the different usage modes for for loops was definitely one item on the list of topics to cover. The power of hashes is indeed another "must cover" topic.
True laziness is hard work
| [reply] [d/l] [select] |
by raybies (Chaplain) on Mar 30, 2011 at 13:03 UTC | |
I agree with the suggestions above. Hashes, especially, change the way you think about data. Regex in Perl is pure gold too, and could take months to teach if you went into any amount of detail. One thing I'd do is teach how to get information in Perl. Not just CPAN (though that's a great suggestion cuz there's so much to do), but perldoc, and just how simple it is to formulate a quickie test program. I'd think that perltut would be a decent place to start. For me, I use Perl most often, not to build a massive production piece of software, but just to automate the environment and the data generated by the legacy systems I'm consigned to maintain. So getting text/arguments/pipes/sockets/data into my program and doing something quick with it, etc... is very useful to me. Perl's so nice in that way. I also love how Perl handles References--the hash of hash (of etc.) is a beautiful thing. | [reply] |
|
Re: Design a Perl training day
by JavaFan (Canon) on Mar 30, 2011 at 08:09 UTC | |
So the question is: what should I feed them?Good question, but you're asking the wrong crowd. Don't ask us, ask them. Ask them what they are needing Perl for, what the knowledge is they lack, and how they typically write programs. Note that it's perfectly fine to write "Cish Perl". Or "PHPish Perl". Your coworkers have problems to solve, they don't need to drink the Perl koolaid. | [reply] |
by GrandFather (Saint) on Mar 31, 2011 at 04:01 UTC | |
It is interesting to note that the Cish Perl programmer is the one who suggested the training day and largely because he was very impressed with the way I managed to tidy some of the Cish code he'd written and wasn't happy with. Sure you can write any old crap that works most of the time in pretty much any old language, but by knowing a little more of what's possible with whatever tool you are using you are likely to get better use out of the tool. The purpose of the training day is to show some of what's possible. The reason for asking here is to get a broarder idea of the things people think important so I can make a better informed decision about what to include and to what depth.
True laziness is hard work
| [reply] |
|
Re: Design a Perl training day
by locked_user sundialsvc4 (Abbot) on Mar 30, 2011 at 17:38 UTC | |
It will surprise you how little of the material you might prepare will actually be used, so take care not to allocate too much of it. I strongly recommend that you consider the following: If you know who is going to be participating, try to spend a little time with each of them a couple of days ahead, show them your proposed outline and ask them about things they would particularly seek to know. Note each person’s name next to the item on your outline, and when you begin and end this point, make a general gesture in their general direction without calling them out by name, and ask the wind ... “is that helpful?” In a professional-training setting, do not quiz. Unless you have been tasked to assure a particular competency that they are required to demonstrate (which is not the case here), do not put anyone on the spot. (Ummm, yes. I have been. For many years. Still am.) | |
|
Re: Design a Perl training day
by Ratazong (Monsignor) on Mar 30, 2011 at 13:26 UTC | |
I would structure the training in five parts | [reply] |
by Anonymous Monk on Mar 30, 2011 at 13:42 UTC | |
| [reply] |
|
Re: Design a Perl training day
by MidLifeXis (Monsignor) on Mar 30, 2011 at 12:45 UTC | |
If I were to take a training day on $newlanguage, I would want to know the domains it should be used in, what it excels at, what it has a hard time doing, syntax, idioms, libraries and tools at my disposal, and where to go for more help and information. Finding out what I don't know about the language would be useful. It sounds like your audience has coding experience, so you aren't teaching them how to code, just the proper use of this particular tool. If your participants have experience in other languages, perhaps it would be worth exploring some tasks where the solution in the language of experience and Perl are different - for loops going over an array for example. Usage of (and when not to use) grep, map, and so on I could see being useful as well. --MidLifeXis | [reply] [d/l] [select] |
|
Re: Design a Perl training day
by toolic (Bishop) on Mar 31, 2011 at 03:07 UTC | |
Disclaimer: my co-workers and I are not programmers; we are hardware (chip) designers. However, many of us use Perl regularly to make our lives easier in a unix setting. From memory, here is the condensed list: | [reply] [d/l] [select] |
|
Re: Design a Perl training day
by holli (Abbot) on Mar 30, 2011 at 08:44 UTC | |
... four people with various previous Perl experience ranging from none through "can write nice PHP web apps in Perl" to "can write useful tools in Cish Perl". Most of them have extensive experience with other languages ...I think it is a bad idea to start with such an inhomogeneous group. It would probably be better to create different training days for different groups, depending on their level of experience. holli You can lead your users to water, but alas, you cannot drown them. | [reply] [d/l] |
by GrandFather (Saint) on Mar 30, 2011 at 11:28 UTC | |
I haven't much choice over the composition of the group. It's a fairly major coup to have been asked to do this at all. We have been mainly a Windows/C++ shop developing what amounts to a single large data acquisition and analysis package that has been used exclusively with the signal conditioning and data collection hardware our company sells. Perl has been a tool relegated to behind the scenes stuff that I've mostly been involved in. But we are growing and are becoming involved in managing Linux boxes for web based systems so Perl tools are becoming more important.
True laziness is hard work
| [reply] |
|
Re: Design a Perl training day
by johngg (Canon) on Mar 30, 2011 at 13:54 UTC | |
There have been mentions of the power of hashes and Ratazong specifically mentions nested hashes/arrays. I would expand that slightly and suggest that, if you have the time, you show how you might construct a simple data structure, e.g.HoA, from information in a file. You could then use Data::Dumper->Dump() or ->Dumpxs() to show your colleagues how easy it is to verify the data structures you have built. I think that seeing the compilable Perl code produced as Data::Dumper output would be very instructive. Cheers, JohnGG | [reply] [d/l] [select] |
|
Re: Design a Perl training day
by cavac (Prior) on Mar 30, 2011 at 17:02 UTC | |
I would suggest using at least half an hour of that time to show your workmates how to use Perl::Critic (or Test::Perl::Critic). Set P::C on a quite high verbose level and provide each workmate with a copy of Perl Best Practices. Since a single day is a rather short time for training, with P::C you will them a valuable tool with which they further their knowledge on their own as well as check their code for common mistakes and problems. Just my 2 cents... | [reply] |
|
Re: Design a Perl training day
by goibhniu (Hermit) on Mar 30, 2011 at 17:53 UTC | |
I like ratazong's outline as a straw man. Do you have something like this in mind? Could we see what you're already planning? I might start with a simple "hello world" with vi/notepad and execute at the command prompt. Use this to get their feet wet quick and show them the basic environment before moving to your IDE / advanced environment. Build up from HelloWorld to show the importance of strictures (and diagnostics) and how to 'use' a module (you could come back to this later to discuss CPAN). I consider this a small improvement on ratazong's outline. At some point early, point them to perldoc and online reference material. In addition, I've got many good style suggestions from you through my years reading at perlmonks. I would think you could easily add a section on simple testing, style and why certain things are better than others (e.g. for vs. map in void context). This might be a section between ratzong's 4th and 5th; after all the generic and before the particular. At the end point them again to reference materials. I've got a lot from perlrun, perltoot, perlreftut, perldsc and perlre(.*). OK, and many more. Oh, and encourage them to join PerlMonks! That's where I got most of my perl learning. #my sig used to say 'I humbly seek wisdom. '. Now it says: use strict; use warnings; I humbly seek wisdom. | [reply] |
|
Re: Design a Perl training day
by repellent (Priest) on Apr 05, 2011 at 05:57 UTC | |
| [reply] |
|
Re: Design a Perl training day - program and report
by GrandFather (Saint) on May 26, 2011 at 12:07 UTC | |
Well, the Perl Training Day finally happened. We covered about half the material I prepared, but it was a great success. I had aimed for the day to be fun, for each person to finish the day feeling they had learned worthwhile stuff, to introduce interesting and important corners of Perl and to get people comfortable with using a variety of Perl resources. So far as I can tell I succeeded on each point despite a large disparity in the backgrounds and skills of the participants. So, how did I structure it? Well, the fun element was the lollipop element (think node rep and XP). The material was structured as a series of exercises where the participant did some guided research, then a coding exercise, then a group discussion that examined the code generated by individuals in the group and some reference code that I provided. This structure worked very well with those quicker on the uptake or with a more appropriate background getting the core task completed first, but then going on to play with their solution, or helping others in the group. The following is the day plan we followed, although time slipped and not all the material was covered: Read more... (21 kB)
I'll follow up with the reference solutions next week - I forgot to email them home for formatting clean up before uploading here.
True laziness is hard work
| [reply] [d/l] [select] |
by GrandFather (Saint) on Oct 05, 2011 at 20:52 UTC | |
Somewhat more than a week later! However, here are the reference "answers":
True laziness is hard work
| [reply] [d/l] |
|
Re: Design a Perl training day
by Voronich (Hermit) on Mar 31, 2011 at 17:28 UTC | |
One thing that comes to mind though is that if I'm being pulled into a training session on a new technology, whether there's a mandate that it be used or not, I generally need to be sold on it. For example: As a C++ weenie it took a LONG time for me to reach for perl as a preferred tool for certain tasks. What finally did it was regular expressions. If I'd understood something of the power of regexes early on it would have been a much quicker transition ;)
| [reply] |
|
Re: Design a Perl training day
by szabgab (Priest) on Apr 02, 2011 at 04:18 UTC | |
This would mean they are already familiar with the specific problem the code needs to solve. They also return with some physical evidence of that they did in that day not "only" with what they have in their head. | [reply] |