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

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.

Replies are listed 'Best First'.
Re5: Question Marks in Subroutine Names
by belg4mit (Prior) on May 08, 2002 at 03:42 UTC
    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.