3 ms·
> LOC metric Woah woah woah - I'm not saying that LoC directly measures quality. I'm only saying that it's a concrete, measurable thing. It can then be used as
by RangerScience 3y ago
> LOC metric
Woah woah woah - I'm not saying that LoC directly measures quality. I'm only saying that it's a concrete, measurable thing. It can then be used as an input to any theory of code quality, not as a direct measure of code quality.
- corethree 3y agoRight underneath that I say: "But then you say add it up with symbol counts and cyclomatic complexity and the average of the three should counterweight any inaccuracies that stem from each individual metric.... but does any of these metrics have anything to do with good design as our intuition defines it? I would say No." I understood your objective here. But my counter to it is much longer than the first paragraph. You'll have to read the whole thing carefully. There are several reasons why your approach doesn't qualify as theory and why it has problems. It's more of a statistical or analytical average then it is a formal theory.
- RangerScience 3y agoHmm. It sounded to me like you were saying a straight sum, or maybe a weighted sum. That’s not what I’m getting at. Subjectively, Rubocop pushing me to have smaller everything by LoC made my code better. As has reducing function cardinality. Both of those are as straightforward a metric as “angle of incidence” or “length of a side”; and I can’t help but imagine there’s theorems that can be made from them akin to the Pythagorean. Although whether it’s possible to go from there to “code quality “ - yeah, might not be possible.
- corethree 3y ago> Hmm. It sounded to me like you were saying a straight sum, or maybe a weighted sum. That’s not what I’m getting at. Doesn't matter how you aggregate these metrics. In statistics you have all kinds of arbitrary aggregations that attempt to form a blurry "summary" of what's going on. These "aggregations" like the mean, median, mode, standard deviation, weighted average... etc... are made up as well. It's arbitrary and essentially just summaries of what's going on. You're just proposing another aggregation and obviously a blurry one too. You're not picking out the "angle of incidence" or the "length of a side". More like out of 1000 triangles you're picking out all the sides and averaging them to get some summary of the length of sides of all triangles. You can see how this statistical metric is different from say euclidean geometry right? A concrete formal theory involves definitions. What is the formal definition of a module? What are the formal rules for how modules compose? Can we put a formal algebra together that allows us to implement these rules and for theorems around these things? We want a formal theory of program organization that is akin to euclidean geometry, not some data sciencey aggregation.
- dragonwriter 3y ago> It can then be used as an input to any theory of code quality, not as a direct measure of code quality. It can be part of an explanatory model of code quality once you have a concrete metric for code quality. That is, if you can measure code quality independently of features of design, then youc an build a theory of design using measurable features of design/implementation like LoC that explains how thost features determine quality. But otherwise your "theory" is not a predictive/empirical theory and something more like various schools of literary theory.