C# Introduction

October7, 2017
by admin

C# (pronounced a c sharp) is an object oriented programming language by Microsoft. It is one of the languages of .Net. If you are new to .Net then let’s first have an introduction of .Net.

What is .Net?

.NET is a software development framework developed by Microsoft that offers a wide range of tools and libraries for building diverse applications. It serves as a programming model, providing developers with a standardized set of resources and services to facilitate application development.

Developed with multiple programming languages in mind, such as C#, Visual Basic .NET (VB.NET), and F#, .NET enables developers to create applications for desktop, web, mobile, and other platforms. Its core components include the Common Language Runtime (CLR), which acts as a runtime environment for executing .NET applications. The CLR handles tasks like memory management, exception handling, and security.

A significant feature of .NET is the extensive class library, also known as the Base Class Library (BCL). This library contains a vast collection of pre-built classes and functions that developers can utilize for various purposes, including file I/O, networking, database access, and user interface development.

Furthermore, .NET emphasizes language interoperability, allowing developers to write code in different languages that can seamlessly work together within the framework. This enables the combination of components written in different languages to form a cohesive application.

Microsoft’s integrated development environment (IDE), Visual Studio, is the primary tool for .NET application development. Visual Studio provides a comprehensive set of features for coding, debugging, testing, and deploying .NET applications.

Additionally, .NET includes ASP.NET, a framework specifically designed for web application development. ASP.NET empowers developers with server-side controls, model-view-controller (MVC) pattern support, and integration capabilities with databases and web services.

With the introduction of .NET Core, an open-source and cross-platform implementation, developers can now build applications that run on Windows, macOS, and Linux operating systems.

In conclusion, .NET simplifies application development by offering a robust framework, supporting multiple programming languages, providing a rich class library, and enabling cross-platform development.

C#

We are going to learn C# language, a popular .Net language in this course.

Those who are familiar> with C and C++ they will find C# language much similar and familiar. So for them learning C# will not take much time as any other new language. For those who are new to C# will also be able to learn it with little extra effort since the syntax of C# is quite simple and avoids any complexity. You will come to know as we go through each concept of C# fundamentals.

Since C# is an object oriented programming language, it support features of OOPs such as encapsulation, inheritance, polymorphism etc.

This course is not about the complete reference of object oriented programming. But its aim is to learn C# fundamentals so that a programmer can have a strong base of C# language upon which he or she can learn more advanced concepts with ease.

Why C# over VB?

C# and VB are two major .net languages. Those who are familiar with VB6 programming, they will find VB.net language more familiar and comfortable to work with. Those who are familiar with C++, they will find C# syntax much similar and comfortable to work with. If you ask me why to choose C#, my answer will be as C# has much simpler syntax than VB. I have personally done coding in both the languages and also in VB6 and C++. I have found that since C++ or C# have much simpler syntax, it’s a great experience to work with them. That’s why I choose C#. But still if you want to choose VB then its fine. Whatever concept you will learn in this course with C# language, will also be helpful when coding with VB language. The concept will be same. Only syntax and some keywords are different. That’s it.

What type of applications can I create with c#?

Using C# you can create windows applications, web applications, web sites, xml web services and many other types of applications.

Environmental setup:

Before leaning C# we need to install the tools and set up the environment.

The first thing you should always keep in mind is that any .net language works within the environment of .Net framework. So you need to install it on your windows pc.

Visual studio is the IDE(Integrated Development Environment) for .Net. If you are installing visual studio, then you don’t have to worry about the installation of .Net framework. When you install visual studio, it will install .net framework as a part of the installation. Visual studio has many versions and editions. Every version of visual studio has one free edition that is for learning purposes. Formerly it was in the form of express edition. Currently it is in the form of community edition. It is free to download from Microsoft site. While downloading express edition, you can download only one language such as C#. Though it lacks advanced features that comes with visual studio, still it is the best tool for the learning purpose.

To download visual studio express edition, click https://www.visualstudio.com/vs/visual-studio-express/.

After downloading, you can install it on your pc and you are ready to go.

After basic installation of .net you can open visual studio and start coding with your choice of application. All the examples in this course are based on a console application template. It is a quite easy way to learn the basics of any .Net language.

Let’s start by creating our first application in C# language.

 

C# Fundamentals