Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Trudging along the learning perl path. -- wrong path? :=)

by shmem (Chancellor)
on Apr 15, 2017 at 22:19 UTC ( #1188025=note: print w/replies, xml ) Need Help??


in reply to Re^2: Trudging along the learning perl path. -- wrong path? :=)
in thread Trudging along the learning perl path.

So can I safely assume that the good Perl developers use these modules and these are not training wheels for new learners? Meaning professional Perl guys too use modules and they rarely roll their own stuff (unless needed)?

Yes, of course, if they remember that they exist, while solving a problem. For a good programmer, pulling unique values out of an array is an easy thing, and it is written quickly. If it is a small bit in the overall task, they just write it inline, and done. But if it is to be done all over the place, and/or the program deals extensively with lists, they will pull in List::Util for sure, instead of writing subroutines already written.

Good programmers know when to use a module; and good programmers also understand the modules they are using. They use modules, because they are lazy and won't solve things already solved; because they are impatient and want to see their job done, so they just include things already done; and because doing that, their hubris can unfold making just their own code bullet proof - because the modules they include are tested elswhere, and they avoid the technical debt of maintaining, testing and improving stuff written by somebody else: it is somebody elses burden.

Of course, paraphrasing Fred Allen, "CPAN is a medium because anything well done is rare" - there surely are lousy modules on CPAN, but many gems. To tell them apart, you need expertise, and you get that by experience, which besides trial and error and reading documentation means learning from others. So, yes, modules are also training wheels for new learners, and I recommend reading their source code. If after reading you frown upon them, or feel enlightened, that's a good sign; but beware: you might frown for the wrong reason, or have been enlightened by false lights.

update: s/List::Utils/List::Util/ - thanks Discipulus

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re^3: Trudging along the learning perl path. -- wrong path? :=)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1188025]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2019-05-20 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (128 votes). Check out past polls.

    Notices?