Conversation
| { | ||
| // Turn the switch | ||
| this._switches[i] = !this._switches[i]; | ||
| this.switches[i] = !switches[i]; |
There was a problem hiding this comment.
Should we also use the more explicit way here? Indicate somehow that this is a class/instance variable? That is, use this keyboard with the same reasoning as using base.
I think we should be consistent and select one of these ways:
- Use the MS style
- Use our own "better" style with a consistent way. Use both
thisandbase(or neither of them).
There was a problem hiding this comment.
this is more universally recognized across programming languages, such as Java, C++ JS, Dart, Scala etc. Python and Swift use self, but this aligns better with broader conventions than underscores, which are specific to C#.
There was a problem hiding this comment.
Good reasoning. I usually prefer the language-specific way if there is one (like in Python). But I can see benefits on both sides.
| // Retrieves the names of all the resource files in the specified folder. | ||
| // The parameter `folderName` must be specified as a full path, for example, `Loupedeck.DemoPlugin.Resources`. | ||
| // Returns the full names of the resource files, for example, `Loupedeck.DemoPlugin.Resources.Resource.txt`. | ||
| public static String[] GetFilesInFolder(String folderName) => PluginResources._assembly.GetFilesInFolder(folderName); |
There was a problem hiding this comment.
Even if using the PluginResources prefix is not mandatory, it's more expressive. So once again, do we want to be explicit or remove extra clutter?
Both are ok for me, but it would be good to select one way and stick with it.
There was a problem hiding this comment.
Defining explicitly PluginResources within PluginResources is redundant. You'd know the member var is within the static class anyway. If it was public, then it'd make more sense.
There was a problem hiding this comment.
I agree, the extra text can distract the reader. I remember fighting against this rule when I joined the LPS team :).
thiskeyword