Thursday, May 29, 2008

UML and some stuff

Here are some useful links for UML class diagrams
http://www.objectmentor.com/resources/articles/umlClassDiagrams.pdf
http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/


And a book, thanks to Asmaa Magdi ACMaa
http://portal.aauj.edu/portal_resources/downloads/uml/sybex_mastering_uml_with_rational_rose2002.pdf


The difference between Aggregation and Association


Aggregation is when an object contains a collection of other object. This is done mainly via data structures. Like a class that contains an Array, a List, a Dictionary, a HashTable, ...


Association is when objects/classes (sub-systems) interact together in a larger system. This can be achieved either by letting the objects have references to other objects in the system (this involves aggregation), by using static classes, ...


Examples,


  1. In Asp.Net, the use of static classes is obvious. You have the MembershipProvider, the RuleProvider, the ConfigurationManager, ... which provide services (functionality) to other objects/classes.
  2. Suppose you're designing a strategy game where soldier must know the location of other soldiers. So you will make a list of references to other soldiers in the soldier class.

Object Composition at wikipedia


This file contains a sample C# code and it's simple UML class diagram (in both Word 97-2003 and Word 2007 formats)

Wednesday, May 21, 2008

Constructors and Destructors

Constructors are special functions that are executed to initialize the object's data members at creation.
Constructors have the same name of the class and do not have a return type.


class Employee

    public Employee()
    {
    }
}


Constructor overloading


You can have more than one constructor with different parameter signature i.e. different number of parameters or different datatype arrangement.


class Employee
{
    public Employee()
    {
    }

    public Employee(string employeeName)
    {
    }

    public Employee(string employeeName, decimal salary)
    {
    }

    public Employee(decimal salary)
    {
    }
}


The default constructors


If you haven't defined ANY constructor in a non-static or non-abstract class, the compiler creates for you a public constructor with no parameter.


Structs do not accept explicit parameterless constructors although they have one by default. All data members of the struct must be explicitly assigned to value.


Base constructors


class Person
{
    public Person()
    {
    }

    public Person(string name)
    {
    }
}

class Employee : Person
{
    public Employee()
    {
    }
}


Let's talk philosophy. You cannot have a glass of water before it has been a glass first. You cannot have an employee before he/she has been a person first.
So, in order to create an object as an Employee you have to create it first as a Person. Let's see code.


new Employee();
When this statement get executed; if you don't explicitly specify which base constructor to use, the default constructor will get executed if exist; otherwise, you will get a compiler error.


How to explicitly specify the base class constructor?
Simply you use the base keyword as follows.


class Employee : Person
{
    public Employee() : base("No name")
    {
        // you can here write employee specific initialization
    }
}


You can also pass parameters from the current constructor to the base constructor as follows.


class Employee : Person
{
    public Employee(string employeeName) : base(employeeName)
    {
    }
}


Actually, the concept of base constructors is not bound only to base class's constructors. It extends to current class's constructors.


The concept is simply you define a constructor to construct the object before it get constructed by the current constructor being executed.


You can make a constructor call another constructor in the same class as its base constructor using the this keyword. You can then make a chain of constructors.


class Emplyee : Person
{
    public Employee() : this(0)
    {
    }

    public Employee(decimal salary) : base("No name")
    {
    }
}


Static constructors


A static constructor gets executed directly before you first create an object of the class or access any of its static members. In fact it gets executed when loading the class definition in memory.


Static constructors increase performance with the fewest code. Another technique would be creating a "dirty-bit" to indicate whether the class has ever been used or not and keeping checking it in each constructor and static method and static property (note that this technique doesn't work with static fields of course).


Static constructors don't accept access modifiers or parameters, thus you will have only one static constructor per class/struct (no overloading). And you cannot call static constructors directly.


How constructors work?


  1. What happens when you execute something like
    new Employee("abc");
    You use the new keyword in constructor context so the runtime knows you want to create object of a class.
  2. Then the runtime gets which type you want the object to be, here we want an Employee.
  3. The runtime allocates a location in memory which will hold the data and assign them to their default values.
  4. The runtime gets the constructor that matches the parameters you provide.
  5. The runtime executes the base constructor of the current constructor (if not specified, the default constructor is executed).
  6. Then the code of the current constructor gets executed.
  7. Then you get the reference to the object you've just created.

Keeping in mind that static constructors get executed at the first use of the class/struct.


Constructors and access modifiers


With the exception of static constructors and struct's constructors, you can define constructors with any access modifier (public, protected, internal, internal protected, private), see the Access modifiers post.
You make a protected constructor to use it as a base constructor of other constructors in derived classes. You can not make protected constructors in structs because there is no inheritance in structs.
You can do something like that.


class Employee
{
    private Employee() // a constructor to be used only by this class
    {
    }

    protected Employee(string employeeName) // to be used by derived classes
    {
    }
}


Destructors


They are functions that get executed when the Garbage Collector collects objects. It's called automatically by the GC so you don't have control over when they get executed.


Destructors are used as cleanup functions you use to free up resources used by the object.


class Employee
{
    ~Employee()
    {
        // here, you can free up resources that were used by the instance (Streams, Brushes, ...)
    }
}


Destructors are parameterless and have no return datatype. You can have only one destructor per class.


Another way to do this is using the IDisposable's Dispose() thus you may use the using statement. This is the recommended way to free up resources.


See destructors at the MSDN here.



A simple demo of constructors and destructors

Sunday, May 11, 2008

Access modifiers

.Net assemblies


Before we dive into access modifiers we need first to define .Net assemblies. A .Net assembly is an IL (Intermediate Language) code library, this definition includes both process assemblies (exe) and library assemblies (dll).


Access modifiers are keywords used to specify the declared accessibility of a member or a type. The significance of access modifiers comes from their use of defining a type's interfaces (the parts of the type exposed to other types, see the Encapsulation post). A type can be a class, a struct, an interface ... . Access modifiers keywords are:

  • private
  • protected
  • public
  • internal
C# keywordMeaning
privateaccessible only to this type
protectedaccessible only to this type and derived types (even outside the assembly)
internalaccessible to all classes within the same assembly
protected internalaccessible only to this type and derived types within the assembly
publicunrestricted


The private keyword

A member marked with the private keyword means it's only accessible to this type. Only other members of the type can access it.
The private keyword is used to hide both the data and the methods of the inner implementation of the type.


The protected keyword

A member marked with the protected keyword means it's accessible only to this type and derived types (inside or outside the assembly). The private keyword shapes the protected interface of the type (the parts of the type that is exposed to derived types).


class A
{
    protected int x;
}

class B : A
{
    // x is visible here because it's a protected member of the base class. x is still protected and it became a member of this class
}

class C : B
{
    // x is visible here because it's a protected member of the base class. x here is still protected
}

class D // doesn't inherit from any any class
{
    A ref_a = new A();

    // ref_a.x is not accessible from here because D doesn't inherits from A, B or C
}


The internal keyword

A member marked with the internal keyword means it's accessible to all other types located only in the same assembly. If you reference this assembly from somewhere else, you wont be able to access internal or protected internal members because they are public or protected at the assembly level.


protected internal

A member marked with the protected internal combination means it's both protected AND internal that is it's accessible only to derived types located only in the same assembly.


The public keyword

A member marked with the public keyword means it's accessible to any other type (inside or outside the assembly).
The public keyword is used to define the public interface of the type (the parts of the type that is exposed to any other type).


Nested types


A nested class is a class that is defined within another class. You sometimes nest classes to organize them or to expose the outer class's private and protected members to the nested class. A nested class can be thought of as a member of the containing class although it's not. What I mean is you can have a private class inside another class so this nested class is only accessible to the class containing it.


class A
{
    private int x;
    ...
    class B
    {
        // we can access A's x from here. in fact, we can access all the members of A
    }
    ...
}


You access nested classes the way you access members. you write A.B to access the class B from out side the class A if the class B was part of the public interface or the protected interface.


You can not make the outer class inherit from any of its inner classes. You can not do something like class A : A.B


Remarks


  • The default access level of classes and structs is private and the default access level of enums and interfaces is public.

  • Once you declare a member with a specific access level you cannot change its access level in derived types.

  • There are some restrictions on the use of access modifiers. For example, you can not have a private class A and a public class B that inherits A. Because the base class must be at least as accessible as the child class otherwise it wouldn't make any sense. The same rule is applied with function return types and function parameters. You can find more about Restrictions on Using Accessibility Levels here.

  • Members of enums and interfaces can not be marked with access modifiers. While the members of a struct can be marked only with public, internal or private.



Again this codeproject article by Marc Clifton.
And access modifiers at the MSDN.

I want to thank all my teachers and everyone who support me specially my teacher Mohamed Samy for his efforts and vision during the preparation of the previous couple posts.

Wednesday, April 23, 2008

Inheritance and Polymorphism

Inheritance means if class B inherits from class A then B has class A's attributes and behavior. That means class B inherits class A's members (fields, properties and methods).
We call the class A the base class or the parent class and the class B the derived class or the child class.


class A
{
    ...
}

class B : A // class B inherits from class A.
{
    ...
}


As a result of inheritance, if class B inherits from class A then class B can substitute class A. This is because the inheritance relationship is an "is-a" relationship. The class B is an A.
But this is one-directional relation, class B is an A but class A is not a B.


A ref_a = new A();
B ref_b = new B();
ref_a = ref_b; // because B is an A so we can put a B instead of an A
//ref_b = ref_a ; // Error. This won't compile because an A is not a B (but a B is an A)



So, you might have a function that returns an A but it can return a B because B is an A. The same concept is applied if you have a function that takes an A as a parameter but you can pass a B instead.


Class hierarchy


A class hierarchy represents the sequence of inheritance of a class. Let's take a look at the System.Windows.Forms.Label's inheritance path in the following hierarchy.


System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
         System.Windows.Forms.Label
       System.Windows.Forms.ButtonBase
         System.Windows.Forms.Button
         System.Windows.Forms.CheckBox
         System.Windows.Forms.RadioButton

A Label is a Control and a Control is a Component, So a Label is a Component. You got the idea, a Label is a MarshalByRefObject and is an Object. All .Net classes implicitly inherits from the System.Object class


Polymorphism and Overriding


Polymorphism is the ability of objects of different classes to respond to method calls of the same signature, each one according to an appropriate class-specific behavior. This is often achieved by inheritance.


Overriding allows you to alter behaviors inherited from the parent of the class.


To override a function in the child class it must be "overridable" in the base class. It must be marked with the virtual keyword in the base class, in fact the equivalent Visual Basic keyword is actually Overridable which is more meaningful. Of course, an overridable function can not be private so that it's exposed to the child class. We shall discuss access modifiers later.


class A
{
    public virtual string Foo()
    {
        return "A's foo.";
    }
    ...
}

class B : A

    public override string Foo() 
    { 
        return "B's foo."
    }
    ...
}



A ref_a = new A();
B ref_b = new B();
ref_a = ref_b;
Console.WriteLine(ref_a.Foo()); // "B's foo."


To understand better the overriding behavior, we shall discuss the this keyword and base.


this vs. base


The this keyword represents the instance of the object being instantiated from the current class. Whether it's a base class or a derived class, it doesn't matter.


The base keyword represents the direct parent of the class which the object is being instantiated from.


So, you use the this keyword to explicitly reach the members of the same class, and you use the base keyword to explicitly reach the members of the parent of the class.


Let's get back to the previous code snippet and modify it a little bit to see what does it all mean.


class A

    public virtual string Foo() 
    { 
        return "A's foo.";
    }
    ...
    public void Poo1()
    {
        // Console.WriteLine(Foo()); // the same as the next line
        Console.WriteLine(this.Foo()); // "A's foo."
    }
}

class B : A

    public override string Foo() 
    { 
        return "B's foo.";
    }
    ...
    public void Poo2()
    {
        Console.WriteLine(base.Foo()); // "A's foo."
        // Console.WriteLine(Foo()); // the same as the next line
        Console.WriteLine(this.Foo()); // "B's foo."
    }
}


From the outside.


A ref_a = new A();
ref_a.Foo(); // "A's foo."
B ref_b = new B();
ref_b.Foo(); // "B's foo."
ref_a = ref_b;
ref_a.Foo(); // "B's foo." // it goes down the class hierarchy


Notice that at the previous line B's Foo is called instead of A's. That's because if a function is virtual and is called from a reference to the base (it's treated as the base). It goes down the class hierarchy whenever is possible. This will become clearer when discussing type casting.


http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming

Sunday, April 13, 2008

HTML and CSS

A while ago I was adjusting the blog's CSS to colorize code (mainly C# for now) snippets and I made a post as a test. And someone asked in a comment what CSS was. So, this is a brief introduction about HTML and CSS and some useful links at the end of the post.

HTML (Hyper Text Markup Language)

HTML is a markup language used for writing webpages. It consists of nested tags to describe the structure of text-based information.

HTML syntax is pretty simple. HTML consists of tags. A tag is some text surrounded by angle brackets like the tag <head>. Each tag has an end tag like </head>

Here is a Hello World HTML page. Copy-paste the code in notepad and save the file as "Hello.html" and make sure the extension is .html or .htm but not .txt


<html>
    <head>
        <title>My first HTML page</title>
    </head>
    <body>
        Hello, <b>world!</b>
    </body>
</html>

CSS (Cascading Style Sheets)

In the previous Hello World example. You see the <b> and </b> surrounding "world!". This tag mean the text is bold. Other tags like <font> , <i> ... and attributes are used to format the text in the browser. But hard coding formatting and styles into HTML is hard and not customizable.

CSS is a stylesheet language to describe the presentation of markup language documents. Instead of hard coding embedded styles or tags in HTML you can define a styles for the page and/or link to external .css files.

In the previous HTML code you can set the background color of the body of the document like this.


<body style="background-color: Red; font-size: large">
    Hello, <p>world!</p>
</body>

Or, you can define write the previous page as.


<html>
    <head>
        <title>My first HTML page</title>
        <style type="text/css">
            body {
              background-color: Red;
              font-size: large
            }
        </style>
    </head>
    <body>
        Hello, <b>world!</b>
    </body>
</html>



http://www.w3schools.com/html/default.asp
http://www.w3schools.com/Css/default.asp
http://www.codeproject.com/KB/HTML/htmlbeginner.aspx
http://www.codeproject.com/KB/HTML/cssbeginner.aspx

Wednesday, April 9, 2008

Encapsulation and Information Hiding

Encapsulation means hiding the implementation details of the class from other objects and separating the class's implementation from it's interface.


A class's interface is the parts of the class which is exposed to other classes. It's related to but not the same as interfaces like IEnumerable. It's the way an object of the class is exposed to other objects and which members are public, protected or private.


There are two kind of object's interfaces; the parts of the object that is exposed to every other object is called "public interface", and the parts of the object which is only exposed to derived object via inheritance is called "protected interface".


Creating a well defined interface is an essential step in a good object oriented design.


Why encapsulate?


  • Hide implementation details.

  • Maintain the same object's interface while the inner implementation can change without forcing the clients of the object to change the way they consume it.

  • Encapsulation helps abstraction so you will deal with object at a high level of details, so that you use objects like a Button or data Connection as a "black box" and build more complex software with it.

Example; The interface of a  Stack class is that it has "Push", "Pop" and "Peek" method. Other object don't care how the Stack class is implemented, all they care is its interface.
If the stack was implemented using an ArrayList and the developer wants to change it to use a LinkedList instead, all he has to do is to change the inner implementation and leave the interface unchanged, so that all the code outside of the class will continue to work unchanged.


Another example; you may want to write a log file, you write a class to handle logging to the file. The Log class would have a method public void Log(string message) that will handle writing to the log file, take care of the file structure, add date and time to the log entry ...etc.


One more example; You would use Enums to hide the underlying datatype of a type. Let's see this code snippet.


public enum AccountType : byte // define a new type called AccountType with underlying type byte. by default, the underlying type is integer.
{
    Administrator = 0,
    Limited = 1,
    Guest = 2
}


So, you now have a new data type the AccountType type which is actually a byte. The AccountType enum has 3 constants Administrator, Limited and Guest with values 0, 1 and 2 respectively.


AccountType type = AccountType.Administrator; // type = 0 since Administrator = 0 in the enumeration

type = (AccountType)2; // explicit type cast from int (which will be converted implicitly to byte) to AccountType

byte b = (byte)type; // explicit type cast from AccountType to byte



http://en.wikipedia.org/wiki/Information_hiding
Code Complete 2nd Edition by Steve McConnell

Wednesday, April 2, 2008

CSS Test

This is just a test for the blog's CSS.


// comment
static class Program
{
   [STAThread]
   static void Main()
   {
       Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);
       Application.Run(new Form1());
  }
}

Friday, March 21, 2008

SQL and some remarks

Since there is no time now to talk in details about SQL, I'm pointing out some notes and links to articles and websites that discuss SQL in a simple manner. So, if you have questions, leave a comment.
http://www.w3schools.com/sql/default.asp
http://www.codeproject.com/KB/database/sqlintenmin.aspx
http://www.databasedesign.co.uk/sqlselectshortsummary.htm
http://msdn2.microsoft.com/en-us/library/ms189463.aspx

SQL Constraints

http://www.1keydata.com/sql/sql-constraint.html

Notes:
  1. SELECT TOP n WITH TIES will not select all repetition, instead it will select repetitions till the first truncation. And it is only to be used with ORDER BY.
  2. To get the current date use the GetDate() function.

Here is a file containing some windows applications and SQL notes thanks to Abd El-Rahman. I haven't review it's content, so, here is the file[^] as it is.

Event-Driven Programming

Hey guys, how are you?
Here we discuss windows event-driven programming. There are some stuff must to know, I know they sound hard but in fact they are very easy.


The Message Queue


Unlike MS-DOS-based applications, Windows-based applications are event-driven. They do not make explicit function calls (such as C run-time library calls) to obtain input. Instead, they wait for the system to pass input to them.
The system maintains a single system message queue and one thread-specific message queue for each graphical user interface (GUI) thread.


Whenever the user moves the mouse, clicks the mouse buttons, or types on the keyboard, the device driver for the mouse or keyboard converts the input into messages and places them in the system message queue. The system removes the messages, one at a time, from the system message queue, examines them to determine the destination window, and then posts them to the message queue of the thread that created the destination window. A thread's message queue receives all mouse and keyboard messages for the windows created by the thread. The thread removes messages from its queue and directs the system to send them to the appropriate window procedure for processing.


With the exception of the WM_PAINT message, the system always posts messages at the end of a message queue. This ensures that a window receives its input messages in the proper first in, first out (FIFO) sequence.


The WM_PAINT message is a message from the system to tell the application it must draw itself. It has the highest priority in the message queue to maintain responsive GUI.


The Message Loop


The main task of the WinMain function is processing the message queue. It will get a message from the queue and pass the message to the appropriate function to process it then remove it from the message queue.


// this is a generic simplified C++ windows application's WinMain body
while(GetMessage(&msg)) // retrieve a message from the application message queue (by reference)
{
    TranslateMessage( &msg ); // prepare that message in the message queue to be processed
    DispatchMessage( &msg ); // determine and call the function that will handle that message
}

So, the DispatchMessage will know which Control will process the message and call its WndProc function and from there The OnClick, for example, and then raise the Click event.

Events


Events are delegates that will be invoked when specific actions happen.


public delegate void SampleEventDelegate(string someData); // here we define the delegate singature
public class SampleEventSource
{
   public event SampleEventDelegate SampleEvent; // here we declare that there is a public event named SampleEvent of the same signature as the delegate SampleEventDelegate
}

The same rules of delegates apply to events. So, when we add an event handler to that event it must be of the same signature. The following line we create an object of the SampleEventSource and add an event handler to its event.


obj.SampleEvent += new SampleEventDelegate(myfunction); // that we already have a function called myfunction in the class we're declaring the obj object with the following declaration.
private void myfunction(string data)
{
    MessageBox.Show("Event raised with these data\n" + data);
}

You deal with event the same way you deal with delegate. So, any of following lines of code will do the job.


obj.SampleEvent += new SampleEventDelegate(myfunction);
obj.SampleEvent += myfunction; // implicit conversion to delegate
obj.SampleEvent += delegate(string data) { MessageBox.Show("Event raised with these data\n" + data); }; // anonymous method

As you see here, there is no EventArgs e or object sender in the code above and yet the code is correct. The EventArgs e is to supply the data you want to the event in conventional way instead of passing your data as single parameters like the code above. So, if you want to pass data along with the event, create a new class that inherits from the EventArgs class and extend it with the members and functions you want.


What about the object sender? Because of the fact that a single function can handle more than one event, these events can be events of different objects, you need something to tell you which object triggered that function. This becomes handy in situations like when you're creating a calculator application, instead of having 10 functions with almost the same code to handle the Click event of the 10 numeric Buttons, you make only one function to handle the 10 Buttons' Click and then use a switch statement to control the function behavior.


You can handle the same event with more than one function and they will get executed in the same order they were added to the invocation list of the delegate.


Windows Controls Events


Windows Controls provide events that will automatically be raised by the control itself. All you have to do is assigning event handlers.


Examples,
The Control.Click event will be raised when the control gets clicked.

The Control.MouseEnter will be raised when the mouse enters the control's region.


Here is a simple demo of events, I hope I covered everything.


And some useful CodeProject articles, you may find extra information in them but it's ok, skip the advanced parts.
http://www.codeproject.com/KB/cs/event_fundamentals.aspx
http://www.codeproject.com/KB/cs/events.aspx


The information provided about the Message Queue and the message loop are from the Platform SDK for Windows XP SP2.

Wednesday, March 19, 2008

Static and non-static

Hi everybody, how are you doing?
Here we discuss some theoretical stuff for the mid-term exam. Sorry guys, I know we all know those stuff, consider it a quick revision. I hope I cover every thing. If I forgot to mention anything or said anything incorrect, please correct me. I welcome your comments.

The this keyword
We can say that this refers to the object of the class which will execute the code.
The equivalent keyword of this in Visual Basic.Net is Me which is a very self expressing name.
You cannot assign a value to this. A line like this = null; or this = new Foo(); causes compilation error because this is read-only.
The this keyword is also used to create indexers. It is also used in C# 3.0 to create extension methods.

The static keyword
Static members (variables or methods) don’t belong to a particular object. They belong to the class.
You don’t need to create an object to access a static member, because it belongs to the class.
The equivalent key word of static in Visual Basic.Net is Shared. This is a self expressing name because static variables are shared across all instances (objects) of the class.
The static keyword can be combined with other keywords (private, public …) in a meaningful context.
Static members can address only other static members of the same class but not the non-static ones.
Non-static members can access static members of the class.

Static variables
Consider the following class.

class Foo
{
    public static int SharedVariable;

    public void AddOneToTheSharedVairable() // this is an instance function. can only be called by an object
    {
        SharedVariable += 1; // static member are accessible
    }
}

Take a look at the following code snippet.

Foo.SharedVariable = 5; // I don’t have to created any objects of the class before I access a static member. note that the variable is also public

Foo f1 = new Foo();
// f1.SharedVariable // error. the static member doesn’t belong to the object but it belongs to the class.
Foo f2 = new Foo();
// now we have created 2 objects of the Foo class

f1.AddOneToTheSharedVariable(); // the static variable is changed by an object of the class
// now lets see what happened to the static variable
Console.WriteLine(Foo.SharedVariable); // 6

f2.AddOneToTheSharedVariable(); // now the object f2 is also changing the static variable
Console.WriteLine(Foo.SharedVariable); // 7

Static methods and the this keywords
Static functions and static properties can’t address the this keyword because they belong to the class not to an object. The this keyword is not available in the context of static members.

Notes:
• When all objects should share the same value of a variable you should use static variables. Example, a war game, each soldier object should know how many soldiers are there in the war field in order to determine how will he attack they enemy. So, instead of having a non-static variable for each soldier object, use a static variable to hold the count of the soldiers, this way saves memory and processing.
• When you want a function to be called without creating an object first make it static.
• If you have the choice between static and non-static function go for the static function, although it depends on the situation, this saves you the time of creating objects.
• Remember, static members cannot access non-static members.
• The static keyword cannot be used with constants because constants are static by nature.
• A static member cannot be marked as override, virtual, or abstract.
• The static keyword is used in operator overloading and when defining implicit and explicit type casting. You don’t create an object to perform the ‘+’ operator.

Static classes
A static class means that all its members are static and must be static. A static class cannot have non-static members.
We all are familiar with the System.Math class. This static class has static functions (Sin, Pow…)
A static class is sealed by default i.e. cannot be inherited.
You cannot create objects of a static class.

Notes:
• Usually, when you want to create a utility class like the System.Math you would use the static keyword.

For further information about C# keywords, see this CodeProject article by Marc Clifton.

Intro

Acknowledgment
First of all, I would like to express my sorrow that my professor Dr. Roshdy Aamer will no longer instruct us. It’s a big loss to college, my colleagues and me personally. And I would like to thank him for his efforts teaching us and his dedication and love to his work. Whatever I say, I still can not give him the appropriate credit.

About this blog
1- The main topic of this blog is programming. Specifically for the .Net Framework 2.0
2- Topics like Windows Forms Applications, Database Programming will be discussed.
3- Other topics might also be discussed.
4- Necessary information will be provided, technical detailed information will be provided whenever is possible.
5- Comments are essential enriching blogs. So, feel free to share knowledge with us and to ask questions.
6- I just want to mention that the name of the blog was one of many suggestions and it got the highest rating from my colleagues.

Reasons why I write this blog
1- I realized recently that it’s essential that I blog to help my colleagues in college, specially that our professor wont instruct us any longer due to health issues.
2- I should pass knowledge with my colleagues, the upcoming generations and other people.
3- Blogging will force me to learn further details, extend my knowledge and keep up-to-date as I have to provide as correct information as possible.

Resources and references
1- MSDN
2- The CodeProject
3- My teachers.
4- Friends and personal experience.
5- Variety of books, blogs, websites and other sources of information.

Apology
I would like to apologize to all my friends that this blog is in English since it would be hard to write the content provided in Arabic or to switch frequently between these two languages. I will use simple English and explain every thing in many different ways as far as I can.

I just want to mention that this is the first time I blog and I will be glad to receive comments, correction of wrong information I provide and questions.

I recommend you also ask questions at The CodeProject. Just, please, read the forum rules. Ask your question in the right forum. Don’t post programming questions in the lounge or any other non-technical message board. Ask clear and specific questions; provide details as much as possible to get your question answered. Don’t mention the word urgent or ask for a full code, no one will write your homework or do a project for you. And I want to say again, before you post a question at The CodeProject, READ THE FORUM RULES.