I think that object-oriented python is useful to programmers because the class in python are limited and programmer need to create new class for every purpose of the program. I may create a class where I want to store string and int or float. Normal python class won't do that. Class is an awesome way to organize functions as well as variable. Then the function can be found more easily because it is contained some where. It is like papers put into folders and we can sort them more easily.
I think recursions are useful to programmers because it can do many things repeatedly until it reach the end. Iteration and for loops won't do the exactly the same thing because iteration only do it for number of time but sometimes the number of times isn't given to you like when you have to find the depth of a list. Recursion is helpful if you have a repeated but indefinite or infinite amount of task to do. Recursion can find every leaf of the root and it is pretty helpful in storing data and organize data. You can store everything in a recursive list with a root and lots of leaves. It can save a lot of space for the code and let the code be more efficient. If the code is efficient then the program can work faster. The programmer can also do more work.
No comments:
Post a Comment