Types of languagse:
- Statically typed language: E,g.when you create an object, you declare its type, and in a statically typed language such as C#, the compiler will “enforce” that typing, giving you an error at compile time (rather than runtime) if you violate the typing by (for example) trying to assign an employee object to an integer variable. This is a good thing; it cuts down on bugs and makes for more reliable code. [1, pag. 21]
- Strongly typed language: finally, C# is strongly typed, which means that any operation you attempt on any object or variable must be appropriate to that type, or it will cause a compiler error. Once again, this is a good thing; it helps identify bugs reliably at compile time. [1, pag. 21]
- Explicitly/Implicitly typed language: In the vast majority of cases, C# is “manifestly” typed—which means that you explicitly declare the type of the object. There is one exception, which is the use of the keyword var. In this case, C# is able to infer the type of the object and thus, rather than being manifest, is actually implicit. [1, pag. 21]
C#
We can say that C# is statically and strongly typed: means that you must declare your types, and the compiler will then enforce that you use your objects according to their declared types (what is a good thing!).It is also "manifestly" typed when using most types, except when using the keyword var, at which time it is implicitly typed.
C# is case-sensitive (someName and SomeName are two different identifiers).
Microsoft naming conventions suggest using camel notation (initial lowercase, such as someVariable) for variable names, and Pascal notation (initial uppercase, such as SomeMethodOrProperty) for method names and most other identifiers.
C# is case-sensitive (someName and SomeName are two different identifiers).
Microsoft naming conventions suggest using camel notation (initial lowercase, such as someVariable) for variable names, and Pascal notation (initial uppercase, such as SomeMethodOrProperty) for method names and most other identifiers.
Language Notations:
- Camel notation (no spaces, first letter is lowercase and other words first letter capitalized) [1]:
myCamelNotationIdentifier
- Pascal notation (like camel notation but the initial letter is uppercase) [1]:
MyPascalNotationIdentifier
No comments:
Post a Comment