Metrics for Programmers

I wrote a simple php program called phpcodestat that computes some simple statistics for any given directory.

I think brevity in source code is almost always a good thing. I think as a rule your code base should grow logarithmically with your user base. It should not grow linearly and certainly not exponentially.

If your code base is growing faster than your user base, you're in trouble. You might be attacking the wrong problem. You might be letting feature creep get the past of you.

I thought it would be neat to compute some stats for popular open source PHP applications.

My results are below. I don't have any particular profound insights at the moment, but I thought I'd share my work as I'm doing it in the hopes that maybe someone else would find it useful.

NameDirectoriesFilesPHP FilesPHP LOCPHP ClassesPHP Functions
../cake-1.2.6 296 677 428 165183 746 3675
../wordpress-2.9.2 82 753 279 143907 149 3827
../phpMyAdmin-3.3.1-english 63 810 398 175867 44 3635
../CodeIgniter_1.7.2 44 321 136 43157 74 1211
../Zend-1.10 360 2145 1692 336419 42 11123
../symfony-1.4.3 770 2905 2091 298700 362 12198


Posted 03/16/2010

Was this essay useful to you? Yes | No
Powered by
brecksblog Posts: What can a Programmer learn from Rock Climbing? Look for a Line Backpack the World with Zero Planning The Economy Explained Ruby You Can't Predict the Future Critical Thinking Kids are Neat How is Intelligence Distributed? Recommendations Are Far From Good Nature Verse Nurture Circle of Competence What Percentage of the Brain Does What The Recency Effect The Ovarian Lottery & Other Side Projects Happiness is in Mediocristan What I Want Orbits The Do You Know Game and Why We Need Celebrities Design Matters, a lot Competition and Specialization Simple, but not easy Flip Flopping The Churn Rate of Data Culture and Complexity The Invention of Free Will Why is it best to do one thing really, really well? The Hidden Benefits of Automation Metrics for Programmers HackerNews Data: Visits as a Function of Karma Don't talk about what you will do, talk about what you have done Why it's worth it to buy the book The Least You Can Do Four Tips to Improve Communication Network Effects If you can explain something logically, you can explain it simply With Computers: Don't Repeat Yourself. With People: DO Repeat Yourself When forced to wait, wait! How to Buy Low, Sell High Flee the Bubble Checklist for New Products Diversification in Startups Thoughts on Setting Goals Problems Worth Solving Make Something 40% of Your Customers Must Have SEO Made Easy: LUMPS Don't Flip the Bozo Bit (un)features Get Stuff Done By Setting Arbitrary Constraints Why You Shouldn't Save Blogging for Old Age 6 Specific Ways to Find Programming Mentors Orders of Magnitude The Many Worlds Law Twelve Tips to Master Programming Faster What's Linear Algebra? Fiction or Nonfiction? Experience is What You Get I'm Back Check out my roommates' companies:
Jellyfish Art makes great Jellyfish tanks
30 Words makes great language guides