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

Re: No recursion depth limit?

by sundialsvc4 (Abbot)
on Sep 02, 2015 at 06:04 UTC ( [id://1140755]=note: print w/replies, xml ) Need Help??


in reply to No recursion depth limit?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2: No recursion depth limit?
by Old_Gray_Bear (Bishop) on Sep 02, 2015 at 17:58 UTC
    Recursion is a perfectly valid tool for certain types of problems, building tables of Recursive Numbers for example. (The Nth Fibonacci Number is useful in a wide variety of fields: Economics (dynamic optimization problems) and Cryptography (as a seed for pseudo-random number generators and primality testing), Genetics, the list goes on.

    Recursion along with memo-ization allows clean, readable, maintainable code. Recursion has it's place in the tool-box of any professional programmer worthy of the name (and pay).

    The fact that you can pose a problem large enough to cause your recursion depth to go to the point that you exhaust your computer's resources is an indicator that you need a better computer.

    Or perhaps you are confusing recursion with 'fork-bomb'.

    ----
    I Go Back to Sleep, Now.

    OGB

Re^2: No recursion depth limit?
by Anonymous Monk on Sep 02, 2015 at 06:49 UTC

    Do you have a power plug?

Re^2: No recursion depth limit?
by karlgoethebier (Abbot) on Sep 02, 2015 at 17:50 UTC

    You ever wrote any piece of code using recursion?

    Or some perl script running flawless except "Hello World!" or something else that you copied from somewhere?

    But perhaps i'm totally wrong - here is that excellent template given to you liberally by 1nickt:

    #!/usr/bin/perl # sundialsvc4 code goes here __END__

    Fill in your stuff and show some working code (no pseudo code please).

    Else please stop giving advice for anything you lack competence.

    Please note: You have been told this hundred times before.

    Karl

    «The Crux of the Biscuit is the Apostrophe»

Re^2: No recursion depth limit?
by Yary (Pilgrim) on Sep 02, 2015 at 14:58 UTC
    I the "original poster" upvoted your comment, despite eight naysayers - you wrote an enjoyable note on a wider perspective.

    Though I did have to hold the power button down 5 seconds, same as pulling the plug!

      Fifteen and counting. The reason is neatly summed up by one of the AnonymousMonkies above: Never use recursion is terrible, incurious advice. Even Don't use recursion for this problem is awful absent context, and unwelcome absent a demonstrated alternative.

        I did like the Bathysphere anecdote, which was new to me, and took it in the spirit of "add a limit, if you're worried about recursion depth." I admit it may not have been Sun's intent! And I'm fine with everyone voting their conscience.
Re^2: No recursion depth limit?
by Anonymous Monk on Sep 02, 2015 at 14:55 UTC

    S-Dial2English output:

    Don't use recursion.

    AUTO RESPONSE:

    Like in Haskell's default looping mechanism and Swift's for-each loops behind the scenes and in Perl as described in MJD's HOP and ad infinitum for every modern programming language.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found