Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hello Monks,

In an ideal world, I would know 3,000 programming languages. And when faced with any task, I would open my Rolodex o'Languages (with all of which I am quite proficient), and merrily flip through it to find the perfect tool to solve my current problem, mumbling to myself "Ada? no... ALGOL? no... Applescript? no... ASM? no... AWK? no..."

Half an hour later, I would leap from my chair, exclaiming "The right tool for this job is a combination of UNISAP and PACTOLUS, with just a touch of ASDIMPL and XPOP!" And it would be the perfect tool for this job, and I would whip up an elegant, simple bit of code which efficiently solves my problem while being readable and easy to maintain.

In the real world, I'm somewhat limited by the number of languages I know, and I'm limited by the amount of time I have to dedicate to learning new languages.

For this reason I sometimes tend to use Perl in perhaps inappropriate ways. For example, I have never learned bash scripting beyond the very basics, or sed, or awk; when I want to do anything non-basic involving the shell, I pipe it through Perl. I needed to write a quick GTK app one day, so I wrote it in GTK2-Perl. Another day a QT app, again I used Perl bindings. When I need to create an Excel document with a report from MS SQL-Server, I shudder a bit, then use Perl. When I use vim, I avoid vim-style regexes and use perldo. And so on, and so forth.

Often I'm pretty sure there's another language or tool which was made to solve the problem I'm solving. Instead I wield Perl like a Neanderthal and bludgeon the problem to death, because I (unfortunately?) have a tool which can do anything I want, and because Perl is What I Know. And it works, for certain values of "works". If I was writing an OS kernel or a control system for a nuclear reactor, of course I wouldn't use Perl, but short of that, Perl can solve almost every problem I want to solve.

To put it another way, I think there are short-term and long-term costs. In the short term, using Perl all over the place is good because I can solve problems using resources I already have. (Knowledge being the resource in question here.) But if I spent the time to learn Java or Ruby or assembler language (or whatever) really well, it may save me time in the long run, by avoiding Perl problems that arise when Perl isn't the ideal tool.

But I know that if I wanted, I could devote the next decade to learning more and more about Perl, and still never learn everything there is to know. I still learn something new every single time I come to PerlMonks; I don't see that stopping any time soon. And much of what I learn about Perl is applicable to other languages. But much is also not at all applicable to any other language; it's learning Perl, and it's useful if I use Perl, and it's a waste of time if I don't use Perl.

My point (there is one, I assure you!) is this: Is there a point where it's time to say "I know Perl 'well enough'; it's time to devote most of my resources to learning something else"? If only for the sake of having more tools available? Do you think it's more important to devote one's time to becoming a jack of all trades or to try to become a master at one thing in particular? Assuming one lacks the time or resources to do both, or assuming that one is looking to decide where to allocate the most effort.

(update: Thank you all for the thoughtful replies.)


In reply to Right tool for the job? by chester

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-28 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found