Saturday, March 05, 2005

coding guidelines

The following Code-Guidelines is an extract which I took form a german .Net magazine. My personal point of view of those guidelines makes really sense the develope such lines for coding.

coding collections:

describe genereal basic classes and how you should use them.

  • How do you use the Exeption Handling
  • How do you protokoll failers? Where do you handle failures and finally which data is going to be listed.
  • How do you make Database access. Capsulation of classes, DB mng. they're abstract or build in.
Naming Convensation
  • Namespaces, Structures
  • Filesystem, organisation of projectfolders and filenames
  • prepare lines for files, namespaces, assemblies, classes, methods, parameters, variables, properties, constants, forms, controls

Object Oriented

  • prepare lines what kind of properties, methods etc. can be public, protected, private ....
  • Factor (addition of code which can be used in same baseclasses)
  • usage of abstract classes
  • usage of interfaces
  • overloading
  • how deep its allowed to inherit

Qualityaspects

  • size of classes, methods, files, namespaces & assemblies (normaly we speak about LLOC - logical lines of code)
  • define complexity of classes and methods
  • dont allow constucts like typeof() - its usage is to use over polymorphism

Formating

  • size of files, classes, methods und lines
  • tabulator
  • comments
  • etc.

Legimitation of non allowed constructs

  • exeptions always happens in a any kind of project. if this case happens try to comment and explain why its happens and maybe give a sample or somehting simular
  • add links to articles (create a knowleage bases available with links from your code)

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge