Subscribe to the Ardan Labs Insider

You’ll get our FREE Video Series & special offers on upcoming training events along with notifications on our latest blog posts.

Included in your subscription
  • Access to our free video previews
  • Updates on our latest blog posts
  • Discounts on upcoming events

Valid email required.

Submit failed. Try again or message us directly at hello@ardanlabs.com.

Thank You for Subscribing

Check your email for confirmation.

Interfaces 101 : Interface Design Considerations Ep. 7

Author image

Ardan Labs

Introduction

In episode 6, Miki built a logger package with the aim of making it as versatile as possible. To achieve this, he constructed his logger object with a function that would: accept the io.Writer interface as a parameter and perform type assertions to retrieve other interface types as needed. By building this, Miki demonstrated how polymorphism is achieved with Go by changing the type of a variable with type assertions.

In this video, Miki will shift his attention towards the theory side of programming and give a lecture on interface design. The first idea he’ll introduce is that interfaces state what need, not what we provide. To build on this idea, Miki will give a detailed overview of Go’s io.Copy function, its intended use and how the function states that it needs to have a variable to read from and another to write to. The next idea he’ll propose is if an interface has more than five functions, something may be wrong, which can be strongly correlated to the Go proverb the bigger the interface, the weaker the abstraction. Watch and learn more about Go interfaces and the design considerations to keep in mind when writing one.

Things you will learn in this video

  • Criteria to determine the effectiveness of an interface.
  • Quick overview of Go’s io.Reader and io.Writer interfaces.

Video

Go Training

We have taught Go to thousands of developers all around the world since 2014. There is no other company that has been doing it longer and our material has proven to help jump start developers 6 to 12 months ahead of their knowledge of Go. We know what knowledge developers need in order to be productive and efficient when writing software in Go.

Our classes are perfect for both experienced and beginning engineers. We start every class from the beginning and get very detailed about the internals, mechanics, specification, guidelines, best practices and design philosophies. We cover a lot about "if performance matters" with a focus on mechanical sympathy, data oriented design, decoupling and writing production software.

Capital One
Cisco
Visa
Teradata
Red Ventures

Interested in Ultimate Go Corporate Training and special pricing?

Let’s Talk Corporate Training!

Join Our Online
Education Program

Our courses have been designed from training over 30,000 engineers since 2013, and they go beyond just being a language course. Our goal is to challenge every student to think about what they are doing and why.