Head First C#
This project contains all of the code from "Head First C#", the popular book for learning C# by Andrew Stellman and Jennifer Greene (O'Reilly, 2013).
How to use this code
This project contains source code for all of the exercises and puzzles in Head First C#
. We published it here to make it as easy as possible for our readers to read and download.
It also contains
graphics for chapters and labs
code for the WPF Guide PDF
code for the second edition
Click the Source Code tab
to view the source code. You can also use these links to jump straight to the code for different editions or book updates:
We did not give solutions to the first two labs
because there are too many possible ways to solve them. However, if you search CodePlex or other social code sharing sites, you'll find solutions that other readers have published.
We published the solution to Lab #3 to the Windows Store as an open source project, so you can download the source for that program from the
Invaders CodePlex project
. However, if you
want these C# concepts to stick in your brain, we strongly encourage you to try to build this yourself without looking at our solution.
Remember, the best way for you to learn to code is to work through the exercises on your own as much as possible. However, looking at the solutions is
. Your brain doesn't learn well if you're frustrated, and sometimes you just need to see an answer.
Also, keep in mind that there's more than one way to write any program. That's especially true for the projects in the later chapters, because as the project gets bigger the number of ways to build it grows exponentially. If your code works and solves
the problem, then you finished the exercise -- even if it doesn't match our solution.
About Head First C#
Head First C#
is a complete learning experience for programming with C#, XAML, the .NET Framework, and Visual Studio. Built for your brain, this book keeps you engaged from the first chapter, where you’ll build a fully functional video game. After that,
you’ll learn about classes and object-oriented programming, draw graphics and animation, query your data with LINQ, and serialize it to files. And you’ll do it all by building games, solving puzzles, and doing hands-on projects. By the time you’re done you’ll
be a solid C# programmer, and you’ll have a great time along the way!