Skip to content

Conversation

@robkeim
Copy link
Contributor

@robkeim robkeim commented Jul 9, 2018

Leveraging some new C# features to simplify the code.

Do we have style guidelines we're following? The neat freak in me was noticing inconsistencies but didn't know how to clean them up. For example, usings are mixed between being outside and inside the namespace.

@jpreese
Copy link
Member

jpreese commented Jul 9, 2018

Yeah I'm the same way, I like to have things consistent. I've just been cleaning up files as I add enhancements or bug fixes (moving the usings above the namespacing, make sure the indentation is right, etc).

We don't have any concept of standardization right now, so I wouldn't be opposed to something like an editorconfig

@jpreese
Copy link
Member

jpreese commented Jul 9, 2018

I don't really have any issues with this PR, my only worry is our current release methodology which we've already discussed and will be sticking with.

If we accept a PR that is purely refactoring with no benefit aside from readability, the consumer will get pinged to update their references but won't be pulling anything of value. Maybe that's not a huge deal, but it just seems a little wrong, at least to me.

While I really appreciate code cleanup, I'm sort of leaning towards an approach where PRs should fix a bug or add a feature, and while we're in there doing it, perform a code clean up.

Thoughts? #295 and #308 for some additional reading on the release strategy.

}

this.instance = instance;
this.instance = instance ?? throw new ArgumentNullException("instance");
Copy link
Contributor

Choose a reason for hiding this comment

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

nameof(instance) - same for other changed files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fgreinacher fixed!

@fgreinacher
Copy link
Contributor

Re "release strategy" - I think it's gonna be hard to decide on what "brings value" - so I'd suggest to just merge whatever we think is a sensible change (which IMO this PR is)

@jpreese
Copy link
Member

jpreese commented Jul 9, 2018

Also you're going to see some merge conflicts with #315 -- were getting rid of the if block for Unix checks.

@robkeim
Copy link
Contributor Author

robkeim commented Jul 10, 2018

@jpreese after reading over #295 and #308, here's my $0.02 since you asked for it :)

I understand the potential concern of "over notifying" people about new package updates, but out of all of the bigger projects I've worked on, we've always more work than we can handle and only upgraded NuGet packages when we absolutely had to, so I wouldn't be too worried about a lot of "newer" versions of a package accumulating particularly when they're not major version updates. Have we had specific feedback before about having too many notifications?

From a contributor perspective, I'm not a fan of having to including refactoring as part of other changes for two reasons:

  1. As an open source project, contributors have a limited amount of time that they're volunteering to help the project move forward. We should be welcoming any and all contributions with open arms and by having to have PRs be coupled with a feature/bug fix adds a barrier to entry which isn't needed IMO.
  2. While I am definitely a fan of opportunistic refactoring or the boy scout rule I think refactoring or code cleanup by itself can be valuable and decoupling refactoring/code cleanup with features and bug fixes as it makes both of them easier to review/validate individually by maintaining a single responsibility.

With that said, I'm going to step down off my soap box and fix @fgreinacher's feedback :) If you'd prefer to merge this with something else then I can wrap it up with #311 although I've got some other cleanup to do on that PR before it will be ready to merge.


public IFileSystemWatcherFactory FileSystemWatcher { get; }

public PathVerifier PathVerifier
Copy link
Member

Choose a reason for hiding this comment

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

This could be

public PathVerifier PathVerifier => pathVerifier;

to make it a bit more consistent with the new getters. Do we care about the newline between each property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed! I'm not too familiar with the [NonSerialized] attribute, but could we drop the private readonly variable entirely and have:

[NonSerialized]
public PathVerifier PathVerifier { get; }

I personally like the newline between the properties, but I prefer consistency to any personal preference I have :)

Copy link
Member

Choose a reason for hiding this comment

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

Not a huge deal just to leave it as going to be a matter of preference.. and we don't have any standards at the moment.

@jpreese
Copy link
Member

jpreese commented Jul 10, 2018

  1. Yeah, as far as I'm aware there hasn't been anyone come forward saying we're a hindrance for too many releases. Which, this is my primary concern, is probably a non issue.

  2. To resolve this what I'll usually do is ultimately have two commits to master when its time to submit my PR. One commit is purely aesthetics, refactoring, etc and then the other is the feature itself.

All said and done, I can be down for these PRs as I am a refactoring fiend.

@jpreese
Copy link
Member

jpreese commented Jul 10, 2018

Looks good to me! 🎉

@fgreinacher
Copy link
Contributor

Merging - thanks for taking care!

@fgreinacher fgreinacher merged commit 40403fa into TestableIO:master Jul 10, 2018
@robkeim robkeim deleted the misc-code-cleanup branch July 15, 2018 03:10
@robkeim
Copy link
Contributor Author

robkeim commented Jul 15, 2018

My first PR merged, woo-hoo 🍾

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.

3 participants