Slashdot Mirror


Pro C#

FrazzledDad writes "Andrew Troelsen's Pro C# 2005 and the .NET 2.0 Platform, 3rd Ed. gives a great breadth and depth of coverage to C# and the features of Microsoft's .NET 2.0 Framework. He does a fine job covering fundamentals of C# and .NET in general and then dives into terrific detail on a number of important topics." Read the rest of Jim's review. Pro C# 2005 and the .NET 2.0 Platform, Third Edition author Andrew Troelsen pages 1032 publisher Apress rating 8/10 reviewer Jim Holmes ISBN 1590594193 summary Great coverage and detail on many C# topics, but long

Troelsen claims that the book is targeted at "experienced software professionals and/or graduate students of computer sciences," and that he won't spend "three chapters on iteration or decision constructs," but he spends enough time covering basics that the book will be beneficial to developers of any skill level.

First off, the book is longer than it needs to be. Part of this is the amount of text Troelsen spends covering fundamentals, despite his claims of the book's targeted audience. Experienced developers will skip right over the sections on object-oriented programming basics and C# language fundamentals. Still, this extra material didn't particularly bother me and it's very useful to newer developers, or those needing a refresher on basics.

Troelsen's example code also has more cruft than necessary, which tends to drag out examples a bit too much. The auto-based example he carries through the book is a nice practical example, but do I really care about methods turning the radio on and off while not lending any weight to the concept?

I was also surprised to find missing any discussion of COM interoperability. While COM Interop isn't a sexy, futuristic topic, I'd think there would be great value in covering it - helping some developers understand how to better deal with migrating or wrapping up legacy applications.

Lastly, despite the book's title emphasizing C#, there are 130 or so pages on ASP.NET and XML web services. Sure, these are part of the .NET Framework, but it seems a diversion from focusing on C#.

Frankly, the bad items I list above are all nits to me in what I consider a very worthwhile book. The book's loaded with plenty of good material, starting out with a solid overview on developing .NET applications outside Microsoft's Visual Studio.

Troelsen nicely covers using the freely available .NET Framework SDK to build applications. He also mentions Textpad and has a handful of pages dedicated to SharpDevelop, the open source C# development environment. He also gives a short nod to the freely (for now!) downloadable Visual C# 2005 Express before moving into an overview of the upscale versions of Visual Studio.

Troelsen nicely lays out critical concepts in his book. His work is the first place I've found clear explanations of why one should occasionally drill into .NET's Common Intermediate Language (CIL, sometimes referred to as "IL"). Other articles and books I've read haven't really gone past the level of "gee, it's neat!", but Troelsen lays out good examples of when it can be useful - such as inspecting IL and finding out how to directly call operator overloads ("+=", for example) in languages which might not support this feature.

I also found Troelsen's discussion of remoting and serialization very clear and useful. Furthermore, he does a great job with delegates and events, starting out with manually working with event handlers. This helps the reader understand the fundamental workings of handler assignments and multicasting rather than just directly jumping to event handling assignment via the += operator.

Even better than Troelsen's conceptual coverage is the level of detail he brings to all the topics he writes on. I already mentioned his coverage of event/delegate multicasting as one example. Other examples would be his extensive coverage of reflection, late binding and threading, among other topics.

He dedicates one chapter to the guts of .NET assemblies, running the gamut from why assemblies exist, through the format of assembly headers, to how shared assemblies work. There's good discussion in this chapter on the what/why/how of the Global Assembly Cache and how to deal with publishing assemblies with policy interraction.

There's plenty of other goodness in this book. Generics get great coverage, as does ADO.NET and multi-threading. There's also a chapter dedicated to GDI+ programming for you graphics geeks.

It's nice that Troelsen carries one example through much of the book, building concepts on the same framework of his automobile classes. Source for his examples is available from Apress's website, and Apress also has a searchable e-book available. The e-book's available for free for short time if you purchase the hardcopy.

Troelsen's writing style is also easy to deal with. He's got a good writing voice which makes potentially dry stuff interesting.

It may be overly long for some folks, but this book is a worthwhile investment for those looking for clear, detailed explanations of C#. The length really doesn't detract from the book's overall value, and I'm happy to have it on my bookshelf. (I even pull it off and use it.)"

You can purchase Pro C# 2005 and the .NET 2.0 Platform, Third Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

23 of 220 comments (clear)

  1. Do the editors make.... by IAAP · · Score: 2, Interesting
    authors add the basics?

    First off, the book is longer than it needs to be. Part of this is the amount of text Troelsen spends covering fundamentals, despite his claims of the book's targeted audience

    It was Meyers, I think, who said at the beginning of one of his C++ books that it wasn't a tutorial and you need to know C++ before reading. And as a result, his books are concise and a great value.

  2. Kill Two Birds With One Stone by Dante+Shamest · · Score: 4, Informative

    With this book.

    Seriously though, unless you're a newbie programmer, I just suggest reading the C# language specifications, and browsing the web for tutorials on .NET.
  3. It's funny that you should say that. by IAAP · · Score: 5, Interesting
    ...and browsing the web for tutorials on .NET.

    I used to spend hundreds of $$$, if not thousands, every year on programming books. For the exception of some really intense CS type of things, I usually ended up Googling for examples and looking at online stuff anyway. Now that I'm smarter, I just look for stuff on the web. These days with so much competition between platforms and languages, there's always some free material on the web and it's better written half the time by people who actually use it.

    I could tell you horror stories about programming authors who never programmed the language before and wrote a book on it! *coughSAMScough* They would rely on the technical editor, or in some cases, the readers to find the errors. Then it's off to the 2nd edition for another round of proof reading by the consumer.

    1. Re:It's funny that you should say that. by Dante+Shamest · · Score: 2, Insightful
      Yeah, I know what you mean. The only computing books that I think are actually worth buying now ones that focus on algorithms, graphics, data structures and math. There's little point in purchasing a language programming book, since the author probably got his knowledge from the web too.

      On the other hand, a book devoted to examples, like say a C# almanac where source code listings and examples are listed for separate APIs, I may consider.

  4. In case you are a Programming Languages Guy by putko · · Score: 3, Informative

    These folks have a formal semantics of C#:

    http://www.ti.ethz.ch/rs/

    For those who don't see the point in having a computer language if you can't say, precisely what statements in the language mean.

    --
    http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
  5. C# by the+computer+guy+nex · · Score: 5, Insightful

    "What makes it a worthless language is that it has all the bad parts of C++ and Java without any of the benefits"

    Most people experienced with the languages believe the opposite - it has all the benefits of Java with none of the problems (lack multiple inheritance, effective marshalling, etc).

    1. Re:C# by Xugumad · · Score: 2, Funny

      > beating yourself with a whip while trying to dance the tango.
      Well, y'know, I have to get my kicks somehow...

    2. Re:C# by ichin4 · · Score: 2, Informative

      If you require that that the mono library and the .NET library are exactly one-to-one equivilent, then you're right: that will never happen. Of course, that isn't even the case for different C and C++ STL libraries, so I don't think that's a reasonable requirement.

      The mono library implements the vast majority of .NET library APIs. In addition, in contains many useful GTK, LDAP, DB, and other bindings of its own that are missing from the .NET library. It is, on its own, an extensive and fully functional programming library that just happens to nearly be a compatible superset of the .NET library.

  6. Re:What's The Point? by ichin4 · · Score: 4, Interesting

    What makes it a worthless language is that it has all the bad parts of C++ and Java without any of the benefits.

    Would you care to enlighten the rest of us which bad parts and benefits of C++ and Java you had in mind?

  7. Pro? by Phillup · · Score: 2, Insightful

    How can a language that runs on such a limited number of Operating Systems be considered "Pro"?

    Just wondering...

    --

    --Phillip

    Can you say BIRTH TAX
    1. Re:Pro? by Arandir · · Score: 2, Interesting

      As my vice president told me, when I asked him about providing C# training for the project, "As professional software developers, it is your responsibility to know the industry standard."

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    2. Re:Pro? by Bellum+Aeternus · · Score: 2, Insightful

      When those operating systems account for 95% of users and ~40% of servers... I think it counts.

      --
      - I voted for Nintendo and against Bush
    3. Re:Pro? by alext · · Score: 2, Interesting

      .NET is designed to work on any and all operating systems. They simply need a unique CLR. and the Win32 API

    4. Re:Pro? by sevinkey · · Score: 2, Funny

      It's pretty hard to make a living writing for an operating system that 90% of Americans use, or do I not understand the definition of Pro :)

  8. A proper review by XMilkProject · · Score: 3, Insightful

    I happy to say, that IMO, this is the first proper/quality book review we've had for quite some time on /.

    The author clearly listed what is, and is not, contained in the book, and also provided his opinion on how useful these various chapters were to him.

    Hopefully future book-related-articles will try to provide atleast this level of information, as opposed to common "The book had alot of good stuff, but then some stuff was missing.".

    More on-topic, I would say that in my experience I've never found these sorts of books particularly helpful, as anyone with software experience should have no trouble finding the information they need in the MSDN library, or on various other websites. Also, I imagine it would be difficult to find a developer who does not already have experience with a syntactically similar language.

    I can imagine though, that this sort of reading might bring up questions (and answers) to questions that many developers had not yet thought to ask (primarily regarding CIL, GAC, etc), which could of course be helpful.

    --
    Big ones, small ones, some as big as yer 'ead!
    Give 'em a twist, a flick o' the wrist...
  9. Re:Slashvertisements continue. by brontus3927 · · Score: 4, Interesting

    It's a book review, not an advertisement A review lists good and bad and gives an overall impression (well a good one does at least, and this one dpes, it lists several things that the reviewer didn't like), while an ad is a one-sided look intending to induce you to buy the product. For a new book (making it NEWs) on a technical subject (of interested for nerds). Does a new book on C# interest you? Apparently not. Does it interest me? Well, yes. The review gave me good information that this book isn't for me, because it's intended for an audiance with more experience that I have.

  10. Re:I don't want to be stuck with one.. by bit+trollent · · Score: 2, Interesting

    If your most important requirement for any programming language is the ability to port your programs to other OSs you are really missing the point of software development. Its all about making cool software. The OS is just a tool. Source code is your canvas, and .Net is nothing more than a set of really nice paint brushes.

    seriously people, try it before you knock it. for 99% of apps out there reduced development time .net provides is more important than platform independence.

  11. Re:What's The Point? by ednopantz · · Score: 2, Interesting

    >Microsoft only shops are a dwindling commodity

    really? Prove it.

    Anecdotal evidence shows that MS shops exist and are hiring fiercely. I put a c# resume up a couple weeks ago and the phone rang in an hour and hasn't stopped ringing.

    Outside of mom's basement, people use these technologies, despite what the slashbots would like to think. And from spending 48 hous with asp.net 2.0, despite some frustrations, I can tell you that this is a *very* powerful platform. The user management stuff is amazing. It makes all the user management/login work absolutely trivial. Color me impressed.

  12. Re:.NET performance by ameline · · Score: 2, Interesting

    Mr A.C.

    I have seen similar results with a 3D Perlin noise generator -- I was comparing Intel vs MS, vs hand coded SSE assembler. For pure entertainment I tried a -clr build and it was quite alot slower. Another interesting point was that the newer compilers (both Intel and MS) generated code that was close to or better than the SSE assembler implementation.

    (For those wondering what Perlin noise is and what it's good for, check out http://freespace.virgin.net/hugo.elias/models/m_pe rlin.htm )

    --
    Ian Ameline
  13. Re:yawn by milimetric · · Score: 2, Informative

    /me wakes /em up. I like C and everything. But I think that a lot of people's debates over languages and what's good for what stem out of missing context. What are you talking about? GENERAL programming? How are you going to do SQL querries in C? How are you going to get any simpler and more concise libraries than Haskell? How are you going to work with matrices as fast as MATLAB? And lastly, how are you going to beat a modern programming language like C# (or Java 1.5, or mono) for productivity?

    When you can code a huge system in C as fast as I can do it in C# or Java, let me know. By huge I mean over 1 million lines of code. And no, I'm not using Visual Studio, it breaks all over the place for anything over 100,000 lines.

  14. Re:C# is pro like VB is pro by Thundersnatch · · Score: 4, Insightful

    Okay, .NET and Java aren't as fast as C in the general case. But I think most developers are a lot more productive in both Java & .NET than they are in C. And C is of course slower than assembly, but I would imagine building an app is 10x faster in C than assembly.

    But now there's all this hype about Ruby and Python, which are orders of magnitude slower than .NET and Java, even with Psyco and other limited acceleration tools. But they are a joy to develop in.

    It seems as though we must trade development ease for execution speed. This seems to be a good trade for the majority of applications: salaries are the #1 cost for most companies. Hardware is cheap. A two-server, 8-core Opteron cluster costs less than an experienced programmer makes in a month.

    So if you're writing an trade-settlement server for the financial markets, where milliseconds mean millions, by all means get close to the hardware and use C and hand-tuned assembly. But otherwise, pick something further up the stack and spend a little more money on hardware.

  15. Re:I don't want to be stuck with one.. by xiphoris · · Score: 2, Informative

    Er, how was the parent marked insightful? Mark parent down!

    C# runs on the .NET platform which was openly standardized. The standards have been adopted by the ISO, the same body that determines the metric units and also manages the C++ language. Furthermore, a number of open source groups have begun implementing .NET for other platforms than Windows.

    And last but not least, all of the patents that Microsoft has covering the .NET platform have been released for public use.

    With open-source leaders such as Miguel de Icaza (founder of GNOME, Mono) involved in producing .NET implementations for OSes other than Windows, it's hard for me to believe you just said what you did if you're anything but completely ignorant. .NET will exist on as many platforms and OSes as people choose to implement it on. And it currently exists on many.

  16. this joke fell flat.... by bwoodring · · Score: 2, Funny

    n/t