Object Oriented Programming:
A programming method that has an "object" type representation of data. This is very useful, I have programmed PLCs in the past and those are clearly clearly not object oriented, more like objective oriented. Exposure to PLCs were actually the reason why I got into programming, I enjoyed the idea and practice of programming so much that I decided to go into Computer Science. What makes object oriented programing so useful is it allows for a more conceptual representation and manipulation of data, while PLCs were more straight logic. There are things you could do in OOP that you wouldn't even try to attempt in ladder logic unless you had a serious propensity towards self flagellation.
Recursion:
Is a method where you solve a problem by repeating steps of the problem that are essentially smaller instances of the original problem within the original problem. This differs from looping and while loops in a crucial way, there are some problems you just need to tackle recursively. Recursion is very useful because it allows you to tackle problems of indeterminate size that have the same property. How would I search a nested list with loops? I would need to know the depth of nesting (I would, maybe there's a solution someone else has where you wouldn't), while in recursion it doesn't matter the depth of the nesting, whether it be 2 nests, 5 nests, 10000000000000...., etc, recursion could handle it the same way and that's very useful.
No comments:
Post a Comment