80-20 Rule and Programming

alright!, this is my first post under the novaleaf’s blog (the introduction does not count)  so.. i gonna start with a veryyyy general topic one. it might be a bit boring but it’s worth reading because this might change your way of understanding things around you..!?

so let’s see… the 80-20 rule (Pareto principle) states that.. for many events, 80% of the effects comes from 20% of the causes…. well, what’s that suppose to mean?   if you don’t get it, then try to understand these examples, ”80% of the country’s wealth is owned by 20% of the population” another easier example might be.. “20 percent of the people do 80 percent of the work” .. how’s that ..? read the sentence again and think back to your workplace or school then you’ll see that somehow… it’s true. It’s hard to know exactly why this principle works, but it does work.

so how does this has anything to do with programming?? well,.. i’d say that 20 percent of our code will do 80 percent of the work! , this makes sence, right? that makes us realize that… 20 percent of the code need optimization, as it is the most critical to the overall performace of the application.

taking about optimization, the key to do the optimization is measurement!!, because… we’ll never know what needs to be optimized unless we measure, right? so measurement is very important during software development life-cycle. it would be bad if at the end of the cycle, we realize that the application is not performing well…

however, we need to make sure that we don’t overdo the optimization, otherwise we’ll wasted our time and resources. for example, the is no reason to try to make a method to be superrrr fast if it’s only called once when the application starts or ends, or….., if we found some performancewise issue on some module but the overall performance of the system is acceptable, then.. we might only want to note it down and ignore it until we can make sure that it is the bottleneck of the performance, since there is no need to waste time optimizing the part of the code that’s not  the real cause of the whole problem.

Leave a Reply