I am developing web application and using codeIgniter framework. I have one module which is called many times say function “get_small_profile_info”.
My doubt is: If I keep this function in profile library which is very big. each time when i called this function will the whole profile library get executed?
is it good idea of keeping most frequently used functions in separate library.
Is it good idea of having many libraries with fewer functions or less libraries with many function?
At first cramming a lot of functions into one library sounds good, but a lot of programmers and engineers prefer many libraries depending on the functions they offer, since they can be reused for other projects.
There really aren’t any downsides using many libraries, but there are a lot of benefits. Often your code is cleaner because you have to think of things in logical units.
Here we see two competing goals, and the proper balance is dependent on how you will be using the libraries for yourself or for others.
and easier maintenance.
I tend to favor having as few libraries as possible, provided each library’s functionality is generally unique and not repeated. Why are project references bad? Why is it bad to have micro-libraries that each handle their own unique task? The answer is that it’s not bad at all. We should embrace separation of concerns and dry principles.