From the course: Advanced Go Programming: Data Structures, Code Architecture, and Testing

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Robust code

Robust code

- [Instructor] In this video, you'll become familiar with code robustness and the slightly divisive topic of solid principles in Go. We'll discuss the characteristics of code robustness and why it's important to prioritize writing readable and maintainable code. Robust code is a style of code which handles edge cases and unexpected inputs gracefully, avoiding panics, and producing meaningful errors in the case of unusable inputs. Robust code is easy to write in Go, which provides explicit error handling and makes it clear to programmers which functions could produce errors through multiple return values. There are four main characteristics of robust code. Let us consider the ones presented in this diagram going clockwise. First, robust code is easy to change and maintain. It handles inputs and uses abstractions. It's easy to change its dependencies and inner workings without necessarily making those changes visible to…

Contents