C#

The Bonus Site for C# For Dummies
csharp102.info

Keep in mind that most of the material on this site is for the 2008 edition of the book. However, nearly all of the materials here are just as applicable in the C# 2010 book and C# 4.0. For more information about the 2010 edition, see below.

UPDATE 7.17.10: C# 2010 All-in-One For Dummies now available. Click here.

Welcome

If my book, C# 2008 For Dummies (now updated and improved by C# 2010 All-in-One For Dummies), is "C# 101," then this site is "C# 102." This site C# 2010 For Dummies Book Coveris dedicated to supporting either edition of the book by providing lots of extras.

The 2010 edition updates the 2008 edition, just as that book updated the previous edition (2005) --
but more than that, it's heavily revised to add more C# info for you! What's really hot in this edition? See the section What's Hot in the New C# 4.0? below.

(Note about page display. See bottom of page.*)

Note, though, that I didn't do the 2010 update. Bill Sempf, author of Visual Basic For Dummies. My thanks to Bill for doing an impressive update to this very good book. And thanks also to Stephen Randy Davis, the original author, who wrote the excellent first edition, C# For Dummies.

For Beginners | For Experienced Programmers

What's on the site

I'll be adding new content gradually as I get it developed over the next few months. Note that this site contains extra materials, but you can also go to www.dummies.com to find information about lots of other For Dummies programming books. And you can visit Go to Top

For beginners

This section is for those new to C#, or even new to programming.

C# is a programming language -- a specialized "language" for writing programs, sets of instructions for the computer to carry out. C# has been around now for some eight years, a part of Microsoft's .NET initiative. .NET amounts to the current way to program for Windows. C# is based on earlier languages, including Java, C, and C++. C# programs consist of objects that communicate with each other, supplying services to each other.

 

An example

Programs contain a structured sequence of statements; each statement stores data in a variable, or makes a decision, or manipulates some data. An object-oriented program (OOP) packages bits of data into objects, such as a Student object in a school management program. Objects also know how to operate on their own data. For example, a Student object might call upon an input/output object to write its information into a permanent disk file.

To illustrate, a program representing a game of tic tac toe might consist of a Game object to manage the players and their turn-taking, a Board object to store information about where the Xs and Os have been placed, and so on.

Some C# codeEvery program starts off in a Main method, so for the tic tac toe game, Main might create a Game object and call its Play method, which would wait for the first (human) player to mark an X in a square, then record that X in the Board object and see if that might have been a winning move. Then Play would wait for the O player, and so on, back and forth in a loop until one player wins -- or the Board fills up without either player having won.

Go to Top

For experienced coders coming to C#

This section is for those with programming experience, maybe even previous C# experience, who want to learn C# or find out what's new in the latest version. If you're new to C#, this book's for you. If you already know some C#, see especially Chapters 15, 16, and 17 in the 2008 edition and take a look at the "What's Hot" section below.

What's hot in the new C# 4.0?

Well, in the 2008 edition (for C# 3.0), you got new features like Language Integrated Query (LINQ), a new collection class for working with sets, a new var keyword you can use to have the compiler infer a variable's type by the expression you initiate the variable with, lots of collection class and array simplifications, and new "extension methods" that let you add your own methods to closed classes such as class String or class Object.

And in the new 2010 edition (for C# 4.0), you get dynamic objects and the new dynamic keyword, which greatly simplifies reflection, COM interop, and coding to Microsoft Office object models. You also get named and optional method parameters. And you get improvements in the covariance/contravariance of generic items. Check out this new edition to get the details.

Go to Top

*Page Display Note: If you get browser messages about blocking scripts or ActiveX controls from running on the page, please know that these pages contain no harmful code.

Go to Top