in reply to Golf Channel

I think that this is on purpose. Too much golfing is no good. Some golfs can be posted in SOPW or Obfuscations sections, but if there were a separate Golf section, we would be golf-sick.

Replies are listed 'Best First'.
Re: Re: Golf Channel
by dragonchild (Archbishop) on Apr 30, 2004 at 15:56 UTC
    Are we Meditations sick? Are we Craft sick? How about Snippets sick?

    Also, how on earth is a golf challenge a valid SOPW?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      This will be a very harsh post.

      Are we Meditations sick? Are we Craft sick? How about Snippets sick?

      I think I didn't express myself well. I thought of that golfing is a bad kind of premature optimization that we should avoid. If I see much code like that, I start to become like that without even noticing.

      I mean, from most obfus, it is evident that you should not use such features in production code, still you can learn something from obfus, or ignore them. The difference with obfus is that they may seem like a good idea, just like most premature optimizations at first glance. While you may still learn from a golf, I think that putting them to the obfu section might help.

      Also, how on earth is a golf challenge a valid SOPW?

      You're right, it's not. Still some people have posted golfs there. (Some real golfs too, but some are only golf-like, the most often being to write the intersection of two regexen as one regex as short as possible: golf this reg ex) They probably don't understand why golf is bad. But a separate section would just make it worse.
        This will be a harsh reply.

        A separate section will make it better, actually. By removing the golfing from SOPW and Meditations, we are indicating that, just like obfus, we do not consider golf'ed code to be production code. It is a game, nothing more, nothing less. And, if absolutely necessary, we could post a notice saying "This is for the golfing game. Use in production code at your own risk." (Personally, I think that notice should be at the top of the Obfu section, assuming your concerns are crrect.)

        As for golfing being a premature optimization ... I have no idea where you get that idea. Golf is a game. It's kind of like speed chess - you don't play it in standard tournaments, but it's neat to play in the park.

        ------
        We are the carpenters and bricklayers of the Information Age.

        Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

        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