Remove redundant headers #800
Replies: 3 comments 12 replies
-
@andreivladbrg When discussing changes that don't impact code performance, I'm of the opinion of optimizing code readability for auditors. I think categorized headers could be further made valuable when supercharged with region folding. Region comments in Solidity are already supported by juanfranblanco's VSCode extension, but I've been trying to have Hardhat support it as well. |
Beta Was this translation helpful? Give feedback.
-
Interesting proposal. I am not sure, however, if what you mean is get rid of the public<>internal dichotomy for storage variables only? Or do you want that for functions, as well? |
Beta Was this translation helpful? Give feedback.
-
Also FYI @andreivladbrg, we don't apply labels to discussions. |
Beta Was this translation helpful? Give feedback.
-
Headers are useful to improve readability of the code, and to logically group functions between it's visibility and it's type (constant/non-constant).
But, there are places where, IMO, where these headers are a chore (and actually decrease the readability).
E.g. different headers between constants and storage variables, and internal vs private:
v2-core/src/abstracts/SablierV2Base.sol
Lines 24 to 39 in 7819a3b
My proposal is to use only one header for these variables, and that is:
wdyt? @PaulRBerg @smol-ninja
Beta Was this translation helpful? Give feedback.
All reactions