Welcome to C# Station! This is a community site for people interested in applying .NET using the C# programming language. We’ve been around since July 4th 2000 and have continued to grow over the years. Items of interest include Articles, Books, Links, Documentation, and Tutorials. More…
Who Operates this Site?
This site is previously owned and operated by Joe Mayo, and is now owned by The Eighth Network. You can follow Joe on Twitter, as the creator of the original tutorials, Joe has a blog too. You can also follow Joe on Twitter.
If you would like to see an entire application written in C#, visit LINQ to Twitter, an open source LINQ Provider for the Twitter Micro-Blogging Service.
What is C#?
C# (pronounced “see sharp” or “C Sharp”) is one of many .NET programming languages. It is object-oriented and allows you to build reusable components for a wide variety of application types Microsoft introduced C# on June 26th, 2000 and it became a v1.0 product on Feb 13th 2002.
C# is an evolution of the C and C++ family of languages. However, it borrows features from other programming languages, such as Delphi and Java. If you look at the most basic syntax of both C# and Java, the code looks very similar, but then again, the code looks a lot like C++ too, which is intentional. Developers often ask questions about why C# supports certain features or works in a certain way. The answer is often rooted in it’s C++ heritage. Recent language features, such as Language Integrated Query (LINQ) and Asynchronous Programming (Async) are not necessarily unique to C#, but do add to it’s uniqueness.
How Does a C# Application Run?
An important point is that C# is a “managed” language, meaning that it requires the .NET Common Language Runtime (CLR) to execute. Essentially, as an application that is written in C# executes, the CLR is managing memory, performing garbage collection, handling exceptions, and providing many more services that you, as a developer, don’t have to write code for. The C# compiler produces Intermediate Language (IL) , rather than machine language, and the CLR understands IL. When the CLR sees the IL, it Just-In-Time (JIT) compiles it, method by method, into compiled machine code in memory and executes it. As mentiond previously, the CLR manages the code as it executes.
Because C# requires the CLR, you must have the CLR installed on your system. All new Windows operating systems ship with a version of the CLR and it is available via Windows Update for older systems. The CLR is part of the .NET, so if you see updates for the .NET Framework Runtime, it contains the CLR and .NET Framework Class Library (FCL). It follows that if you copy your C# application to another machine, then that machine must have the CLR installed too.
Does C# Have a Runtime Library?
Instead of a runtime library (such as APIs for file I/O, string handling, etc.) being dedicated to a single language, .NET ships with a .NET Framework Class Library (FCL), which includes literally tens of thousands of reusable objects. Since all .NET languages target the CLR with the same IL, all languages can use the FCL. This shortens the learning curve for any developer moving from one .NET language to another, but also means that Microsoft is able to add many more features because there is only one FCL, rather than a separate implementation for common features in every programming language. Similarly, 3rd party software vendors can write managed code that any .NET developer, regardless of language, can use. In addition to all of the services you would expect of a runtime library, such as collections, file I/O, networking, etc., the FCL includes the APIs for all of the other .NET technologies, such as for desktop and Web development.
What can I do with C#?
C# is only a programming language. However, because C# targets the CLR and has access to the entire FCL, there’s a lot you can do. To get an idea of the possibilities, open the FCL and look at the available technologies. You can write desktop applications with Windows Presentation Foundation (WPF) and Console applications. For the Web, you can write ASP.NET applications. When you need to access data, there is The ADO.NET Entity Framework and LINQ. Some of Microsoft’s newest technologies include Windows Store and Windows Phone. You can also write scalable cloud apps with Windows Azure. Of course, these are only a few of the technologies available and as a general purpose programming language, you can do a lot more than this with C#.
How Do I Get Started?
By visiting this page and reading this far, you’ve already begun. You can continue your journey with the Free C# Tutorial right here at C# Station. The C# Tutorial was created to help beginning developers and other professionals who need a quick on-ramp to the language.