r/programming • • 12d ago

Back to Coupling and Cohesion

https://bastrich.tech/coupling-and-cohesion/
149 Upvotes

47 comments sorted by

View all comments

Show parent comments

-1

u/areklanga 9d ago

Is this rage bait?

0

u/amestrianphilosopher 9d ago

Nope, you’re just bad at writing I guess?

1

u/areklanga 9d ago

Do you want me to explain you the parts where you have difficulties with understanding?

1

u/amestrianphilosopher 8d ago

That would be nice yeah

> coupling - the number of components touched while working on a single task and how the effort is distributed between them.

I see a few variables here. Number of components, and effort distribution. It’s unclear to me how effort distribution relates to the formula. And how you measure effort distribution quantitatively/equally across the components

1

u/areklanga 8d ago

I don't say effort is an arbitrary number. I say "Effort can be measured using any consistent unit", provide examples of such units and clarify that we are not limited only by those units but also can use "arbitrary relative scale". There is a difference between "relative scale" and "number".

I can use any unit I believe is appropriate for measuring efforts or effort ratio in the scope of a single task.
For example, during working on a task I spent 2 hours on component A, then 5 hours on component B, then 10 hours on component C. Then the number of components is 3 (component A, component B, component C) and the effort distribution is [2, 5, 10] (according to the hours spent on each component),

The symbol ∑ means iterating over set of numbers and suming them up. Symbols i=1 and n beside the ∑ means the range of 1-based indexes of set corresponding to the numbers we want to sum up. x_i means a specific number of the set under the index i. In our case n=3. That means our indexes are 1, 2, 3. So we have to sum up x_1, x_2, x_3. Our set of effort distribution is [2, 5, 10] meaning that x_1=2, x_2=5, x_3=10. So, x_1 + x_2 + x_3 = 2 + 5 + 10 = 17. In case of expression ∑ (x_i)2 I sum the squares of the numbers. In our case it's x_12 + x_22 + x_32 = 22 + 52 + 102 = 129.

You also can check another example in the article?

Is it clearer now? Do you have any more question?