Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: if statement confusion

by apotheon (Deacon)
on Jun 15, 2012 at 17:29 UTC ( #976467=note: print w/ replies, xml ) Need Help??


in reply to Re^2: if statement confusion
in thread if statement confusion

I think you are creating a problem where none exists. The point does not seem to be about whether a reader merely glances at something and proclaims understanding; rather, it is about whether the writer strives to make things clear to the reader. Thus, it is not about a lawyer who merely glances at a contract then asks a client to sign on the dotted line, but rather about someone writing a contract to be clear rather than to be opaque and full of gotchas.

Would you trust a lawyer who wrote contracts as though paid by the letter rather than as though paid for agreeable results? Would you, likewise, trust a lawyer who argued your case in court as though paid by how long he could make your trial last rather than as though he would only be paid if you were acquitted of all charges? What about a doctor who was paid based on how many different pharmaceutical companies' products he injected into you, rather than based on positive benefit to your health?

I prefer a programmer who writes clear code over a programmer who either plays golf with production code or bases his or her self-worth as a programmer on the number of clever tricks crammed into a simple function.

print substr("Just another Perl hacker", 0, -2);
- apotheon
Licensed OWL by Chad Perrin


Comment on Re^3: if statement confusion
Re^4: if statement confusion
by BrowserUk (Pope) on Jun 15, 2012 at 18:00 UTC
    but rather about someone writing a contract to be clear rather than to be opaque and full of gotchas.

    Here's the rub. Life isn't like that. If all contracts were fair, we wouldn't need them, or lawyers to prepare them or vet them.

    I want a lawyer who doesn't take the contracts I ask him to vet before I sign them at face value. Who doesn't judge the correctness of the contract on the basis of it containing short sentences and few polysyllabic words.

    I want a lawyer that understands the Terms of Art, and the significance of the presence or absence in a contract. I want him or her to know what they are doing; to understand the importance and significance of the terminology (or lack thereof) in the contract and advise me accordingly; and I want a lawyer that will take full responsibility for their advise should the contract be (or need to be) challenged in court.

    And I want programmers to recognise that restricting themselves to a "simple" subset of their programing languages, doesn't make their programs "clear"; it makes them verbose. And the more lines of code you write; the more bugs you will generate.

    And all your use of words like "clever", "tricks" & "golf" are convenient but meaningless screens for the lazy and incompetent to hide behind.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      My point was not to suggest that life is fair, or that one should always take contracts at face value. It was to point out that the preceding person's point (while poorly presented) was about the fact that the guy writing the code should try to make the code clear. Your analogy to contractual law is looking at the wrong side of the transaction, talking about the behavior of the reader rather than that of the writer.

      Obviously, code should be correct, first and foremost -- but within that constraint, it should also be as clear as reasonably possible. There's no necessity to limit oneself to a simplistic subset of a language to achieve that (and I agree with the entire paragraph in which you mentioned opposition to that notion), in the general case, and I even agree that in this case it makes sense to use a clarified and correct ternary operator, but I disagree with your approach of disputing the statement that one should strive to write clear code.

      I also think you're now manufacturing disagreement with me where it does not actually exist, when denigrating my character (apparently on the basis of the fact that you're feeling defensive).

      In the end, the lawyer analogy is a poor one for this situation, no matter what point you're trying to make. The motives, incentives, and circumstances surrounding contracts and software applications are simply too different, and I should have avoided using your analogy to try to make my point. I also should have said that I thought you were creating disagreement where none essentially existed, rather than a problem. Here we see that clarity in English is important, just as it is in Perl.

      print substr("Just another Perl hacker", 0, -2);
      - apotheon
      Licensed OWL by Chad Perrin

        So basically, you didn't join this thread in support of sundialsvc4's contention; nor even in support of my counter argument; but simply for the sake of having an argument.

        Discussion ends.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976467]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-07-29 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls