Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming

Head First C# 243

Michael J. Ross writes "For computer programmers who do not have a solid understanding of object-oriented programming (OOP), learning the C# programming language can be rather challenging, even if they have experience with C or C++, which at least would give them a head start over non-C programmers. Any developer in this situation may well want to begin the learning process with a book that aims to teach both OOP and C# in as gentle a manner as possible, with plenty of patient explanations and illustrative diagrams — such as those found in the book Head First C# by Andrew Stellman and Jennifer Greene." Read below for the rest of Michael's review.
Head First C#
author Andrew Stellman and Jennifer Greene
pages 778
publisher O'Reilly Media
rating 7/10
reviewer Michael J. Ross with Greg Hanson
ISBN 0596514824
summary A heavily illustrated intro to object-oriented programming and C#
Published by O'Reilly Media on 26 November 2007, under the ISBNs 0596514824 and 978-0596514822, Head First C# is one in a series of "Brain-Friendly Guides." The introduction to this particular book discusses how the series attempts to present the concepts and technical material in a way that is far more intellectually compelling and memorable than the approach currently taken by most books. Some of their guiding principles include: making things visual, oftentimes using novel and even outlandish diagrams; using a casual and conversational style; engaging the reader through exercises and questions; and spicing up the discussions with humor.

On the book's Web page, readers will find links to download the book's sample code, participate in a forum dedicated to the book, register their copy of the book, read and submit any errata (of which there are many), and submit a reader review and read those of other readers.

The book's material is organized into 15 chapters, covering the topics in a progressive order that would probably be most helpful for the inexperienced developer: the advantages to programming visual applications in C# and the Microsoft Visual Studio integrated development environment (IDE); building a simple application to get started; the C# code produced by Visual Studio; basic C# language constructs; an introduction to objects and their components; data types, including arrays and references, and how C# allows you to work with them; protecting an object's data from unintended access, through encapsulation; extending classes through inheritance and subclasses; finding and using class interfaces, and the advantages of doing so; storing data in arrays, lists, and dictionaries; saving data in files and directories, as well as working with file streams and serialization; exceptions and debugging techniques; event handling; how to build complex applications; creating user interfaces with controls and graphics; object destruction and garbage collection; and connecting your C# programs to databases using LINQ. Interspersed throughout the book are three C# labs, which encourage the reader to put into practice their new programming skills, and thus better internalize the ideas of OOP and C# covered in the chapters preceding each lab. The lab applications comprise a racetrack simulator, a simple adventure game, and a re-creation of Space Invaders.

When they see this book for the first time, some prospective readers may be overwhelmed by its size, clocking in at 778 pages. Yet a sizable portion of those pages will read faster than those of the typical programming book, largely due to all of the diagrams and whitespace, which really help to break up the material and make it more digestible. However, what many might perceive to be a strength of the book, could be seen as a weakness by others. In fact, if the unnecessary diagrams and redundant material were to be removed from the book, it might end up only half its current size. But this may only be a deterrent for people who are carrying this book around, or who tend to be impatient and wish to get right to the point of any book they are reading, or who may be upset by the extra trees chopped down to double the number of pages (the book does not appear to have been printed on recycled paper).

Despite Head First C# being clearly intended as an introductory book to object-oriented programming in general, and C# in particular, the target audience especially may be frustrated by all of the errata and other sources of confusion that they will encounter. This is especially true when readers are doing their best to implement all of the sample applications, and struggling when, for instance, the code does not match the figure provided, or even the code on another page. For example, on page 50, the authors instruct the reader to drag a new PictureBox onto a new form, but readers will probably struggle to figure out where to drag it from. On page 105, the authors instruct the reader to flip back and look through the code, to fill in some class diagrams, but they don't clarify what code should be considered. Readers' comments on the online bookseller sites, list far more similar problems. In fact, that there are so many technical errors in this book is quite remarkable given that the technical review team comprised no fewer than 14 individuals! How could so many eyeballs miss so much?

The authors make a real point of reviewing material explained earlier, which generally is an effective approach for this type of book. But the repetition sometimes becomes excessive — enough to annoy even the greenest novice. For example, on page 445, we find the question: "Okay, I still don't get it. Sorry. Why are there so many different kinds of exceptions, again?"

On the other hand, the book has some real strengths, including those mentioned above for making the material more approachable. In particular, when the reader becomes accustomed to the visual style of presenting concepts, he or she will probably find it a faster approach to learning the ideas. Admittedly, veteran developers may still prefer the more narrative style of conventional programming books — especially when they encounter rather convoluted diagrams, such as that on page 292. Yet the illustrations are particularly potent for explaining interfaces, as done in Chapter 7.

Although the book will be of most value to newer programmers, experienced C# programmers will find topics of interest and perhaps even some language details and analysis that they have never previously encountered. For instance, some of the questions posed in the sections titled "there are no Dumb Questions," could be valuable — such as the comparison of File versus FileInfo, and when to use one over the other. Also, some of the utilities could help the reader for future development, such as the hex dumper program on page 432.

Sadly, Head First C# is weighed down by excessive redundancy and an errata-to-number-of-technical-reviewers ratio possibly unequaled by any other programming book. Yet, for any programmer new to object orientation and C#, this introductory book should prove an extremely comprehensible and reader-friendly resource.

Michael J. Ross is a Web developer, writer, and freelance editor. Contributor Greg Hanson is a C# programmer in Fort Collins, Colorado.

You can purchase Head First C# from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Head First C#

Comments Filter:
  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Monday July 07, 2008 @02:30PM (#24087023)
    Comment removed based on user account deletion
  • by dealmaster00 ( 904299 ) on Monday July 07, 2008 @02:34PM (#24087083)
    A few years ago, when I was relatively new to programming, I read Head First Java and that really helped me understand the Java language and OOP in Java. Even if you aren't a beginner, the Head First books are still pretty decent, but make sure you have patience because most of the explanations/examples are "dumbed down" for the beginner. Also the harder stuff tends to be at the end of the book, so you can hold out for that.
  • by kalirion ( 728907 ) on Monday July 07, 2008 @02:37PM (#24087119)

    Did you read the intro? I have a couple Head First books (preps for Sun's EJB and Servlet exams) and I believe in the intro it states that the book uses repetition of important concepts to make them "sink in".

  • by Saint Stephen ( 19450 ) on Monday July 07, 2008 @02:55PM (#24087357) Homepage Journal

    Anonymous delegates came out in C# 2.0 (I think), and now we have lambda expressions. Umpteen ways to do delegates, and hardly anybody I know uses them and gets confused as heck when they see code I write that uses them. It's because F10 through the debugger "looks wierd" when you use them and people aren't used to seeing functions inside functions :-)

    There's lots of stuff in C# that people never use.

  • by plasticsquirrel ( 637166 ) on Monday July 07, 2008 @03:02PM (#24087469)

    Yet, for any programmer new to object orientation...

    How many can there be left these days?!? It's too easy to accumulate enough material for a good-sized book by starting from scratch and assuming the reader only knows how to read. Anyone could write a beginner's book on a computer language, without knowing the language too in depth, by just padding it with lots of remedial review material, that 99% of the readers don't need and don't want (to wade thru or pay for).

    From what I have seen, there are many programmers who do not use OO languages. But what is disturbing is the number of programmers who do use OOP to some extent, but don't use it without even understanding its basic concepts.

    Dijkstra used to say that BASIC mutilated programmers' minds. But today, I think that C++ and VB have taken that role.

  • Nothing really (Score:4, Informative)

    by Toreo asesino ( 951231 ) on Monday July 07, 2008 @05:02PM (#24089451) Journal

    It's very windows orientated, but that's about all I find wrong with it. Not a problem if you're never leaving Windows land - I find it an excellent language. If you are going outside of Windows, pick a more suitable tool for the job or use mono.

  • by Westley ( 99238 ) on Monday July 07, 2008 @06:05PM (#24090417) Homepage

    Um, the features listed by my post's parent.

    I don't have time to describe them all in detail here (or, more importantly, how they can improve readability of code) but here are a couple of URLs which give a bit more information:

    http://csharpindepth.com/Articles/General/BluffersGuide2.aspx [csharpindepth.com]
    http://csharpindepth.com/Articles/General/BluffersGuide3.aspx [csharpindepth.com]

    Shameless plug: for a lot more detail, read C# in Depth... (there are sample chapters available at http://manning.com/skeet [manning.com])

  • by bill_kress ( 99356 ) on Monday July 07, 2008 @06:23PM (#24090729)

    Please don't start with C++. It is terribly hard to actually get any good understanding of OO concepts in C++. I'd recommend Java, C# if you must.

    I'm not saying to make your career in that language or anything, but to figure out OO--get a language that gets out of your way and lets you see what you are doing. It should have almost no "Syntax" to worry about in itself.

    C++ is the opposite. And I've yet to see actual OO C++ code.

    Also, GUI programming in C++ (even if you ignore OO) is horrific. It's error prone and completely unnecessary. If you are really really stuck on being as close to the Windows GUI as possible, use C#, otherwise maybe Java.

    Sorry, but C++ was the last language created with a legacy where creating the compiler was so hard that you had to adapt the language towards compiler creation/optimization. Many of the features in C++ are simply there so that compilers are easy to write (or are there for legacy to be compatible with compilers made for that reason). A modern compiler/runtime is able to do all the stuff C++ could, and more--and in many cases faster.

    On the other hand, if you really want to understand computers and how a programming language works--if you want at the nuts and bolts--go to C, forgo C++ altogether.

  • by JebusIsLord ( 566856 ) on Monday July 07, 2008 @07:50PM (#24091951)

    Well, if you're afraid of object orientation, there isn't much we can do for you, nor are you the target audience, but you really should try to modern-up your skillset if you code for a living. Once I "got it" i found I didn't want to go back to procedural coding at all.

    Secondly, while there are times when points might be nice, the tradeoff (basically, you lose all the safety that a VM gives you) is unacceptable. In C#, you can do method pointers using delegates or reflection (another scary OO concept), and use pinned memory and marshalling for reading data into structs, without sacrificing safety. That covers 95% of what you'd want to do with pointers (The other 5% would be arrays of pointers, simply because an array of delegates would just be too slow in many such situations).

Old programmers never die, they just hit account block limit.

Working...