Summary

  • C# was initially created specifically for use with the .NET platform.

  • C# is used with the .NET Framework, which allows you access to a number of libraries that are specifically intended for use with Windows.

  • The Common Language Runtime (CLR) is the component of the .NET Framework that allows you to compile and execute applications written in either C# or Visual Basic .NET.

  • C# is designed to be simple, type-safe, object-oriented, and high-performance.

  • C# applications consist of human-readable source code, written in a text editor. The source code is compiled into Microsoft Intermediate Language (MSIL) which, at runtime, is compiled into machine code.

  • A namespace is a way of grouping the names that you assign to elements in your application so that they don’t conflict with other names, either yours or those assigned by Microsoft or other developers.

  • Classes are the core building blocks of C# and object-oriented programming because they allow you to create new types that model types in the “problem domain”—that is, that model things in the area you are concerned with.

  • A method is a named block of code that performs an action and that may return a value.

  • A comment is a note for the programmer and does not affect the running of the application.

  • A string is a set of text characters enclosed in quotes.

  • You can use C# to develop console applications, Windows applications, web applications, and web services.

This chapter wasn’t that long and yet you’ve come a very long way. You got a crash-course introduction to the C# language, and you saw a little of what went into creating it and what goes on underneath. Most important, though, you wrote, compiled, and ran a real working application. You can already call yourself a C# programmer. Granted, creating an application with Notepad and the command-line compiler is a bit painful, and there’s no reason why you should be fumbling around with a unicycle when you’ve got a fully loaded Ferrari just waiting for you to slip behind the wheel. So, we’re going to take just a quick break in the next chapter to show you around the Visual Studio IDE, and then we’ll come right back to the fundamentals of the language.

Get Learning C# 3.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.