-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conventions around storage var naming and use #10
Comments
Check out this discussion It turns out that in Cairo, when importing from two files that hold a We ought to take that into account when coming up with a convention. |
I like the leading underscore myself amd have been using that |
I'm starting to dislike the trailing underscore because it can be confusing with a ignored var, like in |
I figure leading underscores would be best as well as |
I think we should come up with a convention for naming and use of
@storage_var
s.Here's an example what I've been using most recently:
That is, using a trailing underscore for the variable name inside a function (or as a argument passed into it) that holds the value of a
@storage_var
of the same name. But I don't really like it that much.What I've seen in the code of others:
let (_treasury) = treasury.read()
@storage_var
name:let (treasury) = treasury_.read()
_storage
appended to the name:let (treasury) = treasury_storage.read()
Is there any you like? Can you think of any other that you'd like us to adopt?
The text was updated successfully, but these errors were encountered: