in reply to Re^4: How am i doing?
in thread How am i doing?

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^6: How am i doing?
by stevieb (Canon) on Jul 29, 2025 at 16:09 UTC

    The OP is learning from a book, and *intentionally* playing with recursion. The question wasn't "do I have a design flaw?", it was essentially "how do I fix this code I'm toying with to learn?".

    It's no different from the question the other day about a beginning Perl developer mucking with the symbol table. Why would someone outright declare that something is a design flaw when the question wasn't about design specifically? Sure, make mention of the potential drawbacks, but to fully claim something is wrong is, well, wrong.

    Some of my best software uses weird footguns, and that's because I took the time to educate myself on them early in my path, which led me to understand when they truly are needed and makes them completely shine above and beyond typical idioms.

    Lastly, please don't quote me simply to justify your position, especially when you just pluck parts of what I said. I vehemently believe you are wrong in outright claiming that recursion is a design flaw, and I stand by that.

    -stevieb

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^6: How am i doing?
by ysth (Canon) on Jul 29, 2025 at 17:50 UTC
    There's a reason for that warning. It warns you that you might want to redesign or rewrite your code! ;-)
    Or you might not. The warning is there to notify you of a possible bug, not a design choice; if you intend deep but not endless recursion, you would suppress the warning.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^6: How am i doing?
by LanX (Saint) on Jul 29, 2025 at 18:46 UTC
    > If you have tested the OP code, you would have noticed that he has essentially created a loop that counts from 0 to 4 million using a function that calls itself.

    The code is written to stop when the result exceeds 4 million.

    By my estimation that's a recursion level below 50. Nowhere near the technical warning level of 100 and certainly not a depth of 4 million.²

    And this code does neither suffer of the problems of naive Fibonacci implementations, because it does only fork one recursive call, not two. (That's why it's passing so called @frames with the last two results and cleverly avoids the need of full memoization)

    But I must admit that I haven't tested the code yet.¹ And I'm not sure what the count() does, (probably estimating for which input 4e6 is exceeded) °

    But honestly it doesn't look like you know what you are talking about.

    You sound like a flat earther criticizing a moon rocket because it doesn't have sails.

    And I don't want to waist my breath explaining to you that there is no wind up there. Especially because you will claim then, that I've proven your flat earth theory

    Update

    °) that's the corresponding Euler Problem #2

    ¹) done -> Re: How am i doing?

    ²) actually it stops at Fib(35)

    And FWIW I down-voted you for using those colorful markups.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      I upvoted you because you "down-voted you for using those colorful markups.". My eyes are still sore a day after seeing the post! Pity one can't down vote once for very poor content and once for horrible style. On the other hand, some posts one would like to upvote twice for great content and again for great style.

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re^6: How am i doing?
by jo37 (Curate) on Jul 29, 2025 at 15:56 UTC

    Not providing links to the nodes you quoted from is very bad style.

    Greetings,
    🐻

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

      A lot about that post was very bad style. :-D