Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Perl Golf Ethics

by Anonymous Monk
on Dec 31, 2006 at 10:44 UTC ( [id://592386]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Currently, I am golfing at the Fonality Golf Challenge I have an ethics question.

I have found, in the post mortem of a past golf challenge, a solution to that hole that could help me in this current golf. Is it acceptable to use part of that solution?

In general, I would say that since this information is freely available on the web, all players have access to it and it is fair game. In fact, it takes some modification of the original to even fit it into my current solution.

On the other hand, it was very creative and based on the author’s notes took quite some time and effort to create. So, part of me feels a little guilty for using it, especially in this case where there is a potential for financial gain (note: I have no chance of beating the original author in this golf either).

I have not been golfing for very long. So, I ask, what does the Perl and Perl Golfing community think about using portions of previous solutions?

PS: I did a bad thing and posted this anonymously. Not because I wanted to avoid any XP flack, but simply because I am a little embarrassed about asking such a question.

Replies are listed 'Best First'.
Re: Perl Golf Ethics
by cog (Parson) on Dec 31, 2006 at 11:06 UTC
    I have found, in the post mortem of a past golf challenge, a solution to that hole that could help me in this current golf. Is it acceptable to use part of that solution?

    Why don't you give them your answer and state the fact that you used whatever you did?

    This way you're not fooling anyone, you're showing you have ethics and, something that people quite often miss, you're showing that you can find other solutions that were not created by you.

    It's kind of the same advantage of hiring someone that will always look on Perlmonks to see if someone did the task before, or someone that will always look for an open source project that will solve his problem before trying to solve it him/herself. It's actually a good thing!

Re: Perl Golf Ethics
by rinceWind (Monsignor) on Dec 31, 2006 at 11:19 UTC

    The definitive place to look for answers to questions such as yours, should be the competition rules. As there doesn't seem to be an answer, I suggest sending an email to the address shown for "questions". I don't see why posting or emailing such a question is embarrassing - maybe you'll receive an answer that you don't like. But maybe the clarification would stop somebody else reusing an even better solution out there on the web, that you haven't found yet :).

    Regarding the ethics, I do think that using somebody else's solution or part thereof, is going against the spirit of the competition, much in the same way as internet searches in school exams, or using a chess program to help find your moves against online opponents. On the other hand, if you can rattle off the techniques used in past golf solutions from memory, this is perfectly valid. Having another window open with the prior code in it, is to my mind cheating.

    That's my take on it. I've never run a golf competition; maybe others can comment.


    Oh Lord, won’t you burn me a Knoppix CD ?
    My friends all rate Windows, I must disagree.
    Your powers of persuasion will set them all free,
    So oh Lord, won’t you burn me a Knoppix CD ?
    (Missquoting Janis Joplin)

      I remember a University colleague cheating with an assignment in AI - he had to build an alpha-beta pruning based opponent in connect4. He lingered until the very end, and then resorted to the Internet (and 10 years ago I don't remember Google :). He later commented: "0 in AI... but 10 in websurfing!".

      It's interesting that you cite the chess game. There are a lot of books on chess, and many openings have been studied and are learnt by a lot of people. What would you think about someone reviewing his chess book while doing an online (e.g. play-by-mail) match? I'm not sure I'd reduce it all to "take it only from your memory", even if I've to admit that I don't really know where to draw the line.

      perl -ple'$_=reverse' <<<ti.xittelop@oivalf

      Don't fool yourself.

        With online chess, the rules are usually given on the site. For non real time chess, such as correspondence chess (e.g. consulting opening books or chess opening websites is allowed, but feeding your moves or position to a chess program is not allowed, though they can't stop you, and it's difficult to prove it.

        The site I mentioned has forums where this subject has been discussed in great depth.


        Oh Lord, won’t you burn me a Knoppix CD ?
        My friends all rate Windows, I must disagree.
        Your powers of persuasion will set them all free,
        So oh Lord, won’t you burn me a Knoppix CD ?
        (Missquoting Janis Joplin)

Re: Perl Golf Ethics
by throop (Chaplain) on Dec 31, 2006 at 14:16 UTC
    Anonymous Brother

    Let us ask ourselves, "Why is Fonality sponsoring this tourney?" In their rules, they ask that entrants be willing to talk to one of their recruiters. Clearly, they hope to hire some good Perl talent from the competition.

    Ask yourself what Fonality would want from an employee in a similar situation. Suppose you were a Fonality manager and you asked a new hire to code a solution to a problem. If that employee knew that there was code on the web that (with minor modification) would solve the problem, would you want him to

    • Eschew the solution because he hadn't written it out of his own cleverness?
    • Use the solution, crediting the author?
    • Use the solution and make no reference to the source of the approach?
Re: Perl Golf Ethics
by thospel (Hermit) on Dec 31, 2006 at 16:46 UTC
    In the perl golf community it is in fact expected that golfers learn from solutions to previous golfs. Many of the standard tricks of the trade have not been invented by the people using them.

    If it turns out that some specific but not generally known piece of knowledge helps enormously in a golf, it is the habit to inform the party holding the golf so they can decide if they want to add it to the challenge notes. That way everyone may play on a more level field.

    I have already told fonality about an existing golf that helps a lot, but I forgot to suggest a link to it on the rules page.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl Golf Ethics
by ysth (Canon) on Dec 31, 2006 at 11:32 UTC
    Golf involves many tricks that you can learn from others; go for it!
Re: Perl Golf Ethics
by TedYoung (Deacon) on Dec 31, 2006 at 17:34 UTC

    Thank you for the replies everyone.

    Looking back, I think my choice of the word “Ethical” was poor. Really this is about perl golf rules and standards, not ethics.

    Again, I posted anonymously because I suspected the answer to my question was considered obvious; something that every golfer just knows. But, from my point of view, it could have easily been either “obviously yes” or “obviously no”. :-) As always, the monastery continues to be gentle to those still learning.

    And thanks ton, it looks like you have already thought of this. As always your 10.54 steps ahead of me! You are an amazing golfer, and your 17 point submission had me climbing the walls. Even through it was rejected, when this is all over, I have to see what you posted.

    Back to the battle grounds!

    Ted Young

    ($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
      Whoever posted 17 stroke solutions wasn't me.
Re: Perl Golf Ethics
by shmem (Chancellor) on Dec 31, 2006 at 13:18 UTC
    Your ethics are yours; if it's ok for you to use prior art, go for it. The final decision lies in the hands of fonality. They surely also have The Golf Book, and they may accept or reject your solution.


    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: Perl Golf Ethics
by ww (Archbishop) on Dec 31, 2006 at 13:47 UTC
    IMO, sounds like using it, with attribution as suggested above, is just fine.

    But, at the risk of a bit too much pop psychology, does the fact you felt the need to post annonymously hint at ethical reservations on your part? (If so, perhaps these answers will help allay or even resolve them.)

    However, if the embarrassment you felt is merely at some sense of ignorance then I see no need for it. What's the most used area here? SOPW. We share our ignorance in the OPs there... to our mutual benefit.

    ...and good luck, in any case, on the challenge!

Re: Perl Golf Ethics
by rodion (Chaplain) on Dec 31, 2006 at 12:23 UTC
    Golf is a discipline with an artificial goal, set up to provide competition among its participants, with explicit rules for the competition.

    Software is a discipline with practical goals, often accomplished through cooperation of its participants, who have to tinker with the rules of cooperation and competition along the way.

    While both involve ethics, intelligence and cleverness in some form, the forms these abilities take in each discipline is quite different. I believe it would be a major dis-service to the cooperative spirit of programming communities, perlmonks especially, to apply the ethical lessons from golf to our sphere, even under the guise of an analogy. It subtly undermines the cooperation, and confuses the ethical questions, and good cooperation and clear ethics are both of them hard to establish and maintain.

    It is probably just as bad to reason from software to golf, but I'll leave golfers to comment on that, preferably in a golfing forum.

Re: Perl Golf Ethics
by syphilis (Archbishop) on Jan 01, 2007 at 11:52 UTC
    Seems to me that both "Perl Golf" and the other form of "Golf" (where one hits a ball with a stick ... and the ball's not even moving ... how easy is that !!) are, indeed, governed by the same ethical consideration - namely:

    If the rules do not prohibit it, then it's ethical.

    That is surely "ethics" at it's most fundamental.

      If the rules do not prohibit it, then it's ethical.

      Heh. Exactly the opposite of firewall ruleset logic, where anything not expressly permitted is verboten by default.

      Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. You can just call me "Mister Sanity". Why, I've got so much sanity it's driving me crazy.
Re: Perl Golf Ethics
by ambrus (Abbot) on Jan 01, 2007 at 16:49 UTC

    I searched a lot with google because I suspected that roman number conversion is such an obvious topic that there had to be another perl golf competition about it. I didn't find anything, but if I did, I would have tried to use it in my golf solution. Thus, I think it is within the rules.

        Thanks, I've already found it. In fact shmem has linked to The Golf Book that contains the solution in this very thread.

        As it turns out, 10 out of 12 of the golfers that ended up above me in the final leader-board have used one of the two magic formulas of ton.

Whitespace in Perl Golf
by petdance (Parson) on Jan 01, 2007 at 04:54 UTC
    Also note that the scoring program doesn't count trailing whitespace each line. There's a lot of encoding that can be done with whitespace. See Acme::Bleach.


      You can do that, but such solutions should be rejected. The rules do not say that trailing whitespace doesn't count.

      The removal of trailing whitespace in the test programs was intentionally added during the TPR golfs because it turned out that people have the unfortunate habit of using editors where it's not very visible that they have extra trailing newlines, and where they had the winning solution without realizing it. And then these people wasted days trying to still improve their solution. Solving this problem of serious players was decided to be more important than stopping jokers playing games with trailing whitespace.

      If people seriously think this is a problem I could change the way this case is handled in the generic test program skeleton. But currently I don't considere this well known abuse to be relevant enough for that.

        such solutions should be rejected. The rules do not say that trailing whitespace doesn't count.
        Nor do they specify how scoring is done, other than by giving you a means to calculate your score. How can a score calculated for you then be rejected as a rule violation?

        Update: thospel is correct; I looked for such a rule and somehow managed to miss it. So never mind.

        I would prefer that trailing whitespace WOULD be counted, and people should be smart enough to remove. Shlomi found a solution where any given program can be compressed into whitespace, a la Acme::Bleach, with a 25-byte decoder.

        Let's just make it explicit.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://592386]
Approved by Joost
Front-paged by ww
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 14:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found