Giter Club home page Giter Club logo

Comments (8)

nicolaiw avatar nicolaiw commented on June 10, 2024 1

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.

Mr-Markus avatar Mr-Markus commented on June 10, 2024 1

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.

nicolaiw avatar nicolaiw commented on June 10, 2024 1

@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.

eiaro avatar eiaro commented on June 10, 2024 1

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.

eiaro avatar eiaro commented on June 10, 2024

The var statement was introduced in C# 3.0 to improve readability...

I don't argue format, so whatever you decide.

from zigbeenet.

Mr-Markus avatar Mr-Markus commented on June 10, 2024

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.

Mr-Markus avatar Mr-Markus commented on June 10, 2024

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.

eiaro avatar eiaro commented on June 10, 2024

You don't have this in your VS?
image

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.