• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is recursion?

 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean a "Data + Algorithms = Programs" forum? Only pseudocode allowed?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recursion is a term discussed in the beginners forum.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recursion should be discussed in the forum, where recursion should be discussed.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stefan Wagner:
Recursion should be discussed in the forum, where recursion should be discussed.

 
Rick O'Shay
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Woud such a 'forum' generate enough 'interest,' or 'traffic' to justify including it?
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 815
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you say that finding the right forum is a recurring problem?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic