Some ideas from Coinbase style guide #906
Replies: 3 comments 1 reply
-
Confirming reception, but I will review much later when we get to build OE and V2.3 (or whatever it will be called post-package tethering). |
Beta Was this translation helpful? Give feedback.
-
I review Coinbase's style guide now. Event names in past tense - I see where they're coming from and I would have been opened to this design if we had a clean slate. But we don't have a clean slate. Refactoring all events would increase the maintenance cost in our subgraphs and other event indexing services. So I'm against this. Avoid interfaces - against this. Interfaces help integrators and external users. The context switch cost for us and auditors is a small price to pay. Furthermore, deleting all interfaces would make our integrators' lives more difficult. Newlines between tag types - sounds good. You are welcome to create an issue. Though this should be included in a future release (not V2.2). |
Beta Was this translation helpful? Give feedback.
-
Closing this discussion since there is no further call to action except the following: |
Beta Was this translation helpful? Give feedback.
-
Thanks to @PaulRBerg, I came across Coinbase style guide. I'd like to share some of ideas from it that that I liked.
Event names should be past tense. For example, we use present tense for event names such as
Claim
andClawback
instead ofClaimed
andClawbacked
. Which ones do you like more?Avoid writing interfaces. I don't fully agree with this because interfaces are useful but I agree with the point that it makes it harder to understand the code when NatSpecs are in the interfaces and not in the core contracts. So an idea could be to add NatSpecs to core contracts as well but how would that go? It will be repeated in interfaces and contracts.
Newlines between tag types: this seems to be improving readability.
becomes
@sablier-labs/solidity ??
Beta Was this translation helpful? Give feedback.
All reactions