Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Sometimes, code repetition is not a bad idea!

You have probably heard of the don't repeat yourself (DRY) principle before. The main idea behind DRY is to avoid code repetition by aiming to write reusable code that can be included where required. But is DRY always a good idea?

Go packages serve as a nice abstraction for organizing code into modular, reusable units. But, generally speaking, a good practice for writing Go programs is to try to keep your import dependency graph shallow and wide; this sounds counter-intuitive considering it's probably the exact opposite of what the DRY principle advocates: include instead of repeat.

When the dependency graph becomes deeper, circular dependencies become more likely, this time due to transitive ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content