Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: RFC: Tutorial: use strict; now what!?

by ikegami (Patriarch)
on Feb 09, 2012 at 04:20 UTC ( [id://952656]=note: print w/replies, xml ) Need Help??


in reply to RFC: Tutorial: use strict; now what!?

I didn't have time to read the whole thing yet, but I saw a few oddities.

"Execution of (FILE) aborted due to compilation errors." is not from strict itself, and is likely not to happen for 'refs' errors (since they are run-time errors). It's output for all compile-time errors, including run-time errors in files (modules) executed at compile-time.

"A bareword, essentially, is anything that perl can't parse as something else." =~ s/anything/an identifier/; (e.g. "++++" does not contain an bareword.)

Replies are listed 'Best First'.
Re^2: RFC: Tutorial: use strict; now what!?
by Xiong (Hermit) on Feb 09, 2012 at 11:42 UTC

    Thanks, ikegami. As I mentioned in Re^2: RFC: Tutorial: use strict; now what!?, I'm already replacing the generic, abstract error with concrete examples. But sorry, I'm not willing to discuss (with my target audience) which portions of error output stem from which source or which phase of compilation or execution. We're splashing around in the very shallow end of the pool.

    Agree that my explanation of bareword is a little too loose. But I'd rather not introduce the term 'identifier' since that would only require yet another definition. The definition of bareword given in perldata is a tad too formal and perhaps even misleading:

    A word that has no other interpretation in the grammar will be treated as if it were a quoted string.

    I don't pretend to have a better explanation up my sleeve than what I've given so far; but I'm working on it.

    I'm not the guy you kill, I'm the guy you buy. —Michael Clayton

      But I'd rather not introduce the term 'identifier' since that would only require yet another definition.

      "word", then.

      But sorry, I'm not willing to discuss (with my target audience) which portions of error output stem from which source or which phase of compilation or execution. We're splashing around in the very shallow end of the pool.

      I fully agree that you shouldn't backtrack after stating that strict outputs "Execution of (FILE) aborted due to compilation errors.". Specifically, you shouldn't say strict outputs "Execution of (FILE) aborted due to compilation errors." in the first place. Your own examples make a liar of you. Do you really want to give contradicting information to those you're trying to educate?

      (The common expression is "shallow end of the gene pool", which refers to lack of intelligence, not lack of competence. Let's not call the readers dumb.)

        Oh, I hope I'm not calling anyone 'dumb'... or for that matter, any offensive term. The topic of this tutorial is very basic. There is no real way to say that without implying that the reader is uninformed. In my day we had swimming pools with sloped bottoms; swimming lessons started at the shallow end. Genes were not discussed.

        Jack can stand intelligent but uninformed and request you to define your terms all day. 'Identifier' is jargon; a valid identifier in one language might not be so in another. I see fewer issues with 'word' although you may mean that, too, to have a precise meaning. If you would state precisely, in primitive terms only, what perl considers a bareword then I'll try to work that in. But remember, I'm much less interested in determining the exact bounds of the term than in suggesting a general direction for the newcomer to look.

        Many programmers value precision highly; so do I. But I know I need to bend to the newcomer who has not yet learned that value. Some code will run (correctly or not) without strictures; and after adding strictures the same code does not run but instead shows an error. In a more pedantic expression, execution of the code terminates with a fatal exception. I feel I'm on quite solid ground to say that the newcomer has little tolerance for the fine distinction that, of two lines of error text, one was emitted by strict and the other by the interpreter itself under provocation.

        I sense a burning desire to cram in as much information as possible; I resist this. I'm more inclined to cut and simplify; even at the risk of loss of precision. Sometimes worse is better.

        I've said twice now that I intend to remove the lines:

        - (SOME_ERROR_TEXT) at (FILE) line (LINE). - Execution of (FILE) aborted due to compilation errors.

        My feeling is that I was wrong to use an abstraction; I now intend to show in that section the actual errors produced by the examples, by way of introduction. Since I also intend to rewrite the examples, this is not a ten-minute patch.

        Unfortunately my alarm just this minute sounded, reminding me to hop in the shower and run out the door to pursue the grind. So I can't post the new draft today; I haven't finished it. Please accept my assurance that I won't post it until I've reviewed thoroughly all comments on the previous draft.

        I'm not the guy you kill, I'm the guy you buy. —Michael Clayton

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-19 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found