in reply to Re: Re: Question Marks in Subroutine Names
in thread Question Marks in Subroutine Names
I disagree with your views on English Usage, I think... your sentence is declarative, but your subroutine is imperative. The statement "contact is male", like the statement "ChemBoy is human" makes an assertion, and may or may not be true--your interpretation would seem to me to be equivalent to somebody saying "ChemBoy is martian" and having it magically become true (which has not so far taken place, as far as I can tell--though I haven't hit submit, yet...). Whereas if you had a subroutine &make_martian($ChemBoy), I'd be entitled to be worried. :-)
And if you want English-like syntax, why a question mark in the first place? In standard English usage, conditionals do not have question marks: the phrase "if the customer is female, start the letter with 'Ms.'; otherwise, with 'Mr.'" yields the following code, which seems to me perfectly readable without further punctuation:
if ($customer->is_female) { print "Dear Ms. ", $customer->surname(); } else { print "Dear Mr. ", $customer->surname(); }
Or, of course, with punctuation (as mentioned elsewhere in this thread):
print "Dear ", ($customer->is_female?"Ms. ":"Mr. "),$customer->surname +();
All of which, of course, are missing the final comma of the salutation, but that's a separate issue. :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Question Marks in Subroutine Names
by dug (Chaplain) on May 08, 2002 at 07:24 UTC |