Dividing main function into other functions in opencv using c++ -
i learning opencv using c++. don't have background knowledge in c++.i learning parallel opencv. here doubt.my main program big.so,i want divide small functions , call them whenever necessary in loop using conditional statements.i have searched on net , observed people writing codes in similar way(dividing smaller functions).i found convenient makes program understandable.is there other reasons why should use more function calls? effect processing speed in way? 1 of above 2 methods takes more memory space?
thank in advance
you should things improve readability , understandability of code when first learning language. (and, in many cases, beyond point.) readability of code should number 1 priority @ point.
that being said, functions not cost more time clumping code together. (especially smart compilers inline functions anyways.) , memory use practically same well.
so in short, yes, if functions (or pretty else) improves code's readability , convenience, use it.
Comments
Post a Comment