Twice a year, we run an online training where you can learn Go Event-Driven. The time has come! Learn more.

Available until 26 April

Posts List

Increasing Cohesion in Go with Generic Decorators

Increasing Cohesion in Go with Generic Decorators

Cohesion is part of the low coupling, high cohesion principle that’s supposed to keep your code maintainable. While low coupling means few dependencies, high cohesion roughly translates to single responsibility. Highly cohesive code (a module or a function) is focused on a single purpose. Low cohesion means it does many unrelated things. I’ve written about coupling in the previous article on anti-patterns. Here are some tips on increasing cohesion in Go applications using the recently released generics.



Share on Hacker News
Share on Reddit

Do you like our posts and you are still not subscribed to our newsletter? We are not sending any spam - just notifications about new content.