aspose file tools*
The moose likes Java in General and the fly likes What is recursion? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is recursion?" Watch "What is recursion?" New topic
Author

What is recursion?

Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

It's a function/method/procedure that calls itself until it reaches a condition that initiates the returns. It's a simple concept to me. It can lead to some clever and complex uses, sure, but it's simple.

We've been talking in Moderator's Only about this. Not only is recursion a useful approach to world domination -- and make no mistake, the assimilation of you people is fast approaching -- it's also a question among us nth Reichers where questions about recursion should go. Is it beginner, intermediate, or advanced material?

I'm of the school that says recursion is as complicated as you make it. And since it's not a Java-specific topic anyway, it has no clear category. Then again, neither do general programming techniques.

I can't really ask what you people think, since you'll be thinking soon enough whatever I tell you. The Plan is, after all, inevitable. But let's make the best of the brief time you have left with your scattered and ostensibly original, independent, "thought" processes: should JR have a separate space for discussing general programming skills and techniques? If so, what would it look like? If not, well enjoy your membership in the Silent Majority.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
You mean a "Data + Algorithms = Programs" forum? Only pseudocode allowed?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
since you'll be thinking soon enough whatever I tell you

That's what YOU think. But us new folks have been indoctrinated by Jim, so good luck to you, Michael, and we'll see you in a parallel universe Unless JY == ME, in which case....

As to the topic at hand, it makes sense to me to have separate forums for general questions. If we do set up something new, we should define what "General Computing" should be about, and properly differentiate it from "General Software", "General Algorithms", or whatever we end up creating.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I typically look at "General Computing" as a OS/hardware troubleshooting forum. In other words, I see it as a computer user forum rather than a computer programmer forum. I think a general programming forum would be nice to be able to discuss algorithms and data structures without worrying about the messy Java syntactical details. But that's just my 2 cents.

Layne


Java API Documentation
The Java Tutorial
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

I wonder if a 'General Programming' forum would catch on. I think it's the right idea, but has about as much appeal as a History of Pressboard display.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
Maybe a bit more differentiated, like "something Algorithms something". "General Programming" might attract questions like "what's the difference between the heap and the stack". Which is fine if we want the forum to handle that, it just has nothing to do with algorithms. And there might be a fine line between a general forum and the Java-specific forums when discussing a hashtable vs. discussing a Hashtable. Maybe "Computer Science (beginner/intermediate/advanced)" ? Of course that would include hardware and theory as well.

So, as you can see, no good suggestions from me, just more questions and open-ended discussions...
[ January 09, 2006: Message edited by: Ulf Dittmer ]
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 582
    
    7

Michael,

[sorry Ulf you got in before i did - forget the stuff i said that Ulf covered]

[and it is javaranch not computerranch or algorithmranch or generalcomputerhistoryandrelatedstuffranch]

I think it is a great idea that should not be done.

Mostly, i see this as a wandering off of the mission of javaranch. If i am interested in a specialized algorithm, i don't come here, i go to the acm portal or the ieee library.

Secondly, for this to be useful, one would have to separate the levels (given recursion, for example) we could see where a sum(n) or fib(x) or towers of hanoi, would be great for beginning, but say a more data structured approach, like b+ trees, sorting, searching would be more intermediate; and then we would have the algorithms level (NP complete problems, optimizations, parallel processing) at an advanced - and let's not even go to the genetic algorithms / neural networks. Now given the java (b/i/a) forums - how in the world would you guys keep up the the different levels of algorithms.

Overall i thinks it's a great idea - i just don't know if you will see the positive ROI.

-steve

[ January 09, 2006: Message edited by: Steve Fahlbusch ]
[ January 09, 2006: Message edited by: Steve Fahlbusch ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Michael Ernest:
I wonder if a 'General Programming' forum would catch on. I think it's the right idea, but has about as much appeal as a History of Pressboard display.


Perhaps "General Programming" is a poor choice of a name. How about "Algorithms and Data Structures" or something along those lines? I don't think we necessarily need to differentiate between beginner/intermediate/advanced. In fact, I think it would be helpful as a beginner to intermediate level to field questions such as "How does recursion work?" and "What is a linked list?". For more complicated stuff like Hill Climbing Algorithms, Genetic Algorithms or Partical Swarm Optimization, we probably would have to beg off since there probably aren't many experts in those fields here.

Layne
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Recursion is a term discussed in the beginners forum.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Recursion should be discussed in the forum, where recursion should be discussed.


http://home.arcor.de/hirnstrom/bewerbung
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Stefan Wagner:
Recursion should be discussed in the forum, where recursion should be discussed.

Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Originally posted by Michael Ernest:
I wonder if a 'General Programming' forum would catch on.


Could you be more 'specific'?
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Woud such a 'forum' generate enough 'interest,' or 'traffic' to justify including it?
Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
Michael - Regardless of 'interest' or 'traffic' considerations, my vote is 'NO' for a recursion forum.

Recursion is a concept easily taught, and examples in almost any programming language are readily available with little research (even FORTRAN).

In particular calculation of 'Factorials' or 'Fibonacci Numbers' are the classical examples used.

The educational examples mentioned are *exactly* where one would use an iterative technique, *not* recursion, in a production environment.

So, my 'NO' vote comes from a perspective that I think recursion is used frequently in situations where it is absolutely inappropriate. Used there because implementors are misinformed when they are taught about the concept.

I fear that any JR forum would drift in that direction.

Regards, Guy
Tom Sullivan
Ranch Hand

Joined: Dec 20, 2005
Posts: 72
I think recursion and programming methods in general deserve its own category. From a newbie perspective, I discovered recursion when I tried to build a JTree and started by building my first while loop to create a tree node. Then I sat there for a while wondering how I was going to ever be able to know how many while loops I needed as the user could create a directory inside of any other directory so I needed infinite while loops. Hours later I suddenly realized that if I built a method and kept calling it upon itself (and others that did other things) that eventually I would have this really great JTree that could be dynamic in content for any user who wanted it. Of course, had I known what recursion was, I could have saved myself hours of scratching my head.
[ January 15, 2006: Message edited by: Tom Sullivan ]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Guy Allard:
Michael - Regardless of 'interest' or 'traffic' considerations, my vote is 'NO' for a recursion forum.

Recursion is a concept easily taught, and examples in almost any programming language are readily available with little research (even FORTRAN).

In particular calculation of 'Factorials' or 'Fibonacci Numbers' are the classical examples used.

The educational examples mentioned are *exactly* where one would use an iterative technique, *not* recursion, in a production environment.

So, my 'NO' vote comes from a perspective that I think recursion is used frequently in situations where it is absolutely inappropriate. Used there because implementors are misinformed when they are taught about the concept.

I fear that any JR forum would drift in that direction.

Regards, Guy


I agree. We don't need a forum dedicated to just recursion. None of the forums here are that specific. However, it might be helpful to have a more general Algorithms and Data Structures forum where such a discussion would fit.

Layne
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Instead of a general programming forum, how about a forum dedicated to the mathematics of computer science? That is where recursion rightly belongs along with set theory, proofs(induction mainly), linear algebra, statistics, ect.


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Hm, something along the lines of Programming Diversions, but limited to (applied) theory? I for one would gladly geek out in such a forum.
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
Would you say that finding the right forum is a recurring problem?


I've heard it takes forever to grow a woman from the ground
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is recursion?