.NET Language Features

Within the .NET Framework data types such as Boolean can either be true or false. Right?  Well, with the release of 2.0 Framework it has been possible to create nullable data types.  A nullable type can represent all the values of the underlying type plus empty (or undefined).  In the case of our Boolean it would be True/False and Nothing.   It is only possible to create a nullable types Nullable(Of T) for value types since the default value for reference types is already nothing.  The following types are valid as nullable: Boolean, Byte, Int16, Int32, Int64, Single,...

Generics provide a way for developers to define subroutines, functions, fields, properties as well as classes, structures, interfaces and even delegates in such a way that the parameters are not of any particular type.  In a sense the constructs are defined in a generic approach. The .NET Framework contains the following namespaces:System.Collections, System.Collections.Generic.    The latter mimics very much the features of the former.  System.Collections namespace (nongeneric) ICollection (size, enumeration, thread safety) ...

C# uses special escape sequences within a string to signify that what follows is to be treated differently.  The special character is the backslash \.  This character says to treat whatever follows it as though it were part of the string itself.  string msg = "Spot the dog said: \" get that dog bone\"";  // knowing this the following is good syntax: Spot the dog said: "get that dog bone" //output List of C# Escape Sequences \"  Display a double quotation...

Instead of the following typical property setter/getter private string courseName; pubic string CourseName{    get { return courseName;}    set { courseName = value;} }   //Auto-Implemented property implicitly creates an instance variable for property CourseName public string CourseName {get; set;} unable to use the private variable for this property (hidden from developer) developer can only reference within the class via CourseName  This is a reasonable...

Details... an anonymous type declaration begins with the new keyword followed by a member-initialzer list in braces {} the compiler generates a new class definition that contains the properties specified in the new member-initializer list all properties of an anonymous type are public and immutable anonymous type properties are read-only (you cannot modify a properties value once the object is created) each properties type is inferred from the values assigned to it the compiler defines a ToString method that returns comma-separated list of property-name = value pairs Equals method compares the properties of...

When dealing with collections the common question is how to filter them based on criteria.  The following are a few techniques used to accomplish this. A delegate is like a function pointer.  A predicate is a method that returns true or false.  In the case of List<T> it is possible to pass it a delegate that is a function that returns true or false. In the examples below I have base object a generic collection of those objects and am using the FindAll method to return only a few of the objects based on matching criteria.  There are...

As you are listening to these realize that it is impossible not to think of someone you know.  That is just funny. It Works on My Computer Guy - “dozens of dependencies”, “replace the production server with your development pc” - “all in a days work” Overly Complicated App Guy – “18 abstraction layers”, “what the hell were you thinking” Mr “I can build your own version of asp.net better than Microsoft” Guy – very very funny!!


About Me

An engineer by training and a software developer at heart. My techniques and approaches meld engineering approaches with software technology.

Core to these principles is a systematic approach to the development of software with a strong lifecycle and process management emphasis through adoption of mature technologies.

Ten years designing heavy structural steel and concrete structures and 12 years in the software development profession have embedded strong project management and business knowledge in my approaches.

Subscribe to Rss Feed


Follow me on twitter @dyardy