Tech
# Golang Beginner Mistakes #4: Learning Interfaces Changed How I Write Go
For the longest time, I avoided interfaces.
Not because I thought they were useless.
But because every explanation I came across felt like a computer science lecture.
People kept saying things like:
"Program to interfaces."
"Accept interfaces, return structs."
I understood the words.
I just didn't understand why .
Why would I need an interface when my structs and functions were working just fine?
Then I ran into a problem that structs alone couldn't solve.
That...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to