Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: The 'eval "require $module; 1"' idiom (one character cargo cult)

by Anonymous Monk
on Apr 19, 2014 at 09:25 UTC ( [id://1082879]=note: print w/replies, xml ) Need Help??


in reply to Re: The 'eval "require $module; 1"' idiom
in thread The 'eval "require $module; 1"' idiom

I generally consider it to be cargo cult. There's no situation where require lives but returns false.

So the threshold for "cargo cult programming" is one character?

I don't think you can ever determine if this idiom is caro-cult based on this idiom, especially in isolation

Replies are listed 'Best First'.
Re^3: The 'eval "require $module; 1"' idiom (one character cargo cult)
by tobyink (Canon) on Apr 19, 2014 at 09:38 UTC

    As per your own link, cargo cult programming is the ritual inclusion of code or program structures that serve no real purpose. This is code that serves no real purpose. I don't have a character threshold. If it were possible to include code or program structures using zero characters, and that code or structure served no purpose, then I'd argue that to be cargo cult too.

    This kind of thing is what gives newcomers to Perl the impression that it's full of magical incantations, and they'd be better off using Python. (I grant you that this is a very minor and seemingly insignificant example, but it does all add up!)

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

      As per your own link, ...omit the essence that is ritual inclusion without understanding../

      Cute:)

      How is one character a ritual? How is using it inclusion without understanding?

        ; 1 is more than one character and stupid c&p b/c "many others did before" is cargo cult.

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

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

    No recent polls found