What Can C# Do For You

It was 1999 when C# (pronounced C sharp) was introduced to the world by Microsoft as a new futuristic programming language. I was fortunate enough to be one of the early adopters of the language. I got my hands on C# when it was released as an alpha product. Yes, there used to be alpha releases at that time. It took Microsoft 3 years to get the first stable and usable version of the language. And since then, I have witnessed a newborn turn into a grown up.

“I wrote my first C# article in 1999”

Today, C# is a fully mature and powerful language. As a matter of fact, I wrote my very first article about C# in 1999 using alpha and beta products. My first articles titled Read Microsoft Access Database in C# was published on C# Corner on Jan 01, 2000. In 2001, I started writing my first book, A Programmer's Guide to ADO.NET using C# published by Apress on April 25, 2002. It took me about a year and half to finish the book.

“My first book was published in 2002 on ADO.NET using C#”


Figure 1. My first book

WOW! Time flies. Can't believe it has been 15 years since I started C# programming.

I know that Java, C, and C++ are the most popular programming languages but C# has gained a good ground in the Microsoft world. Some folks ask me what is the future of .NET. I say, Microsoft .NET definitely has a good future going forward. And now that the Azure guru, Satya Nadella is the boss at Microsoft it will definitely help developers. Also don't forget to check out my article Best Programming Languages in 2014.

Anyway, back to the point. 15 years later, I still find that developers and managers do not understand the power of C#. The purpose of this article is to educate developers about the C# language and what it can do for you.

C# Language Evolution

C# (pronounced C sharp) is a modern programming language that was created to build modern software applications for Windows, Web and mobile. C# is a much more powerful programming language than many of us may realize. Not only can you build traditional Windows Client applications and Web applications but you may also use C# to build mobile apps, Windows Store apps, and Enterprise applications. On top of that, C# is cool. Yes, you heard it right. C# is cool. Actually, C# was originally named “C cool” but due to trademark issue, it was renamed to “C sharp”.

The following table summarizes the C# versions with year and features.

VersionYearFeatures
1.01999-2002Modern, Object Oriented, Simple, Flexible, Typesafe, Managed, Garbage Collection, Cross-platform
2.02005Generics, Anonymous Method, Partial Class, Nullable Type
3.02008LINQ, Lamda Expression, Extension Method, Anonymous Type, Var
4.02010Named and Optional Parameters, Dynamic Binding
5.02012Async Programming

Today, C# 5.0 is one of the most modern and powerful programming languages out there.

You may learn more about C# Language features here >. You may also want to download the free C# Language Specification 5-0 book.

C# Ecosystem Software Applications

Now let's get back to our question. What can C# do for you?

Well, the answer is, a lot. I would say, nearly anything. Unless you're writing non-Microsoft platform centric code, C# can pretty much be used to write Windows clients applications, Web applications, Mobile apps, Enterprise software, backend and service-oriented applications.



Figure 2. C# Reach

Figure 3 demonstrates the C# world and applications ecosystem.


Figure 3. C# Applications Ecosystem

As you can see from Figure 3, the C# language can be used to build any and all kinds of applications. Not only Windows or Web applications but C# can be used to build mobile, Windows Store, and Enterprise applications. C# can also be used within the SQL Server database to build reports, jobs and modules to do the backend work.

Windows Client Applications

Windows client applications run on the Windows operating system as executables. Windows applications have been in existence since Microsoft introduced the Windows operating system on Nov 20, 1985. Windows applications development was the initial use of the C# programming language when Microsoft announced it in 1999 to the developer world.

Today, Windows Forms and WPF are two major technologies used to develop Windows client applications. C# can also be used to write non-UI console and WPF Browser based applications. Visual Studio 2013 supports four project templates, including Windows Forms application, WPF application, Console application, and WPF Browser application.

Here are some common properties of Windows applications.

  • Windows applications run on a Microsoft Windows operating system.
  • Windows applications are typically executables (exes) and dynamic link libraries (DLLs).
  • Windows applications run on a PC and take all resources from the local machine.
  • Windows applications have a user interface with Windows controls such as buttons, menus, dialogs and forms/windows.

Examples of Windows Applications:

  • Microsoft Office (Word, PowerPoint, Excel and so on)
  • Internet Explorer
  • Skype
  • Visual Studio 2012
  • Photoshop
  • SQL Server 2012
  • Paintbrush

The following are some good links to learn these technologies:

Components and Controls

Components and controls are libraries used to build something that is easily sharable and distributable. C# is one of the most commonly used languages to build components and controls in the Microsoft world. A chart control is a perfect example of a sharable control. A GPS library is a perfect example of a library that can be built by a developer and easily distributed to other developers to be used in their applications.

Visual Studio 2013 supports five project templates, including Class Library, Portable Class Library, WPF Custom Control Library, WPF User Control Library, and Windows Forms Control Library.

The following are some good links to learn these technologies:

Web Applications

ASP.NET was released on Jan 05, 2002. Since then, ASP.NET has become one of the most popular technologies to build web applications. ASP.NET can be combined with HTML, JavaScript and other libraries and APIs to build modern web applications.

Visual Studio 2013 supports the three major ASP.NET project templates, ASP.NET web applications, ASP.NET MVC web applications, and ASP.NET server controls.

The following are some common properties of Web applications:

  • Web applications run on a Web Server.
  • Web applications are typically hosted within an ASP.NET or HTML page.
  • Windows applications run on the server as well as in the client browser, depending on how the code is written. If C# is used as backend coding, the C# code runs on the server and the front end HTML runs within the client browser.
  • Web applications have a user interface with Windows controls such as buttons, text boxes, text and styles.
  • Web applications usually have a URL, public or private.
  • Web applications are accessed by users from outside of the physical premises of the application via a remote Internet connection and a browser.

The following are examples of Web sites:

  • msdn.com
  • facebook.com
  • c-sharpcorner.com

ASP.NET MVC is one of the newest frameworks to build ASP.NET Web applications. The following are some good links to learn more about ASP.NET Programming:

Windows and Web Services

Windows Services has been around since early Windows days. A Windows Service (also known as Microsoft Windows Service or Windows NT Service) is an executable application that runs on Windows operating systems. A service usually does not have a user interface, performs operations in the background and does not require any user interaction. Visual Studio comes with a Windows Service project template that is used to create a Windows Service using C# and VB.NET.

Web Services were introduced to provide remote communication among devices over the Internet. The main purpose of a Web Service is to provide data accessibility and updatability remotely using the internet protocols regardless of the platform, Operating System, client browser, and application. Physically, a web service is a software application running on a Web Server that can be called by outside applications using the internet to access and write data.

In the Microsoft world, the web services are developed using ASP.NET and hence called the ASP.NET Web Services. While the exposure and connectivity of a Web Service uses ASP.NET, the backend can be built using the C# language. Windows Communication Foundation (WCF) and the Web API are the latest technologies developed by Microsoft to provide remote communication.

Let's understand this using an example and what can be better than using our own C# Corner platform architecture shown in Figure 4.


Figure 4. C# Corner System Architecture

In Figure 4, we have a database server that runs services to do the backend tasks such as calculating points, sending emails, analytics and so on. Some of these backend services run as tasks on SQL Server and some are Windows services.

The Web Service sits on the Web Server and talk to the database server and act as a gateway of data access and manipulation from the clients. Clients are users accessing C# Corner from their web browsers, iOS apps, and other apps.

This gives you an idea of how Windows and Web Services fit in the entire C# universe.

WCF and the Web API are two of the newest technologies in the Web Services space. Here are some good links to learn more about Windows and Web Services.

Windows Store Apps

Windows Store apps were introduced in the Windows 8 operating system. Windows Store apps are a new type of application that was never developed before. You can think of a Windows Store app as an app that runs on an iPhone or Android device and has features like Touch, messages, tiles, and swipe.


Figure 5.

There are two tracks to develop Windows Store apps. First, use C# and XAML and second, use HTML 5 and JavaScript. C# and XAML are the primary languages to build Windows Store apps. XAML is used to build app screens and C# is used as the language that runs in the backend.

The following are two good links to learn more about Windows Store apps and the XAML language:

Mobile Apps

Mobile apps run on mobile devices. The Apple iOS and Google Android are two major players in the mobile app market. Microsoft has its own Mobile operating system, Windows Phone. Obviously, C# as a language is used to build Windows Phone apps.

You may learn more about Windows Phone apps in the Windows Phone section of C# Corner.

But it does not mean you can't use the C# language to build iOS and Android apps. Xamarin has focused on building tools for C# developers that allow developers to build native apps for iOS and Android. Xamarin Studio works with Visual Studio to write code in C# and compiles come to native iOS and Android distributable.

Cloud and Azure

Visual Studio 2013 with C# provides a complete suite of tools to build cloud based applications for Windows Azure. Windows Azure is Microsoft's operating system for cloud computing and hosting. Using Visual Studio, not only you can build Azure solutions but can also deploy and manage them. C# can also be used to work with SQL Azure, the cloud based version of Microsoft's SQL Server database server.

You may want to check out the following link to learn more about the Cloud and Azure:

Enterprise Cross-Applications Development

So far, we have learned that we can build Windows, Web, Mobile, Services and Components using the C# language but the capabilities of C# does not end here. The C# language may also be used cross-applications to connect and build enterprise solutions.

Some of the critical requirements of an enterprise architecture are connectivity with various types of applications to transfer data. For example, in one of my projects, I had to access data from a SQL Server database, a SharePoint database and store some in MSMQ. There was also data to be transfered from SharePoint Portal Server that was accessed by Office Excel documents and an ASP.NET Website. There was also a reporting component using Crystal Reports and CRM that stored a customer database.

All the preceding can be done using the C# language. I built some adapters and used some existing .NET adapters and built the system using app pure .NET and C#.

The following are some of the products and tools that could be used in an enterprise environment:

  • App for Office 2013
  • App for SharePoint 2013
  • Cloud Business App
  • Add-ins for Office 2013 including Excel 2013, InfoPath 2013, PowerPoint 2013, Project 2013, Visio 2013, Word 2013.
  • SharePoint development includes SharePoint 2013 Silverlight Web Part, SharePoint 2013 Visual Web Parts, and SharePoint 2013 Reusable Workflow.
  • SharePoint, SQL Server, Office
  • SQL Server database
  • XML
  • Flat data
  • Object data

The following are some useful links related to these topics:

Summary

The C# language has come a long way since it was introduced in 1999. If you have enough experience, you can build nearly any kind of application using C# and related tools.

In this article, I discussed the power and flexibility of C# and its usefulness. There is not much out that can't be built using C# and its related technologies in the Microsoft world. If you are a Microsoft developer, you may already know that you can't live without C#.

I hope you enjoyed it. I look forward to see your feedback.

Up Next
    Ebook Download
    View all
    Learn
    View all