I have a blog where I talk mostly about all things JavaFX, but this is one of the rare times that I write about something more general:

It’s All About (Loose) Coupling

I have about 35 years professional programming experience, and I’ve read literally millions of lines of code in that time. I’ve seen some great code, but mostly tons and tons of horrible code (a lot of that my own code from some time past) that I’ve been tasked with somehow fixing or enhancing. Over that time, I’ve often pondered what makes some code “good” and others “bad”.

My experience has shown me that excessive coupling is just about the worst thing that can happen to a code base in terms of sharing it and maintaining it. Yet, almost no new programmers (and a lot of experienced ones) seem to understand how important it is, and how to avoid it.

In this article, I review the kinds of coupling that I see all the time in projects that I look at. I try to explain how each type of coupling causes issues, how to recognize it and strategies to avoid or remove it.

Take a look, and let me know what you think.

  • @[email protected]
    link
    fedilink
    English
    64 months ago

    I really liked how coupling is described as “knowing.” I find we talk about “does x need to know about y?” more than we do “is x overly coupled to y?” because the former is a relatable indicator of the latter.