Should I learn recursion before OOP?

I am reading this C ++ book "Solving Problems With C ++" in my spare time. I went through 4 chapters and now I am in a split. I can either move on to Chapter 5, which is file operations, and an introduction to OOP, or I can move to Chapter 12, which is recursion. So far I've just gotten to the basics of the compiler, all of this if, still, and sings syntactic jazz, and both are invoked by reference and call value functions. The book does not mention whether it is better to learn recursion before it ends or not, but she says that some teachers may prefer to teach her that way and it’s okay to go to chapter 12 and come back. I, being new to both paradigms, just want to know if it is good for me to learn one the other ... and yes, I plan on learning anyway, don't be such a wise guy.

+2


source to share


11 replies


Recursion is a mathematically fundamental concept, but I wouldn't consider it a core topic in C ++ to make it necessary for skipping files, OOP, and other very practical concepts. The instructor may wish to return the chapters / subjects according to their own learning style, but without specifying the instructor, I would recommend continuing to work on the chapters in their natural order (this should be the order the authors approved in the end! - ) and will come to recursion later, after you have OOP, files and under your belt.



+9


source


Disclaimer: This is really a matter of opinion. Having said that, you should first learn recursion.



+7


source


There is a reason why the author of the book put recursion in chapter 12 and not chapter 5.

+5


source


You must understand recursion whether you learn OOP or not. This is a fundamental chapter.

+3


source


Recursion and OOP are not mutually exclusive.
that is, it doesn't matter if you learn about recursion first or OOP.

OOP is a way to structure your code.
Recursion is a way to express a solution to a given problem, which can be solved by iteration.

+3


source


Recursion first.

Recursion is a very simple and fundamental programming structure; if you don’t know it, you don’t know the basics of programming yet.

OOP, on the other hand, is a high-level code organization methodology.

Study the low levels first.

+1


source


OOP and recursion are two completely different things. OOP is much more of a concept compared to recursion. I suggest you go through the order in the book. If he's not going to talk about recursion before Chapter 12, then he won't use it either. Therefore, you will not miss anything.

0


source


Recursion first. Because you have to learn functions before learning objects. Recursion is mainly related to functions.

0


source


Recursion has nothing to do with OOP. When learning recursion, people use the Fibonacci sequence ; when teaching OOP people usually say that "a car has four wheels."

I would advise you to switch to which is more interesting for you . In this case, it appears to be recursion. Recursion as a mothod solving problem, if not more important than OOP, is just as important as OOP.

0


source


In my personal opinion, I would say go with recursion first, but spend more time oop.

Also, if you get what: you help you learn better other things - then yes and no.

Yes, if you learn to program, then the next thing you learn (even unrelated) will be easier to learn just because you get more and more experience with programming in general.

No, that the order in which you learn about it in relation to each other does not matter.

0


source


The only way to truly understand recursion is to solve a problem that it effectively solves, and then write recursive code. A person does not teach him slowly. Wait until you need it.

Though hopefully your ah-ha-moment for recursion won't be in an interview like mine.

0


source







All Articles