What is C#
- C# is pronounced "C-Sharp".
- It is an object-oriented programming language created by Microsoft that runs on .NET Framework.
- C# has roots from the C family, and the language is close to other popular languages like C++ and Java.
- The first version was released in the year 2002. The latest version, C# 8, was released in September 2019.
C# is used for:
- Mobile applications
- Desktop applications
- Web applications
- Web services
- Web sites
- Games
- VR
- Database applications
- And much, much more!
Why Use C#?
- It is one of the most popular programming languages in the world
- It is easy to learn and simple to use
- It has a huge community support
- As C# is close to C, C++, and Java, it makes it easy for programmers to switch to C# or vice versa
- Comments can be used to explain C# code, and to make it more readable. It can also be used to prevent execution when testing an alternative code.
- Single-line comments start with two forward slashes (//).
- Any text between // and the end of the line is ignored by C# (will not be executed)
C# Variables
- int - stores integers (whole numbers), without decimals, such as 123 or -123
- double - stores floating-point numbers, with decimals, such as 19.99 or -19.99
- char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
- string - store text, such as "Hello World". String values are surrounded by double quotes
- bool - stores values with two states: true or false
A data type specifies the size and type of variable values. It is important to use the correct data type for the corresponding variable; to avoid errors, to save time and memory, but it will also make your code more maintainable and readable
Advantage of C#
- Object-Oriented Language. C# is a pure object-oriented language, this allows you to create modular maintainable applications and reusable codes.
- Automatic Garbage Collection
- No Problem if Memory Leak. ...
- Easy-to-Development. ...
- Cross-Platform. ...
- Better Integration. ...
- More Legible Coding. ...
- Scarcity of Choice
Disadvantage of C#
- C# is slower to run. This is somewhat taken care of when using WPF,(Windows Presentation Foundation) although currently, the launching of the WPF application is still a bit slow. However, after the program is launched, the animation effects are all very smooth
- As the array size is fixed, if we allocate more memory than the requirement then the extra memory will be wasted. On the other hand, if we allocate less memory than the requirement, then it will create the problem
No comments:
Post a Comment