|
|
|
Are design patterns relevant with Golang?
|
|
14 points
by itistricky
1687 days ago
|
|
I'm really confused on this. My understanding on Golang's intentions and design is that it is an intentionally simple language lacking most of traditional OO features. The language is relying on interfaces (and Generics?) for doing most of the things you'd do with classic OO. Yet I see job ads requiring and even classes teaching Design Pattterns with Golang. And by inquiry I see that they're not talking about Golang-specific DPs (that would make sense) but about fitting traditional OO DPs (and principles like SOLID) to Golang. Which in turn seems to me like bending the language to something it was not designed for in order to fit into models we developed for traditional OO languages like java and C++. Unsure what is going on here and what the consensus on best practice is (if any). |
|
If you're focusing too much on specific patterns, you might be wasting your time. For example, the O in SOLID is really only relevant for inheritance which Go doesn't have. And even when a concept is relevant to Go, it's questionable how much benefit there is to think about it explicitly. Unless you want to write books and blogposts of course.