Ad Code

Responsive Advertisement

C Sharp programming language

C Sharp programming language – 

It is an object-oriented programming language developed by Microsoft, as the part of the .net initiative and later approved as a standard by ECMA and ISO.

ANDERs Hejlsberg leads development of the language which have procedural object oriented syntax based on the C++ and includes influences from several other programming languages most importantly DEPIN and JAVA With a particular emphasis on simplification.

History Of the C# Language – 

during the development of .net class library were originally written in a language called Simple Managed C (SMC). In January 1999 Anders Hejlsberg formed a team to build a new language at that time called Cool later the language has been renamed C# and the class library as well as ASP.net runtime have been posted to C#.

C#’s principal designer and led architect Anders Hejlsberg, has previously invoked with the design of visual J++, Borland Delphi and the turbo Pascal languages. In interviews and technical papers he has state it that flows in most major programming languages like C++, JAVA, DELPHI, and SMALLTALK drove the fundamentals of CLR, which in turn draw the design of C# programming language itself.

Design goals :-

1. The ECMA standard list this design goal for C# , it is intended to be simple , modern , general purpose and Object oriented programming language.

2. The language should include strong type checking, array bounds checking, detection of attempts to used uninitialized variables, source code portability and automatic garbage collector.

3. The language is intended for used in developing software component that can take advantages of distributed environment.

4. Programmer portability is very important as specially for those programmers already familiar with C and C++.

5. Support for internationalization is very important.

6. C# is intended to be suitable for writing applications for both hosted and embedded systems.

                                             Versions of Language C#

                                                  1.0, 1.5, 2.0, 3.0, 4.0.

Feature of C# 2.0 :-

1. Partial classes which allow class implementation across more than one source field.
2. Generics or parameterized type.
3. Static class that cannot be instantiated and that only allows static members.
4. Anonymous delegates,
5. The accessibility of property assessors can be set independently.
6. Null able value types , which provides improved interaction with SQL databases.
7. Coalesce operator (??) Returns the first of its operant’s which is not NULL and NULL , if
no such operant exist.

Features of C# 3.0 :-

1. Language Integrated Query (LINQ)
2. Object initializers and collection initializers.
3. Anonymous types.
4. Implicitly typed arrays.
5. Lambda expressions.
6. Automatic properties.
7. Extension methods.
8. Partial methods.
Features of C# 4.0 –
1. Dynamic programming.
2. Named and optional parameters.
3. Covariance and contraverians.
4. Dynamic lookups.
5. indexed properties.
6. Com’s specific interop features.

                    Programming Structure under various programming languages.

                                               C programming
             
                    Collection of members

                         Void main () <- entry point
                             {
                                Call the members from here for execution
                             }

C is a procedural programming language, which consists of variable and functions (members) in it. The member which we define in the programming gets executed when we explicitly called them from main function.

NOTE- most of the programming languages starts their execution from main which is considers as the entry point for your program.

Procedural programming language doesn’t provide code security and code reusability. To resolve the drawbacks of procedural programming in 70s object oriented languages came in to existence which provides security and reusability of the code.

In an object oriented program the members are defined not directly with in the program, but under a container and wrapper known as class, which provide the basic security for content inside it.

A class is a user defines type. And to consume the members of a class we required to create an object of the class and using the object members of the class can be invoked.

Note- a type can never be consumed directly because they do not having any memory allocation so for consume the type we need to create a copy of the type.

Int = 100; //invalid

Int X =100; // valid

Test t;

t.add(100,50);

As a class is also a type. The same rule applies to class also, so consume a class we need to first create a copy of the class which is referred as object.

                                               CPP Program--
Class example
    {
     Collection of members
    };
  Void main < --entry point
    {
      -create the object of class
      -using the object invoke members of class
     }
Reactions

Post a Comment

0 Comments