C Sharp Programming
From Wikibooks, the open-content textbooks collection
Cover | Introduction | Basics | Classes | The .NET Framework | Advanced Topics | Index
C# (pronounced "See Sharp") is a multi-purpose computer programming language suitable for all development needs. This WikiBook introduces C# language fundamentals and covers a variety of the base class libraries (BCL) provided by the Microsoft .NET Framework.
[edit] Introduction
- Main introduction: C Sharp Programming/Foreword
Although C# is derived from the C programming language, it has features such as garbage collection that allow beginners to become proficient in C# more quickly than in C or C++. Similar to Java, it is object-oriented, comes with an extensive class library, and supports exception handling, multiple types of polymorphism, and separation of interfaces from implementations. Those features, combined with its powerful development tools, multi-platform support, and generics, make C# a good choice for many types of software development projects: rapid application development projects, projects implemented by individuals or large or small teams, Internet applications, and projects with strict reliability requirements. Testing frameworks such as NUnit make C# amenable to test-driven development and thus a good language for use with Extreme Programming (XP). Its strong typing helps to prevent many programming errors that are common in weakly typed languages.
- Foreword
- A description of the C# language and introduction to this Wikibook.
- Getting started with C#
- A simple C# program and where to get tools to compile it.
[edit] Language Basics
- Naming conventions
- Quickly describes the generally accepted naming conventions for C#.
- Basic syntax
- Describes the basics in how the applications you write will be interpreted.
- Variables
- The entities used to store data of various shapes.
- Operators
- Summarizes the operators, such as the '+' in addition, available in C#.
- Data structures
- Enumerations, structs, and more.
- Control statements
- Loops, conditions, and more. How the program flow is controlled.
- Exceptions
- Responding to errors that can occur.
[edit] Classes
- Namespaces
- Giving your code its own space to live in.
- Classes
- The blueprints of objects that describes how they should work.
- Objects
- Cornerstones of any object-oriented programming language, objects are the tools you use to perform work.
- Encapsulation and accessor levels
- Explains protection of object states by encapsulation.
[edit] The .NET Framework
- .NET Framework Overview
- An overview of the .NET class library used in C#.
- Console Programming
- Input and Output using the console.
- Windows Forms
- GUI Programming with Windows Forms.
[edit] Advanced Object-Orientation Concepts
- Inheritance
- Re-using existing code to improve or specialise the functionality of an object.
- Interfaces
- Define a template, in which to base sub-classes from.
- Delegates and Events
- Be informed about when an event happens and choose what method to call when it happens with delegates.
- Abstract classes
- Build partially implemented classes.
- Partial classes
- Split a class over several files to allow multiple users to develop, but also to stop code generators interfering with source code.
- Collections
- Effectively manage (add, remove, find, iterate, etc.) large sets of data.
- Generics
- Allow commonly used collections and classes to appear to have specialisation for your custom class.
- Object Lifetime
- Learn about the lifetime of objects, where they are allocated and learn about garbage collection.
- Design Patterns
- Learn commonly used design methodologies to simplify and/or improve your development framework.
[edit] Keywords
| C# Keywords | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Special C# Identifiers | ||||||||||
|
[edit] External links
- Learning Visual C# in 5 minutes A simple tutorial that teaches you a few basics.
- A C# Tutorial starts from basics and gives source code.
- An Introduction to Mono Development by Andrew Troelsen
- Sharp Develop IDE : A free IDE for C#, VB.NET and Boo projects on Microsoft's .NET platform.
- Microsoft Visual C# Express Edition : A free development environment created by Microsoft for writing C# Applications.
- Mono Project : A C# Development Environment for Linux, Windows, and other platforms.
- Mono IDE : An GNOME based IDE for Mono on Linux platforms.
- C# Online.NET - free, wiki-based C# and .NET encyclopedia and forums
- C# Language Specification download page at ECMA
- C# Environment setup Visual C# environment setup details from MSDN
- C# FAQ C# FAQ, Blogs and Forums.
- Premium C# Tutorial - A collection of complete programming tutorials
- DotGNU Portable.NET - A CLI/.NET built in accordance with the requirements of the GNU Project capable of running C# programs on many platforms and architectures.
- .NET Book Zero by Charles Petzold - free downloadable book on C# and .NET framework by one of the world's foremost authorities on Windows programming, Charles Petzold.

