-
-
Couldn't load subscription status.
- Fork 412
Open
Labels
level:advancedNeeds a lot of careNeeds a lot of carequestionFurther information is requestedFurther information is requestedrule requestAdding a new ruleAdding a new rule
Milestone
Description
Rule request
Thesis
Coupling is a very important concept in programming.
Currently, we don't enforce any rules about cohesion and coupling. But, we totally need to!
And while you can use https://github.com/mschwager/cohesion to measure cohesion, there's no tool to measure coupling.
I don't think that cohesion is important. Because the best class in my opinion is @dataclass:
@dataclass
def Some(object):
field1: int
field2: strBut, coupling is the whole other beast! High coupling makes refactoring very hard. Compare these two samples:
class SomeClass(ParentClass):
def method(self, other):
if other.some_field > other.other_field:
other.first_method()
else:
other.other_method()And:
class SomeClass(ParentClass):
def method(self, other):
other.smart_method()The second one is way better.
Problems:
- I am not sure how to count coupling
- I am not sure about corner values
Metadata
Metadata
Assignees
Labels
level:advancedNeeds a lot of careNeeds a lot of carequestionFurther information is requestedFurther information is requestedrule requestAdding a new ruleAdding a new rule