in reply to Re: Re: Question Marks in Subroutine Names
in thread Question Marks in Subroutine Names

hein? The sex method would return a value indiciating whether the object/individual was male or female.

--
perl -pew "s/\b;([mnst])/'$1/g"

  • Comment on Re: Re: Re: Question Marks in Subroutine Names

Replies are listed 'Best First'.
Re: Re: Re: Re: Question Marks in Subroutine Names
by dug (Chaplain) on May 08, 2002 at 03:32 UTC
    Sure, it could.
    If you go back and read the original post, this is about readability.

    ## # sub sex() # returns qw( yes no maybe somtimes male female # only_on_tuesdays when_i_get_older ) or a miryad of other # possibilities.

    That said, $obj->sex? could get interesting :)

    As a true or false question goes, sex will probably always return true, so no question mark needed, if that's what you were trying to say.
      I never lost sight of the fact that this was about readability, hence my two initial points
    • use of ? would add ambiguity (the antithesis of readability)
    • Incredibly_long_sentence_like_function_names are not readable and if you need/insist on that sort of large definition for something I think OO is a better route.
    • And yet when lachoy makes the second point here it isn't so difficult to accept.

      --
      perl -pew "s/\b;([mnst])/'$1/g"

        One: Obviously, you disagree with my original point that allowing question marks in subroutine declarations would make things more readable. You disagree with me and I disagree with you. But at least that is what I was asking about.

        Two: Obviously we disagree about your second point as well. While I do not use really_rediculously_long_variable_names_that_are_not_meaningful, I do use "readable, descriptive names". (See the examples.)
        Also, I don't know what gave you the idea that these particular functions aren't being called via an object in a package.

        Maybe reading my response to lachoy's post will get you and I closer to the same page.