History
- **How**:
- Developed by **Anders Hejlsberg** and his team at **Microsoft** in the early 2000s.
- Designed as a modern, object-oriented language that combines the power of C++ with the ease of use of languages like Java.
- Part of the **.NET Framework**, C# was intended to be a language for building a wide variety of applications, from desktop software to web applications and games.
- Evolved through versions, with notable milestones such as C# 2.0 (introducing generics), C# 3.0 (LINQ), and C# 5.0 (asynchronous programming with async/await).
-
- **Who**:
- **Anders Hejlsberg**, a Danish software engineer, known for creating C# and also the architect behind Turbo Pascal and Delphi.
- **Microsoft**, the company that developed and maintains the C# language and the .NET Framework.
-
- **Why**:
- To create a safe, modern language that could address the challenges of developing applications on Windows, while being part of the .NET ecosystem.
- To combine the power of low-level languages with the simplicity and safety of modern programming paradigms like object-oriented programming.
- To provide a language that would be suited for building Windows applications, web services, and enterprise-level systems while being cross-platform with the introduction of .NET Core.
-
-
introduction
-
Advantages:
- Object-Oriented: Supports inheritance, polymorphism, and encapsulation, ideal for large applications.
- Rich Ecosystem: Access to the .NET framework, offering libraries for GUI, web, and database development.
- Cross-Platform: With .NET Core, C# works on Windows, Linux, macOS.
- Garbage Collection: Automatic memory management reduces the risk of memory leaks.
- Integration with Microsoft: Works seamlessly with Azure, SQL Server, and other Microsoft technologies.
-
Disadvantages:
- Memory Heavy: May use more memory compared to low-level languages like C.
- Performance: Slower than languages like C/C++ due to its managed nature.
- Learning Curve: Requires understanding of concepts like asynchronous programming and LINQ.
- Dependency on .NET: Still tied to the .NET ecosystem, which might limit flexibility.
-
Remember Points:
- Asynchronous Programming: C# supports asynchronous programming with async and await keywords.
- Modern Language Features: Includes LINQ, nullable types, and pattern matching, improving productivity.
-
-
Notes
Main()is the entry point of a C# program.Console.WriteLine("Hello World");is used for printing output.-
Variables
-
C# Strings
-
String concatenation
collapsed:: true -
String interpolation
collapsed:: true -
Verbatim strings
collapsed:: true -
Member Example
collapsed:: true -
String Members
collapsed:: true
-
-
-
Primitive Data Types
-
User Input
-
Comments
-
Conditionals
-
Arrays
-
Loops
-
Library & Frameworks
- .NET 5+ - Base platform for C# applications.
- System.Linq - Language-Integrated Query (LINQ) for collections.
- System.Threading - Multi-threading and asynchronous programming.
- System.Net.Http - HTTP communication and web requests.
-
GUI Frameworks
- WPF (Windows Presentation Foundation) - Rich desktop applications (Windows only).
- Windows Forms - Simpler framework for Windows desktop applications.
- Blazor - Build interactive web UIs using C# (instead of JavaScript).
-
Data Management
- Entity Framework Core - ORM for database interaction.
- Dapper - Lightweight ORM for SQL databases.
- MongoDB .NET Driver - MongoDB client driver for .NET.
-
Networking
-
Cryptography and Security
- BouncyCastle - Cryptographic APIs for C#.
- IdentityServer - Authentication and authorization framework.
-
JSON and XML Processing
- Newtonsoft.Json (Json.NET) - JSON serialization/deserialization.
- System.Xml - Built-in XML processing in .NET.
-
Logging
-
Testing and Mocking
-
Data Compression
- SharpZipLib - Handles ZIP, GZIP, TAR formats.
- System.IO.Compression - Built-in .NET data compression.
-
Game Development
-
Miscellaneous
- AutoMapper - Object-to-object mapping library.
- FluentValidation - Fluent interface for .NET validation rules.
-
More Learn
-
Explore the following links for valuable resources, communities, and tools to enhance your skills : - id:: 674052a3-8202-4a99-9aa3-1523ecb7801a
-