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 Bill Dog ( 726542 ) on Monday July 07, 2008 @02:38PM (#24087127) Journal

    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).

  • Challenging? (Score:5, Insightful)

    by PPH ( 736903 ) on Monday July 07, 2008 @02:47PM (#24087245)

    Why must a well designed language be challenging?

    I came at Java with some C plus some experience with a (proprietary) object oriented AI system. Java was trivially easy to pick up.

  • by EastCoastSurfer ( 310758 ) on Monday July 07, 2008 @02:57PM (#24087395)

    In that post Linus seems to rail more against C++ and not OOP in general. Good design is good design regardless of a language. You can do OO like design in C or even ASM if you follow some rules.

    OO is not a panacea, and just because some is OO doesn't make it a better design than non-OO. Each problem is unique.

  • by east coast ( 590680 ) on Monday July 07, 2008 @02:58PM (#24087419)
    How many can there be left these days?!?

    I'm sure more roll off the old assembly line everyday. Just because you and your peers are seasoned vets...

    Also, this book came out at a real great time. With MS finally opening up to the hobbyist/novice programmer with their Express edition of their tools there is going to be a lot of n00bs out there.

    Sadly, it seems that too many here can't recall when they were still struggling with the concepts of OOP to see that there is a real audience for this level of writing.
  • C++ != OOP???? (Score:2, Insightful)

    by Anonymous Coward on Monday July 07, 2008 @03:03PM (#24087475)

    "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++..."

    If you are an experienced C++ developer who doesn't know enough about OOP to get by in C#, then I'd say you need more help than any mere book is going to provide.

  • by fph il quozientatore ( 971015 ) on Monday July 07, 2008 @03:08PM (#24087527)

    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++

    Well if you have "experience with C++" but no "solid understanding of OOP", there might already be a problem with your programming skills.

  • Re:Challenging? (Score:1, Insightful)

    by Anonymous Coward on Monday July 07, 2008 @03:09PM (#24087537)

    Why must a well designed language be challenging?

    Because the primary design goal behind C# is to lock you into Microsoft's proprietary .NET platform. Things like APIs, support, etc. are secondary with C#, which leads to problems that manifest as technical challenges, among other things. I'm not kidding, nor am I being sarcastic or flip about it.

  • by moranar ( 632206 ) on Monday July 07, 2008 @03:09PM (#24087545) Homepage Journal

    They also state "If you are looking for a reference manual, this isn't for you". So criticizing the series for not being good reference manuals is a bit rich.

    That without even touching the fact that, as you mention, they explicitly say they'll be redundant to teach the subjects better.

  • by Anonymous Coward on Monday July 07, 2008 @03:10PM (#24087567)

    It's because C++ breaks programmers minds so badly in such a way that they feel like they have to overcomplicate everything using stupid template tricks and stupid pointer tricks.

    C++ programmers who move to C# often fail to comprehend how overcomplicated they tend to make things.

  • by jonaskoelker ( 922170 ) <jonaskoelkerNO@SPAMyahoo.com> on Monday July 07, 2008 @03:10PM (#24087571)

    it just doesn't make sense to invest in a primer that, after you finish with it, is a paperweight.

    Except for K&RC2, which you can read for pure entertainment :)

  • by Colin Smith ( 2679 ) on Monday July 07, 2008 @03:16PM (#24087651)

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

    How many can there be left these days?

    Almost all of them...

     

  • Re:Challenging? (Score:3, Insightful)

    by Westley ( 99238 ) on Monday July 07, 2008 @03:17PM (#24087661) Homepage

    C# 1 was quite a simple language. C# 2 added significant complexity (and power, don't get me wrong) and C# 3 has done the same again.

    I wouldn't be without the benefits of C# 3, but it does take it away from the "pick it up easily in a week or so" category in my view.

  • by dedazo ( 737510 ) on Monday July 07, 2008 @03:25PM (#24087787) Journal

    Please, elaborate as to how C# is "goo". What exactly do you mean? In the sense that you don't think the language is designed correctly? The runtime doesn't do it for you? The compiler? The type system? The platform itself?

    Because "teh M$ goo" is not exactly enlightening, other than in the "I hate Microsoft" sense, which is your prerogative of course, but has nothing to do with the technical merits of their products. Especially when you

    we lost our J++ lawsuit

    base your opinions on incorrect premises, since J++ (and J#) have nothing to do with the Sun complaints that brought the antitrust trial, which is what I assume you are referring to here.

    Someone actually modded you up, which means that someone out there assumes you were not merely trolling (which is what it looks like to me, frankly). So a more detailed explanation of your claims would be double plus good.

  • by Dogtanian ( 588974 ) on Monday July 07, 2008 @04:02PM (#24088311) Homepage

    It's M$ goo. It's a "we lost our J++ lawsuit so we gonna rewrap our crap" thingy..

    Except it came out better this time.

    Flamebait? One could argue not. Admittedly my experience with C# is very limited, but the first time I used it about five years ago, it struck me as as blatant a copy of Java someone could make without getting sued... but without the baggage and with a few nice improvements.

    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.

    (Java inevitably accumulated a fair number of dead ends and improved reinventions of the same functionality over the years.)

  • by Mongoose Disciple ( 722373 ) on Monday July 07, 2008 @04:04PM (#24088349)

    Wouldn't the n00bs already be familiar with object oriented techniques since every language they have ever used had OO as a major feature.

    Well, not necessarily. As a consultant who's done a fair bit of maintenance coding on projects that I didn't do any of the original development or design for, I can tell you that a surprising number of people use a perfectly good object oriented language to write programs that have only one object or method. (Or similarly technically use an OO language to write code that would hurt even people who wouldn't consider themselves to be OO purists.)

  • by AppleOSuX ( 1080499 ) on Monday July 07, 2008 @04:20PM (#24088663)

    So? Linux is a blatant copy of some other *nix.

    Open Source software factories are constantly churning out copies of commercial software.

    What's your point?

  • by thetoadwarrior ( 1268702 ) on Monday July 07, 2008 @04:34PM (#24088911) Homepage
    Because the head first books ease you into the language and are literally for beginners. Imo, there is a difference between learning OO programming with no experience and moving from from OO language to another and people with no experience need more hand holding usually.

    One argument people have against the Head first series is how many pictures and other supposedly pointless material is in the books but it's all about repetition and makes it a bit more fun to read which is what most newbies will want rather than something that feels a bit more dry and is like reading a tech manual. So even if it doesn't have as much info, if it keeps you hooked, then it gives you a good start.
  • by dmiller1984 ( 705720 ) on Monday July 07, 2008 @04:44PM (#24089109)

    Granted, in this case I don't know the language C#, but in general I never really understood the Head First series, unless you really like printed introductions to languages. It would just make more sense to use free Internet resources to take your first steps in C#, and then get O'Reilly's e.g. C# 3.0 in a Nutshell [amazon.com] as a good desk reference. Tech books are expensive, so it just doesn't make sense to invest in a primer that, after you finish with it, is a paperweight.

    You're reading it from the perspective of someone who already has a good knowledge of programming in general, though. While I haven't read the Head First C# book I do have their Ajax book, and while I do not find it to be a good general reference it is great for my high school students to read. They have far less experience programming than I do and they pick up on these easier from the Head First book than they do from most.

  • by Conspiracy_Of_Doves ( 236787 ) on Monday July 07, 2008 @04:50PM (#24089211)

    Can someone please explain what is wrong with C#? Something other than the fact it was created by Microsoft or simply that it is 'rubbish'.

    What features of the language do you have a problem with? Ok, so there's no multiple inheritance. What else?

    I've been doing ASP.NET via C# for a living for about 18 months now, and I've found it to be a perfectly servicable language. What's the problem with it?

    I hate Microsoft's business ethics just as much as the next /.er. I'm still going to judge their products based on their own merits.

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

    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.

    I couldn't disagree more. Leaving aside your mischaracterisation of LINQ as "embedding SQL directly into the code" all of these features can *hugely* improve the readability of code.

    Having used both Java and C# extensively, I know which language I prefer by a long chalk. Happily Java 7 will (eventually) gain at least some of the nice features of C#, but unfortunately not all - and it won't get rid of checked exceptions...

    I now use Java professionally, but I'm constantly missing the features of C# which consistently allow me to write readable, reliable code.

  • by encoderer ( 1060616 ) on Monday July 07, 2008 @06:20PM (#24090663)

    We all stand on the shoulders of giants.

    Java was not revolutionary, it was evolutionary. Sun certainly had a lot of 'prior art' to guide them when they developed Java.

    I'm sitting here wondering what you think made Java so special that it was, by your logic, in a class unto itself? It wasn't the first OO language, it wasn't the first platform-agnostic language, it didn't expose a new and wild syntax, etc.

    Java was successful not because it was groundbreaking: It was successful because it took all the best innovations from the existing languages of the mid-90s and coupled them with a familiar syntax and a large and cruft-free library.

    The framework ecosystem gave a further boost by giving C and C++ programmers a route to web development that didn't involve terrible pain (CGI) or the loss of self respect (VB Script).

    I imagine Anders had similar goals for C#.

  • by Anonymous Coward on Monday July 07, 2008 @06:31PM (#24090883)

    Except when you're called at 2am because the smoke test that was running on product release binaries failed with an access violation and no stack dump.

    You better hope that the other programmers using pointers in the 250,000 lines of code used them properly.

    There is no specific need for pointers. They can be abstracted either with shared_ptr or using a more modern language.

  • by smilindog2000 ( 907665 ) <bill@billrocks.org> on Monday July 07, 2008 @07:04PM (#24091337) Homepage

    I agree. I don't even let our programmers use pointers in C, except for specific cases where the language is limited (returning multiple values, and char * for strings). If you dump pointers to structures and use more abstract coding, just accessing properties of objects through object references/handles, everything gets better.

    In fact, you can also get waaay faster [sourceforge.net].

  • by Lincolnshire Poacher ( 1205798 ) on Tuesday July 08, 2008 @05:10AM (#24097093)

    > but you really should try to modern-up your skillset if you code for a living

    Modern? Simula67 introduced an implementation of OO with objects, classes and inheritance in... guess what year?

    OO should only be one paradigm in the programmer's toolkit; applying it to all problems is unwise. Procedural, OO, AO, DO, functional, logic; they're all equally valid across an unbounded problem space.

  • by Evil Kerek ( 1196573 ) on Tuesday July 08, 2008 @08:00AM (#24098201)
    This is a silly place to post a review about a C# book. Most of the readers here are way too narrow minded to post any reasonable discussion about the book (or anything involving M$).

    The posts here pretty much prove my point. It's actualy kind of sad - it's obvious some of these people are fairly bright, yet they can't seem to see past their 'elitism' BS - which is anything but.

    The review itself should probably be marked 'troll'.

    I don't particularly like microsoft - but yep, I do code for a living in C# after having done so in Delphi (way back in delphi 1). And sorry guys, but it's pretty damn cool - the database access stuff needs work but in general, it's a very nice language to work with (and the IDE rocks). And yeah, well, as long as windows land is 90% of the world, that's where I'll be coding. Call me back when linux manages to get some desktop penetration worth talking about.
    EK

Living on Earth may be expensive, but it includes an annual free trip around the Sun.

Working...