Please create an account to participate in the Slashdot moderation system

 



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:
  • by nathan.fulton ( 1160807 ) on Monday July 07, 2008 @02:32PM (#24087063) Journal
    This book happens to be in our club's collection. Someone gave it to us, I think I found it redundant, and times. but then, most language-centered programming books are, to a certain extent. The first person in our group who read it went through and hi-lighted the page numbers with redundant material on them in blue, and hi-lighted the important pages in yellow. We were able to learn the language's syntax and nuances without reading through long-winded explanations about core concepts in OO or reviews of concepts just covered that way. Generally, I've always found the "language bible" books more helpful than these types of books. Does anyone share my sentiment?
  • Great Series (Score:3, Interesting)

    by Flyin Fungi ( 888671 ) on Monday July 07, 2008 @02:33PM (#24087073)
    I always loved this series of books. My professor recommended this book to me and it has helped me understand the language much better then any other book. It's interesting, funny, and insightful! A very different take on presenting material then other programing books. As a college student I have a hard time reading through dull school text books. Sometimes I don't even have to open or own a text book in order to get through the class. Although you don't need to buy a book anymore to learn a language with the huge resources the internet has to offer.
  • by Anonymous Coward on Monday July 07, 2008 @02:36PM (#24087099)

    As an experienced programmer looking for a friendly intro to C#, I have enjoyed it, but I would have to concur that O'Reilly's C# in a Nutshell will be my day in day out reference. But, I am glad that O'Reilly is coming out with these user friendly references that make new concepts/languages more entertaining and fun. Head First Design Patterns is another one that some may fine easier to handle than the traditional Gang of Four book.

  • by Shados ( 741919 ) on Monday July 07, 2008 @02:38PM (#24087135)

    I agree, but at the same time, you have to be careful. Different languages have different takes at things someone may think as "obvious". A while ago I went to an interview for a .NET dev job, and the people interviewing me were very obviously all former C++ programmers recycled in C#. One of the questions they asked me was: "How do you do multiple inheritance in C#".

    My answer was the obvious: "There isn't any, you can only inherit from one class". They started arguing with me about how it WAS possible, and actually common, to do multiple inheritance in C#. After a bit of discussion, I realised that they were still thinking in C++ term, where an interface is nothing more than a fully abstract class, so even if you only use "interfaces", you ARE doing multiple inheritance (while in C#, there are -core- differences between a fully abstract class and an interface). They had skipped that part of the book thinking they didn't need it :)

  • by azadder ( 1118711 ) on Monday July 07, 2008 @02:47PM (#24087249)

    I never really understood the Head First series

    I definitely agree. My first encounter with this series was while looking for a nice C# primer at a local B&N's. I browsed through some of the Head First series and found it difficult to read/follow. I am sure these types of books are for someone, but they definitely did not give me as straightforward approach as I would have wanted.

  • by kestasjk ( 933987 ) on Monday July 07, 2008 @02:58PM (#24087409) Homepage
    Apress' take on C# is much more .NET oriented, and much longer and more thorough for only slightly more money..

    How did I not notice that?
  • by alan_dershowitz ( 586542 ) on Monday July 07, 2008 @03:03PM (#24087473)

    I work with people who don't even proceduralize their code. I've got a report with a 500-line SQL statement in it.

  • Another recipe book (Score:4, Interesting)

    by Animats ( 122034 ) on Monday July 07, 2008 @03:12PM (#24087593) Homepage

    These 700+ page books on programming languages have too much bloat. Usually because they're full of recipes, plus a rehash of introductory programming material.

    A really well written 50 page book on C# would be more useful. Especially if it came with a little summary card with the syntax. Code examples should be on an associated web site.

    Of course, it's a Microsoft product, so it has "strategic complexity", not minimalism.

  • by east coast ( 590680 ) on Monday July 07, 2008 @03:56PM (#24088177)
    Dijkstra used to say that BASIC mutilated programmers' minds. But today, I think that C++ and VB have taken that role.

    I would agree with this but only with a bit of qualification. I think that old BASIC programmers still teaching novice programmers OOPLs have done a great deal of damage by bringing their old design concepts into a very different arena of coding. Once you have more and more of the 20+ year OOP coders out there teaching the masses and give those students time to mature will we know if things are getting better. There's an unavoidable and unfortunate gap between when the basis of coding are set in the novice coders mind and the time when we really get to see how well it has manifested itself in the practice of a matured programmer.
  • by 0xABADC0DA ( 867955 ) on Monday July 07, 2008 @04:58PM (#24089361)

    MS don't deserve *too* much credit for this, since (unlike Sun) they were able to benefit from five or six years of someone else's experience when creating their language, but with the ability to start with a clean slate and no backwards-compatibility baggage.

    ... were able to, but didn't. The difference between C# vs Java was like C++ vs C. C++ and C# basically just add a lot of syntactix mumbo-jumbo onto a plain, reliable, usable language.

    Mandatory generics, iterator yield, implicitly typed variables, 'object initializers', extension methods, embedding C++ and SQL directly into the code, operator overloading, implicit conversions, conditional compilation, etc -- none of those C# features actually helps you write better programs, and a lot of the so-called improvements in C# just make it a complicated mess.

    The main problem in C++ and C# is that just looking at a statement you can never be sure what it does without poking around a lot of places (in Java a statement always says exactly what it does). A simple statement like "x.y = a[b]" can involve at least 6 different method calls. In Java is always means assign array element to a field.

    Like C++, there are some people who will claim more features are better no matter how much more complicated (and generally the 'never enough features' crowd lives in Redmond). But at the rate C# is gaining kitchen sinks I think it will only be a few years until people switch back to Java because it doesn't have all that baggage.

  • by Anonymous Coward on Monday July 07, 2008 @05:12PM (#24089607)

    The problem with using free examples on the web for C# is that it's a bit like PHP. It's used for web scripting, but usually by people with whom best practices are optional. (If they even know what those are.)

    Now, that's not to say that C# is incapable of being used for good rather than evil. I'm just saying that the majority of developers that post examples in C# use bad examples or hack code they threw together because they didn't know there was already a built-in function to do something. Heck, even MSDN has bad examples (and recently, disclaimers to match).

    Consider this a "caveat programmor".

Software production is assumed to be a line function, but it is run like a staff function. -- Paul Licker

Working...