provenance-io / provenance

A distributed, proof of stake blockchain designed for the financial services industry.
https://provenance.io
Apache License 2.0
90 stars 39 forks source link

Coding style guide #1690

Open Taztingo opened 1 year ago

Taztingo commented 1 year ago

Summary

The Provenance code base does not have any type of coding style guide. A style guide will help team members write more uniform code and assist those that are externally contributing. This will allow us to more easily find flaws in the design of the code and bugs within the logic.

This is not something that can quickly be resolved and may need to be broken down into multiple issues and PRs.

Problem Definition

As the Provenance codebase becomes larger it will be harder to understand, debug, and contribute to.

Proposal

  1. Investigate other major golang projects and see if we can find and use a pre-existing style guide template.
  2. Create a PR for the template so the team can comment on the layout and agree upon the sections
  3. Create a PR for each section so each team member can contribute to a specific section without being overwhelmed by other sections. This will also allow us to complete simple sections without being blocked by more complex sections.

For Admin Use

Taztingo commented 1 year ago

Some good resources on this are 100 Go Mistakes and some of the more popular golang projects.

Might be also helpful to reduce the amount of code we have by simplifying protocol entry points. More complex ideas can be built on top as long we provide the fundamental set of building blocks.