Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, March 24, 2009

Naming Conventions

Pascal Casing convention :
capitalizes the first character of each word.


Camel Casing convention :
capitalizes the first character of each word except the first word.

• Pascal Casing
o Class Name e.g. StudentClass
o Method Name (Sub or Function) e.g. FindStudent()
o Interface Name e.g. Istudent


• Camel Casing
o Private Variables e.g. studName
o Local Variables e.g. studCount
o Parameters Name e.g. studRoll


• Upper Casing
o Namespace should include Company Name followed by Module or System Name. e.g. COMP_SALES
o Constants e.g. COMPANY_NAME


• Other Useful Note:

o Parameters Name should followed by small ‘p’ to differentiate with the local variable
o Do not prefix data type in local variable, since this is not helpful in modern
o development environment. E.g.: strLocalvariable, intLocalVariable.
Interface name should be Prefixed with capital ‘I’

Saturday, March 21, 2009

What is the difference between an interface and abstract class?

(1)
In an interface , all methods are abstract and there is no any implementation.
In an abstract class some methods can be concrete.

(2)
In an interface class, no accessibility modifiers are allowed like public,private they are all public by default.
An abstract class may have accessibility modifiers.