Hacker News new | past | comments | ask | show | jobs | submit login

You're absolutely right, hits-of-code won't tell us anything about the quality of code, just the amount of effort programmers put into its creation. The code may be complete crap, but hits-of-code will be high. This metric is not an indicator of quality - not at all.

However, if all programmers in the team has similar skills and experience, they will create similar quality (well, on an average). In this case, hits-of-code can be used to predict project budget, schedule, etc.




> In this case, hits-of-code can be used to predict project budget, schedule, etc.

No, it can't, unless you're doing the same work over and over. The variable of "what is the code supposed to do?" completely eliminates the value of SLoC or HoC.

If I learn my HoC metric for a payment module, that doesn't tell me a single thing about how much time or effort it would be to rewrite a messy controller or add an API call or build an invoice module.

Not all evidence is useful to gather. This particular evidence is potentially damaging because it gives you an unrealistic basis for predictions.

The Agile method for estimating scheduling works moderately well (breaking things up into small chunks). But Agile is based entirely on the idea that estimating a coding schedule is impossible.

I personally have always used my gut to tell me how long something will take, and then I double it. I have a friend who quadruples it. That method is about as accurate as anything, takes a few minutes at the most, and often results in under-promising and over-delivering.


When you start to create that payment module, you can predict its complexity. You have an experience of creating software, including payment modules. You can say that the module will be 1500 SLoC in size. This is what COCOMO prediction mechanism is based on, the SLoC metric.

I'm saying that this metric is wrong. And almost everybody agrees with this.

But HoC metric is perfectly suitable for such a prediction. You can say that this payment module will take 50000 HoC of my effort. And then you track performance based on this number. And you can estimate costs. Just like COCOMO, but using HoC.


So why do we need a metric if it doesn't say anything about quality? What do we have to care about quantity at all?




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: