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

comment on

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

I agree that premature optimization should be avoided. However, I don't see Perl golf as premature optimization. I see it as a useful tool for mastering the Perl language.

I have spent a fair amount of time playing Perl golf, and I have found that in order to golf well, I am forced to learn everything about the Perl language that I possibly can. I know what all the command line switches do, because in the course of golfing I have read all the documentation and have tried them all. Likewise, I know what pretty much all the built-in variables (like $=, $], etc.) represent, and what their initial values are. Again, this is because I had to know these things to do well at golf. Do I use these things often in real code? Not really. But I know what they are and how to use them, because I now have experience.

In fact, not only does golfing force you to learn about Perl command-line switches and variables, but doing well at golf also requires the opposite of premature optimization. In other words, you have to keep your eyes open for different ways of solving a problem. Even after spending much time working with a particular algorithm, you must always be willing to explore other options lest you miss out on a killer way to reduce your score. There are always several good ways of solving a problem, and your job as a golfer is to determine which is "best" (for a particular definition of "best").

I can see how you might view Perl golf as premature optimization, but for me, it is a great way to improve my Perl knowledge and skill. This post is not an argument against nor in favor of a Golf section. I think they're probably fine in the Obfu section. I just wanted to express my feelings about Perl golf itself.

-- Mike

--
XML::Simpler does not require XML::Parser or a SAX parser. It does require File::Slurp.
-- grantm, perldoc XML::Simpler


In reply to Re: Re: Re: Re: Golf Channel by thelenm
in thread Golf Channel by dragonchild

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 wandering the Monastery: (4)
As of 2024-04-23 22:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found