What is C#?

What is C# programming?

C# is a programming language developed by Microsoft. It has attracted attention because it is the core programming language of Microsoft. C# is a technical point of view, a kind of evolution C++ and, at the same time, it is a language highly influenced by Java.

The key question here is "Why C#?" is the question. Because C, C++, Java, and Visual Basic already exist as programming languages. Why is it necessary to add a new language to the existing languages?

Learn more: A list of C# tutorials

The answer is simple. C is already obsolete, and a successor language, C++, is in use. C++ is highly functional and gives you the freedom to write anything you want, but it does not automate memory management, and therefore, it is not a good choice for programming. Java has automated memory management, so there is no such danger, but because of its ideal of being able to run in any environment, it is not suitable for achieving the desired functionality because its functions tend to be maximized common denominators. Visual Basic is a language in which data types are automatically converted, which has the structural problem of making the program less readable and a breeding ground for bugs. There is a danger that bugs that would be found at compile time in languages that strictly apply data types will be overlooked.

Thus, no language can be said to be a programming language that just fits today's needs. Microsoft's conclusion to this is C#, which is positioned as follows when compared to other programming languages.

From the perspective of C++: Coding is much easier due to automated memory management.

From the viewpoint of Java: More realistic and easy to write any process

From Visual Basic: Data types are handled strictly, making it easier for the compiler to find bugs

Of course, these are only very rough summaries. If I were to discuss the differences between the languages, it would take an entire book by itself, so I won't go into them in-depth here. At any rate, please read this as an example of the functional necessity behind the creation of C#.

C# is a programming language developed by Microsoft and uses the same object-oriented approach as other globally used languages, such as C++ and Java. Object-oriented is simply explained as a programming language for achieving independence, reusability, and extensibility.

Until the advent of object-oriented programming, problems such as "adding one program affects other programs" and "changing one part of a program requires changing other parts as well" occurred routinely in the development field. The object-oriented development method was developed in response to these problems, and since programs are created in the image of creating and assembling parts, independence, reusability, and extensibility can be realized for each part of the program.

Advantages of using C#

Language Features, Libraries

With its long history as a programming language, C# offers a wealth of language features. In particular, LINQ (Language Integrated Query) for handling data, introduced in version 3.0, and lambda expressions, a simplified notation for functions, help improve productivity by reducing redundant descriptions. However, some functions are difficult for beginners in learning programming, so it is necessary to learn the basics first.

NET Framework, the development environment for C#, provides a set of programs created by Microsoft called the Base Class Library (BLC). For example, you can easily run a program to download a file from the Internet or send an e-mail by simply pulling it from the BLC without having to write the program yourself.

Development environment (Visual Studio)

And the advantage of C# is that Visual Studio is provided as a development environment and has a very good auto-completion feature to enhance productivity. Generally, C# is installed with Visual Studio, so development is usually done on Visual Studio.

Individuals learning the programming language also benefit from Visual Studio Community, a free and highly functional IDE that makes it easy to start learning to program.

C# sample program

Below is an example of C# programming:

  1. using System;
  2. namespace CSharpExample
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. //Print Hello World!
  9. Console.WriteLine("Hello World!");
  10. //Example of a for loop statement
  11. for (int i = 0; i < 10; i++)
  12. {
  13. Console.Write("i: {0} ", i);
  14. }
  15. }
  16. }
  17. }

Output:

Hello World!
i: 0 i: 1 i: 2 i: 3 i: 4 i: 5 i: 6 i: 7 i: 8 i: 9 

Summary

C#, developed by Microsoft, is a programming language that allows advanced development and is recommended as a programming language to learn because it is less difficult to develop than C++ or Java.

Because of its versatility, it may be a good choice as the first programming language to learn.


See also:
C# List Contains with Examples
C# typeof with Examples
C# TryParse (int, double, float) with Examples
C# Data Types
C# Variables