Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The law of inconsistent assumptions (a pseudo-philosophical rant)

There is a pervasive circumstance in human language (in general) and programming languages (in particular) where communication breaks down because people are using the same "words" but with subtly (or overtly) different understandings of the context.

This circumstance is called "The law of inconsistent assumptions" (at least that's what I'm calling it here).

I refer to it as "the law" partially to imply that this circumstance cannot be completely eradicated, (absent some 'telepathic' mode of communication); and also to imply that it is always there, behind the scenes, (like gravity). Just like gravity, "the law" can be useful if recognized (help explain planetary motion), or harmful if ignored (make you go "splat" when trying to fly like superman).

Why this matters: from a perl point-of-you

When you get a bunch of knowledgable people of good will and disposition together, you can notice some remarkable creativity. You can also notice that some discussions seem to drone on with people 'talking past one another'. When you realize it is not because of ill-will or ignorance of the participants, you realize this is one manifestation of "The law of inconsistent assumptions". When you recognize "the law" taking effect, you have acquired an opportunity over a cognitive stumbling block, and you are going to be a better programmer, teacher, and communicator because of it.

Straightforward Examples

Here are some examples of "the law" in perl programming terms.

Throwaway Warning Messages

### fee_file.pl use strict; use warnings; $main::fee = 0xfee; __END__ Produces the warning message: Name "main::fee" used only once: possible typo at ...

The previous example correctly sends a warning based on the assumption that the name main::fee should appear at least twice in a single script.

### foo_file.pl use strict; use warnings; require "fee_file.pl"; my $foo; print $main::fee; print $foo = 12; __END__ Produces the warning message: Name "main::fee" used only once: possible typo at ...

The previous example sends a spurious warning message because the former assumption breaks down ... incomplete assumptions about what constitutes a "single script".

Language Comparision Debates

Someone once declared

Perl guarantees that for virtually every time you access a variable, you will have to type at least one more character (and hit Shift!) than Python.

... and then went on to compare ..

### perl $foo = 1; ### python foo = 1

... but left out the comparision ..

### perl print "Hello $foo." ### 19 chars ### python print "Hello "+foo+".", ### 23 chars

... the first comparison assumes a limited definition of 'accessing a variable' and ignores that the '$' symbol is actually a *command*, not just some throw-away extra keystroke that has no relevance whatsoever. Thus, a more complete comparison would be the $ command versus the "++" command.

Vigorous Areeing

A particularly good example of "the law" (in terms of human communication) can be found at this node where the participants (knowledgable people) nevertheless seem to be "disagreeing" but in actuality probably agree quite a bit, but the buzzwords GUI,CLI make communication difficult.

The bottom line

These examples are not even the tip of the iceburg, "The law of inconsistent assumptions" is everywhere. As you and I begin to notice it more and more, the benifits will follow.


In reply to The Law of Inconsistent Assumptions by dimar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-25 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found