1.

Best Practices in C#

Answer»

C# is a general purpose object-oriented programming language with multiple paradigms. It was designed for Common Language Infrastructure (CLI) in 2000 by Microsoft.

C# has multiple advantages to CONTRIBUTE to the speed of web development solutions. Some of these are  SCALABILITY support, garbage collection, type safety, easier type declarations etc.

Best Practices to write better C# code

Some of the best practices that help in WRITING better C# code are given as follows:

  1. PASCAL casing should be used for method names and class names while Camel Casing should be used for local variables and method arguments.
  2. Underscore should not be used in identifiers.
  3. All member variables should be declared at the class top and at the topmost should be static variables.
  4. The class sizes should be small for greater efficiency.
  5. There should be no obsolete comments in the code. They should be updated if required.
  6. The methods should be short.
  7. There should be no unnecessary regions in the class.
  8. The complex expressions should be avoided.
  9. In a particular routine, there should be minimum NUMBER of returns.


Discussion

No Comment Found