Jump to content

Recommended Posts

Posted

one of my favorite recursive acronyms, a mail reader called PINE. it stands for "PINE is Not Elm"

 

I use recursion fairly heavily when writing XSLT style sheets for handling XML data, but not as much in the OO languages. It can produce fairly elegant code, though, when properly authored.

  • 4 weeks later...
Posted

It really is an area of programming where the programmer must tread carefully.

Indeed, the biggest danger being a stack overflow. This is not something PC developers are aware of as the default stack is rather big. But stack overflow may very well bite you if you have to port your perfectly working and elegant program on some other platforms.

 

If you need to port on such platforms and chose to stick with recursion you will then have to make sure any input data that your program will have to deal with will never ever overflow the stack no matter where the stack pointer is a the time your recursive program is called. This means things like checking all code paths, size of arguments passed on stack and all local variables in each of these code paths.

 

Having to develop on several platforms, recursion is something I stay away from, too much potential trouble.

 

PhM

  • Upvote 1
Posted

Did you read the linked article PhM ;)

I have a confession. I know what recursion is, but my programming isn't at a level where I can identify when it's a good or bad time to use it. I just enjoyed the conflation of Lovecraft and recursion.

  • 4 weeks later...
Posted

Did you read the linked article PhM ;)

Yes. And as this is about plugin development, in other words programming, I thought that someone might end up here while looking for what recursion is all about. Given the fact that your comment : "It really is an area of programming where the programmer must tread carefully." was totally appropriate I decided to add some facts to help understand why it is not a good thing to do. In short : Nice and fun in academic discussions, too risky in real life.

 

PhM

  • Upvote 1
Posted

Nice and fun in academic discussions, too risky in real life.

Actually you misquoted me: I said it's an iaiarea where programmers must tread carefully. More serious than writing bad code, they risk awakening the Old Ones... wait... did you hear that? They're coming! They're here! Ia! Ia! Cthulhu fhtagn!

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...