-
Notifications
You must be signed in to change notification settings - Fork 138
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
Best Practices and Anti-Patterns Updates #1471
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1471 +/- ##
=======================================
Coverage 74.68% 74.68%
=======================================
Files 289 289
Lines 55607 55607
=======================================
Hits 41528 41528
Misses 12584 12584
Partials 1495 1495
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 5238cce Results
|
Awesome work! 👏 I'll have a read :-)
I'd have a performance one: Prefer in-place mutations. For example, if the task is to update some data structure, e.g. a dictionary in storage or a contract, don't copy the whole data onto the "stack", modify it, then overwrite the existing data with the updated copy. Instead, use e.g a reference to mutate the data in-place. Here is a real-world example of this: https://github.com/dapperlabs/nba-smart-contracts/pull/125/files#diff-1493a8d9c5e6feabf2be9290b17f904a9e89e871cfcb0c21fce75dfb524eb406L105-R108 |
@turbolent Thanks for the feedback!
Yep, that one is in there! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Good work @joshuahannan
|
||
## Auth References should be avoided | ||
|
||
### Problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pseudo code here as well, If possible
FYI - I'll be reviewing through the lens as the intended audience, and suggestions will be based on improving clarity & understanding for the reader. 😄 ALSO - love the new organization/presentation of content. Much cleaner than before. I'll be continuing to review this next week 👍 |
Hey @turbolent, looks like I need an approval from a code owner to merge this. Can you approve it please? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Thank you so much for the reviews @turbolent and @psiemens ! I've addressed all your comments and pushed my latest changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏
Closes onflow/flow#708
IMPORTANT: If there are any best practices or anti-patterns that you think are missing from here and should be included, please let me know and I will add them. I added all the ones I could think of, but I'm sure there are more.
Description
master
branchFiles changed
in the Github PR explorer