Comments (8)
For me.. I do not use ReSharper.I would suggest
-using default VS indentions
-always use curly brackets for if statements except for parameter validations
-for parameter validations use one line for the condition and next line with the mentioned indention throwing the exception
-always add xml comments for puplic members
-avoid empty catch blocks or at least leave a comment
-Async postfix for methods returning a Task
-one File per class
-underscore prefix for private attributes
-use private attributes instead of private properties
-order of class members:
private attributes
properties
ctors
public methods
private methods
That's just my opinion.. Comments or additions are welcome
from zigbeenet.
I also don't have ReSharper. But i can agree @nicolaiw sugesstions.
One thing i would prefer, because of better readability:
- use data type on variable declaration instead of var
int a = 1;
int b = 1;
so use:
int c = a + b;
instead of
var c = a + b;
from zigbeenet.
@eiaro Im with you.. MS introduced it to improve readability..but in this case I guess we can benifit of explicte type declarations.. Zigbee is not an easy protocol and when someone tries to contribute it could be helpfull to see the type at the first sight without hover the method to see which type u are get from a method or what else.. Zigbee is not easy so I for my self would also prefer to declare types explicitly instead of using var
from zigbeenet.
For what it's worth, I disagree. In 10 years on the Net platform, I've never heard anyone wishing back to explicit declaration.
If you want contributors to follow your guidelines you must create some sort of style sheet. ReSharper is good, but there is also https://github.com/DotNetAnalyzers/StyleCopAnalyzers
from zigbeenet.
The var statement was introduced in C# 3.0 to improve readability...
I don't argue format, so whatever you decide.
from zigbeenet.
Most time we are reading code. So readability is a fundamental point.
var is good when you are working with Linq for example, but for declaration of variables does not cost more time to write data type, but improves readability
I won't get in discussions but it would be a help if you use implicit type of it is not clear on declaration.
Otherwise it will be OK if you write things like var count = 0 where it is clear which datatype it is
You can read many discussions about var on the internet and only if something was introduced it does not always make sense or improve something
from zigbeenet.
Ok following… because we do not have ReSharper and other Tools at the Moment we can not provide some guidelines at the moment.
Your code isn't bad and it was just a suggestion.
This should not blocks our development, because we have a great software we are working on and i am happy to work with you :-)
This issue is now on-hold
from zigbeenet.
You don't have this in your VS?
Write the settings in a file and name it .editorconfig
and it will be applicable for everyone on the project if they work on an editor supporting EditorSettings (most do).
(This is just to show there are options)
from zigbeenet.
Related Issues (20)
- Replace SeriLog with Microsoft.Extensions.Logging HOT 3
- Serial connection dies every 59 minutes HOT 14
- Missing cluster, but message came from device
- Conbee 2 Timeout / Unresponsive HOT 1
- Reliable way to detect dongle disconnects HOT 3
- ConBee II connected but all the values are 0 or null
- Get device state HOT 2
- Nuget packages out of date? HOT 3
- Issue in RequestKey command(send by sleepy end device) handling by coordinator for Ember hardware HOT 1
- Make the classes less private & more protected so we can extend some classes. HOT 2
- ZigBeeKey(string keyString) doesn't correctly parse hex HOT 1
- Correct settings for XBee? HOT 2
- ZigbeeNet is a community project
- How can i replace my dongle?
- Data transfer using CC2531
- Permit Join with XBee
- Sonoff zigbee 3.0 dongle not starting... HOT 2
- How to read data from CC2530?
- Can i add support for zigbee devices? HOT 1
- Support for CC2652 ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zigbeenet.