Loading, please wait...

A to Z Full Forms and Acronyms

What are the characteristics of C# ?

Jun 07, 2020 Characteristic, C#, 25406 Views
In this article you will learn about the characteristics of C#

Explain the characteristics of C#

The characteristics of C# are the following:

  1. Simple
  2. Modern
  3. Object-oriented
  4. Consistent
  5. Versionable
  6. Flexible
  7. Interoperable
  8. Compatible
  9. Typesafe
  10. Support Garbage collection
  11. Exception Handling
  12. Security

Let's get started:

1. simple:-

C# is designed to be easy for the professional programmer to learn and use effectively. If one has some programming experience, he will not find C# hard to master. Also, some of the confusing concepts from C++ are either left out of C# or implemented in a clearer manner. For example, the complex pointers in C++ are missing in C#. in C++ one has ., --> operators for namespaces, member access, and references respectively. But in C# a single dot (.) operator does all these operations.

2. Modern:-

The C# is emerged as a language for waiting for NGWS (next-generation windows services) applications. In C# memory management is automatic and is no longer the responsibility of the programmers. This automatic memory management is a responsibility of C# garbage collector. Another modern feature of C# is that it supports cross-language exception handling. A new data type called decimal is added in C# for monetary calculations. Another feature of C# for monetary calculations. Another modern feature of C# is that it supports a robust model.

3. Object-oriented:-

C# is an object-oriented programming language, thereby providing re-usability of existing code and reducing code redundancy. It supports major object-oriented programming features such as data encapsulation, inheritance, and polymorphism.

4. Consistent:-

C# supports a unified type system which eliminates the problem of varying ranges of integer types. All types are treated as objects and developers can extend the type system simply and easily.

5. Versionable:-

Versioning is the process of evolving an application in a compatible manner. C# supports both source and binary compatibility in applications. The source compatibility means that a new version of an application can work with the previous version of the application on recompiling the previous application. Binary compatibility means that the previous version of an application can work with the new version of the application without recompiling the previous version. Thus, C# supports versioning that enables the existing applications to run on different versions.

6. Flexible:-

In C#, code can be written either in safe mode or in unsafe mode. The default for C# code is the safe mode which does not support pointers. But one can declare which enables the use of pointers. This shows the flexibility of C#.

7. Interoperable:-

C# provides support for cross-language interoperability. This code produced by C# can work easily with the code produced by other languages. This is made possible through the CLS, Which defines a set of rules that every language in the .NET framework has to follow. The C# programs can use existing COM objects, irrespective of the language they are written in.

8. Compatible:-

C# enforces the .NET common language specification and therefore allows interoperation with another .NET language.

9. Typesafe:-

The common type system provides type safety, which in turn improves code stability. C# provides the following type safety measures:

  • One can not use an uninitialized variable.

  • It enforces overflow checking in arithmetic operations.

  • It checks the range of an array and warns when the access goes out of bound.

  • Dynamically allocated objects and arrays are initialized to zero.

  • It supports automatic garbage collection.

10. Support Garbage collection:-

Garbage collection is the process of recovering computer memory that is no longer required by the program. It is the feature of .NET that C# supports. Thus garbage collection automatically reclaims memory occupied by unused objects.

11. Exception Handling:-

The .NET standardizes the exception handling across languages. Exception handling provides a structured and extensible approach to error detection and recovery. The C# language's exception handling features provide a way to deal with any unexpected or exceptional situations that arise while a program is running.

12. Security:-

C# security is designed to operate as part of the .NET runtime and provides several built-in security features.

A to Z Full Forms and Acronyms