Ask HN: Do you ever get asked how many LOC (lines of code) a project will take? - jaequery
======
jaequery
I’ve met a Project Manager whom I saw ask for LOC to her developers on every
single task of a project before having them start working on it. Mainly to
estimate how much it’d cost.

But is this the best way to measure estimated costs?

What are the better alternatives if any?

Just off top of my head, I can imagine how copy paste codes can skew the
numbers greatly, especially on the front end side.

But she insists this is how most top coders do it. I don’t know what to think
of that, seems kind of silly if you ask me.

~~~
greenyoda
Estimating cost of code in LOC doesn't account for the fact that:

\- Some kinds of code are harder to write than others. For example, it could
take days to develop a tricky algorithm that's just a few lines of code.

\- A developer who is familiar with a code base can write lines of code faster
than one who isn't.

\- A developer who is experienced with a language can write lines of code
faster than one who isn't.

\- A better developer may be able to write the same logic in fewer lines of
code (e.g., by factoring out common code as methods instead of copy/pasting,
or not reinventing functionality that already exists in standard libraries).

I've been programming for decades and have never been asked to estimate cost
in LOC. Estimates are always requested in terms of time (e.g., hours of work),
or in some unit that's related to time, such as "story points" in Agile
methodology.

