C# in Depth

Published 9/9/2008 by Adam Wolf in Book Reviews | c# | Development | LINQ
Tags:
c# in depth
Title: C# in Depth
Author: John Skeet
Publisher: Manning Publishing
ISBN: 1933988363
Copyright: 2008
Rating: Good

In C# in Depth, John Skeet takes the willing C# enthusiast on an intellectual journey into the heart of one of the most popular languages on the .Net platform. I must admit, I read this book like I was reading a murder mystery. I started by reading the ending first and then finished with the beginning. The book is organized by the major releases of the C# language with the most current version last; hence, the reason for me reading the ending first. 

C# 3.0

The book does a good job of covering all of the new features and language enhancements in the 3.0 release of the C# language. Coverage of the new smart compiler, along with the new features that make LINQ possible, is covered to astonishing depths. The author slowly, but methodically, takes the reader down the knowledge rabbit hole of Lambda expressions until your brain is wrapped around type inference and overload resolution. I read that chapter twice, and I might have to again.  

C# 2.0 1.0

I have been developing in C# from the very beginning and this book had some nice surprises even for me. I was especially impressed with the excellent coverage of delegates, annonymous methods, covariance and contravariance. Even if you are a season developer, C# in Depth will teach you something new about the C# language.

Conclusion

Either way you read this book, you are going to get something out of it. John has taken a very technical subject and has distilled it into usable and manageable pieces that are easy to read and understand. This book truly has depth that no other C# language book can touch. If C# is your tool of choice, then this book will help make it sharper and more useful.


LINQ in Action

Published 8/13/2008 by Adam Wolf in Book Reviews | LINQ
Title: LINQ in Action 
Auther: Fabrice Marguerie, Steve Eichert, Jim Wooley
Publisher: Manning Publishing
ISBN: 1933988169
Copyright: 2008
Rating: Excellent

I am a big fan boy of the new Language Integrated Query (LINQ) feature of the .Net 3.5 Framework from Microsoft. LINQ in Action from Manning Publication is an exceptional book on this topic. The first few chapters are loaded with clear and useful explanations of the how’s and the why’s of this new and exciting technology. The authors waste little time before showing you real and useful examples while thoroughly explaining the underlying technology. The book is broken up into sections covering LINQ to Object, LINQ to XML and LINQ to SQL with minor coverage of other LINQ providers.

Most developers will normally start working with LINQ on collections of in memory objects, so the book starts from this point giving the reader a tour of the numerous extension methods for the IEnumerable interface. This interface is the gateway for using LINQ to Objects and the coverage in LINQ in Action does not disappoint. Each extension method and their features are explained and accompanied by code examples in C# and VB where appropriate.

XML is the data language of computers and LINQ to XML makes working with that data easier. This section held the least interest for me because I do not work directly with XML these days; but if I need to, and I will, this is the book to get up to speed quickly. Some of the most interesting samples in the book are ones that take in memory objects and converts them to XML with little or no effort. This will be very handy for my Silverlight work in the future.

Microsoft’s main goal for developing LINQ is to help remove the impedance mismatch between programming languages and relational databases. LINQ to SQL is just one of many relational data access providers written for LINQ. LINQ In Action provides nice coverage of Data Mapping, DataContext object and usage, Queries and data loading. The best chapter in this section is the “Peeking under the Hood” where the authors take you into the guts of LINQ to SQL and explain some of the lesser known or covered topics, including my favorite tool SQLMetal.

Conclusion

I am glad to have a book like this at my side when I am trying to develop with a newer technology. The author’s explanations and deep dive’s into the guts of the technology have given me insight not only on how to do something but the reason behind it. This book was the single best source for truly learning LINQ and all of its standard providers. It has even helped me deliver a .Net user group talk on the topic. It is well worth the cost and the time.


In my next blog on the SEVDNUG ORM shootout series, I am going to show how the LINQ to SQL ORM can be used with a Domain Driven Design (DDD) philosophy. To give people a better understanding of DDD, I decided to group all of my DDD books into this one review. Domain Driven Design is more of a philosophy than a technique or a methodology. It is in this philosophy or understanding that complexity in a computer system is broken down into a model that contains the systems business logic.

Over the last decade or two, a philosophy has developed as an undercurrent in the object community. The premise of Domain-Driven Design is two-fold:
  • For most software projects, the primary focus should be on the domain and domain logic.
  • Complex domain designs should be based on a model.
From: www.domaindrivendesign.org

I have used the DDD techniques found in the books in this review to build systems with some very good success, and that success was dependent on the frequent open communication with the domain experts. If you cannot get a client or organization to agree on open communication with domain experts, then using DDD would be inappropriate and I would look for other, more traditional, techniques like waterfall.


 

Domain Driven Design Tackling Complexity in the Heart of Software

Title: Domain Driven Design
Auther: Eric Evans
Publisher: Addison Wesley
ISBN: 0321125215
Copyright: 2004
Rating: Excellent

If Domain Driven Design were a religion then this would be “The Good Book”. In “Domain-Driven Design Tackling Complexity in the Heart of Software” Eric Evans has distilled his object modeling and development philosophy insight into a readable and readily usable book. I really enjoyed this book and I have read sections of the book many times gaining more insight into the object domain-modeling world each time. If you are going to purchase one book on DDD, then this is the one you should purchase.


 

Applying Domain Driven Design and Patterns with Examples in C#

Title: Applying Domain Driven Design and Patterns
Auther: Jimmy Nilsson
Publisher: Addison Wesley
ISBN: 0321268202
Copyright: 2006
Rating: Great

Jimmy Nilsson has expertly combined Domain Driven Design, Enterprise Application Architecture, Test Driven Development and the C# language into a single approachable text for the .Net Developer. In the book, you will find real world examples that shows how DDD and enterprise architecture combine to develop working and, more importantly, maintainable software. Jimmy has done a tremendous job on “Appling Domain Driven Design and Patterns with Examples in C#.” If you know C#, this book will teach you how to use DDD with enterprise architecture and how to do it correctly.


 

.Net Domain Driven Design with C#

Title: .Net Domain Driven Design with C#
Auther: Tim McCarthy
Publisher: Wrox
ISBN: 9780470147566
Copyright: 2008
Rating: Good

When learning a topic as big as Domain Driven Design (DDD), an example is very helpful and that is what Tim McCarthy has provided in “.Net Domain Driven Design with C#.” The community surrounding the DDD movements has been asking for a more thorough example application using the Domain Driven Design technique. Tim starts from the bottom and in successive chapters builds a DDD inspired application complete with all the major DDD concepts covered. If you need an example application to help you learn DDD, then this book is what you are looking for.

I need to warn readers that this book has a terrible binding and it's printed on toilet paper. I suggest you do not highlight pages in this book because they will bleed through multiple pages. Wrox should upgrade the paper from toilet paper to something above tissue paper!


Title: Debugging Microsoft .NET 2.0 Applications
Auther: John Robbins
Publisher: Microsoft Press
ISBN: 0735622027
Copyright: 2007
Rating: Good

This book is worth reading if you want to improve your development and debugging skills. In Debugging Microsoft .Net 2.0 Applications, John Robbins from Wintellect teaches you the basics and some of the advanced skills you will need in the fight against application bugs. Topics range from best practices used during development, usage of advanced applications like WinDBG and SOS, and symbol server setup and use.

Many chapters in the book are peppered with small excerpts call “Debugging War Stories” with colorful titles like “A Career Limiting Move” and “Assertions Saves the Day”. In these sections, John describes the events that he has witnessed in the war against bugs and gives you practical advice on how to win the war.

One of the highlights of this book is the attention John has given to applications that can aid in your defense and elimination of application bugs, like FXCop, SuperAssert.Net, WinDBG, SOS, Fiddler, and Symbol Server. Visual Studio has an amazing array of tools to help a programmer find bugs and John gives it due attention in Chapter 5 with a thorough tour of Breakpoints, Watch Window, and other advance tips and tricks.

I would encourage every .Net developer to read at least Chapter 3 “Debugging During Coding” and chapter 5 “Advanced Debugger Usage with Visual Studio”. For those of us that need to know more, the book is worth the price to get John's insight into years of debugging problems I wish I never have.


Title: Agile Principles, Patterns, and Practices in C#
Auther: Robert Martian & Micah Martian
Publisher: Prentice Hall 
ISBN: 0131857258
Copyright: 2007
Rating: Excellent 

In Agile Principles, Patterns and Practices in C#, Robert C Martin and Micah Martin take you on a tour of the Agile development world with stops along the way for discussions about agile methodology, object orientated design patterns and good common sense development practices. The book, at first glance, seems to take a huge bite out of too many topics, but the authors are succinct and cover each topic thoroughly.

One of the more revealing bits in this book is in the comments the author solicited from a group on the internet about two developers pair programming a simple scoring application for the game of bowling. Some of the developers from the group disagreed with how the application was constructed and that the solution was not very object orientated or that the developers did not use UML to design the application up front. The authors responded by saying those other items were not needed and could have hampered the construction of the scoring application by introducing unnecessary complexity into the development process. This exchange highlights the need for this book and the tenants of agile development.

Agile Principles

  1. Highest Priority is to satisfy the customer through early and continuous delivery of valuable software.
  2. Welcome changing requirements, even late in the development.
  3. Deliver working software frequently, from a couple of weeks to a couple of months.
  4. Business people and developers must work together daily throughout the project.
  5. Build project around motivated individuals.
  6. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.
  7. Working software is the primary measure of progress.
  8. Agile processes promote sustainable development.
  9. Continuous attention to technical excellence and good design enhances agility.
  10. Simplicity – the art of maximizing the amount of work done – is essential.
  11. The best architectures, requirements, and design emerge from self-organizing teams.
  12. At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

It is with the above agile principles that the author was able to develop the game scoring application while not utilizing the common OOP design principles and other techniques commonly used in application development today. The author chose to not introduce complexity because it was not needed in this application, and that is one of the major tenants of Agile development.

The Object Orientated Design Principles Covered in the book.

  • SRP The Single Responsibility Principle
  • OCP The Open-Closed Principle
  • LSP The Liskov Substitution Principle
  • DIP The Dependency Inversion Principle
  • ISP The Interface Segregation Principle
  • REP The Release-Reuse Equivalency Principle
  • CCP The Common Closure Principle
  • CRP The Common Reuse Principle
  • ADP The Acyclic Dependencies Principle
  • SDP The Stable Dependency Principle
  • SAP The Stable Abstraction Principle

It is the combination of agile practices, design principles and test driven development that the promise of the agile methodology comes to life. The authors give each of the design principles attention because it is the understanding of good design and design principles that enables a developer to identify code smells and needles complexity. Code smells like rigidity, fragility, immobility, viscosity, needless complexity, needless repetition, and opacity are described to give you the reader an understanding of what things agile development is trying to solve. The book, in my opinion, is excellent because of the wide topics covered and the attention given to each principle and practice.


Title: Practices of an Agile Developer: Working in the Real World
Auther: Venkat Subramaniam and Andy Hunt
Publisher: Pragmatic Programmers
ISBN: 097451408X
Copyright: 2006
Rating: Great


The pragmatic programmers have done it again. They have written a very usable and accessible book to help developers be better developers. With chapter topics ranging from Agile Feedback to Agile Collaboration, the authors give readers 45 solid practices that they can start using immediately to make them better at their chosen craft.

List of Practices

  • Work for Outcome
  • Quick Fixes Become Quicksand
  • Criticize Ideas, Not People
  • Damn the Torpedoes, Go Ahead
  • Keep Up with Change
  • Invest in Your Team
  • Know When to Unlearn
  • Question Until You Understand
  • Feel the Rhythm
  • Let Customers Make Decisions
  • Let Design Guide, Not Dictate
  • Justify Technology Use
  • Keep It Releasable
  • Integrate Early, Integrate Often
  • Automate Deployment Early
  • Get Frequent Feedback Using Demos
  • Use Short Iterations, Release in Increments
  • Fixed Prices Are Broken Promises
  • Put Angels on Your Shoulders
  • Use It Before You Build It
  • Different Makes a Difference
  • Automate Acceptance Testing
  • Measure Real Progress
  • Listen to Users
  • Program Intently and Expressively
  • Communicate in Code
  • Actively Evaluate Trade-Offs
  • Code in Increments
  • Keep It Simple
  • Write Cohesive Code
  • Tell, Don’t Ask
  • Substitute by Contract
  • Keep a Solutions Log
  • Warnings Are Really Errors
  • Attack Problems in Isolation
  • Report All Exceptions
  • Provide Useful Error Messges
  • Schedule Regular Face Time
  • Architects Must Write Code
  • Practice Collective Ownership
  • Be a Mentor
  • Allow People to Figure It Out
  • Share Code Only When Ready
  • Review Code
  • Keep Others Informed

I found that the book's angel and devil characters dancing on the developers shoulders help convey the importance of the practices like Work for Outcome and Listen to Users. Each practice starts out with a comment made by one of the devils which can represents you on one of your lazy days when you are not thinking in an agile way. These devil's comments describes the practices that should be avoided like in the practice Automate Deployment Early.

“It’s OK to install your product manually, especially to QA. You don’t have to do it all that often, and they are pretty good about copying all the right files.” The Devil

Every practice is then followed by practical advice on how to avoid or mitigate the source of the problem that the practice is trying to solve. It is in these pages that you will find the important information on the Why and the How of each agile practice.

The authors talk at the end of the book about how they have introduced these agile practices to developers on exsisting failing projects to try and turn them around. It is this advice that I find very usable to me in my role as a consultant. They do advise that adding too many new practices to an unstable or failing development projects would not be advisable. They first advise us to stablize the development effort before introducing new practices.

Conclusion

I have been a fan of the great work from the pragmatic programmers and this book does not disappoint. The authors have skillfully boiled down their knowledge of agile practices into readable, usable and actionable practices that can be applied by developers and managers alike today.


Adam J Wolf

The Intersection of the Arts and Crafts Esthetic and Programming