Skip to content
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

Remove state shorthand #629

Merged
merged 2 commits into from
Mar 1, 2022
Merged

Conversation

mvpatel2000
Copy link
Contributor

Based on offline discussion with Ravi.

Using state shorthand, specifically state = self.state and then just using state everywhere else isn't a great abstraction because it becomes hard for developers / people new with the codebase to understand scoping. This is especially true when you assign something to a field of state. IMO shorthands are not worth harder comprehensibility, especially given good autocomplete by most IDEs.

This PR moves to using self.state everywhere, and makes it much easier to understand the scope of assignments.

Copy link
Contributor

@ravi-mosaicml ravi-mosaicml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@mvpatel2000 mvpatel2000 merged commit bac31b8 into dev Mar 1, 2022
@mvpatel2000 mvpatel2000 deleted the mvpatel2000/remove-state-shortcut branch March 1, 2022 18:41
@mvpatel2000 mvpatel2000 restored the mvpatel2000/remove-state-shortcut branch March 1, 2022 18:41
@mvpatel2000 mvpatel2000 deleted the mvpatel2000/remove-state-shortcut branch March 1, 2022 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants