You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over the past few months, our team has been a lot more focused on code health. Namely, we want to adopt successful software engineering practices into our organization to help Prysm succeed as a project, and make our life easier as developers. Better code health means more testable, concise, and simpler code that is easier for contributors to add value to and also for fewer bugs to arise. We have recently published Software Design Principles in Go, and now have a direction for how to start implementing these ideas in Prysm. This is a tracking issue for all code health related tasks grouped by domain.
Description
Separation of Concerns
Avoid leaking all instances of CLI flags, cli.Context beyond the main packages in Prysm
Use function options for configuring services in Prysm
Encapsulation
Encapsulate all feature flag conditionals as close as possible to what they toggle
Encapsulate nil checks across the repository and return package-level errors such as ErrNotFound Encapsulate Nil Checks #9454
Single Responsibility Principle
Use functional validation pipelines for reusable validity checks on data structures in Prysm
Open/Closed Principle
Currently, we use type assertions on the various kinds of Keymanager implementations across Prysm, which defeats the purpose of using interfaces. This is a violation of the open/closed principle. Adding a new keymanager implementation to Prysm shouldn't mean we have to modify the rest of the codebase to add new type assertions for it
The text was updated successfully, but these errors were encountered:
💎 Issue
Background
Over the past few months, our team has been a lot more focused on code health. Namely, we want to adopt successful software engineering practices into our organization to help Prysm succeed as a project, and make our life easier as developers. Better code health means more testable, concise, and simpler code that is easier for contributors to add value to and also for fewer bugs to arise. We have recently published Software Design Principles in Go, and now have a direction for how to start implementing these ideas in Prysm. This is a tracking issue for all code health related tasks grouped by domain.
Description
Separation of Concerns
main
packages in PrysmEncapsulation
Single Responsibility Principle
Open/Closed Principle
Keymanager
implementations across Prysm, which defeats the purpose of using interfaces. This is a violation of the open/closed principle. Adding a new keymanager implementation to Prysm shouldn't mean we have to modify the rest of the codebase to add new type assertions for itThe text was updated successfully, but these errors were encountered: