-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Ripple calc #410
Closed
+2,346
−3,104
Closed
Ripple calc #410
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
84429a9
New types ripple::Account, ripple::Currency, ripple::Directory.
rec ab5a6c0
Get rid of uint160 in favor of Currency, Account and NodeID.
rec 04edc12
Respond to comments
rec f8e37b2
Responses to review.
rec 5f4e347
Response to Howard's comment.
rec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can this be
auto
?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.
I think it could. But in this case I actually like the explicit type. On lines 404 and 453 in for-range loops, it is so much easier to see what the value_type is that the loops are working on with the type spelled out explicitly on line 400. I.e. the for loops are using the first and second types of the value_type, which we now know are uint256 and ValidationCounter. With auto we would have to go looking.
I don't yet have a good guideline for when auto is harmful and and when it is helpful. This type of experience will hopefully lead us towards such a guideline.
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.
I've been playing with auto for a while now (before I got here).
My new theory is that I should always use auto when possible - simply because it frees me of the cognitive burden of deciding when I should use it and makes the code as short as possible.
It should take you almost no time to "go looking" for the actual type if your IDE is any good - or even if it isn't, I mainly work in emacs which is less good and it's still not an issue.
But I didn't go looking for trouble here. I only changed things I was "forced to" - i.e. Accounts and Currencies where I wanted to create code that was good before and after the change of type.