Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If you don't know cohesion, you might be a crappy coder
Message
From
30/05/2021 15:00:45
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/05/2021 14:30:05
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01680834
Message ID:
01680835
Views:
59
>At assemble time - in the kettle production line - they work with physical modules - they don't need the blueprints. Likewise in code, we can ship external modules that will be combined when needed at execution time. That is a godlike power only programmers have, and few ever seem to use it.

I'm not sure cohesion is the right term. Adhesion means "sticks to other things", cohesion then means "sticks to itself". Which means in this case cohesion is bad, you don't want your class to contain everything it may need - you want it to reuse parts already available. Where we spell reuse all uppercase until the apprentice turns blue in the face.

True, sticking (pardon the pun) to reusability may make you stop and think things over a few times before even thinking of the name of the thing you want to make, just making sure what (and how) it should use that already exists, and what other uses may come up and where to leave those potentially loose connectors available. Even in the short term it pays off - every such pause, when you basically plan for the connections between your future objects and how will they play together, saves you hours of coding. It's invisible, that saved time, but hey, you're the programmer god, you can always switch to "there's never time enough to do it right, but there's always time to do it twice" :).

IOW, we've always done this, and now you come and tell us it's called sex cohesion...

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform