Closed Bounz closed 7 years ago
Because it's very useful - you can easily distinguish between instance fields and parameters passed to the method, especially if your methods are quite big. This style was used at both my places of work and is used by the .Net Core team, too (https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md). And yes, I use R# and like this tool very much.
Ok I'm asking because I was adopting too this convention time go, but then I decided to drop it because modern IDEs should already tell you if the field is global or local by using different colors. Anyway... it's ok =) I also noticed you made same kind of changes in HG code. So let's say we adopt this convention now on.
Are you using R#? We can include .DotSettings file into the repository, so it'll be easier to synchronize code style. Also, what do you think about using C#6 language features?
I am using Linux so R# is not available, but I think that Rider can do it anyway: https://www.jetbrains.com/rider/features/ So ok for .DotSettings file. I didn't look into CS6 yet, but it's ok for me as long as it doesn't break compatibility with mono (let's say 3.2 or 4.0 and up).
Looks like C#6 was implemented in Mono 4.0, so I'll use the new syntax in future work. http://www.mono-project.com/docs/about-mono/releases/4.0.0/ I'm also using Rider when coding on Mac, but it's not so smooth as Visual Studio meanwhile. Looking forward to a stable Release of Rider and hope it will become more stable and handy.
Hi @Bounz I've been thinking more about this prefixing convention and even if .Net Core team is adopting this, I don't feel like it is a wise decision. This is not needed anymore and will just create confusion and aesthetic issues in the code that was already refactored in the past. So this convention is not valid here. Whenever you have time/feel like to, please refactor both ZWaveLlib and in HomeGenie 1.2-wip branch by dropping all prefixes. Thanks :smiley_cat:
Ok, your repo - your rules.
One more thing to say about naming conventions.
I was looking through the code of MIG library and found this bit of code:
At the first glance, it looks that
lastAddedNode
is just a local variable or method argument. But no, it's a private field in the class that may be modified somewhere else in the code, but it looks similar to returnValue
local variable.
The only help here is that Rider colors them differently, but in other editors, it looks completely confusing.
returnValue
is white.... lastAddedNode
is magenta. Isnt't it?
Also MonoDevelop employs different colors and Visual Studio too.
What other editors are you talking about?
Maybe we have different color schemes, but here is what I see in Visual Studio 2017:
And this is how it looks in VS Code:
Anyway, never mind, I was just thinking out loud.
Implemented Ultraviolet sensor value. Added ability to invoke arbitrary z-wave command in test application