"On behalf of the industry and the English language, we apologize."
-Brownfield Application Development in .NET, page 269
For the last half of a year I have had a monkey on my back, and today is a blessed day because I've finally set that monkey free, because I finally am posting my review of Brownfield Applications in .NET.
Here is the short review of this book:
- I asked Manning before writing this review if the book had gone through editing and was assured I had "pretty close to the final version".
- Manning is a patient publisher who has been waiting several months for me to provide this review, so I vastly appreciated their indulgence
- Kyle Baley is a great man who loves his wife and children
There you go.
You'll notice the short review doesn't dwell too much on the whole "book" part of "book review", and that is because Kyle Baley and I are friends. In fact, despite his public plea for public feedback, no matter how negative, I would implore Kyle to perhaps stop reading this post now and simply remember we are blood brothers for life no matter what happens. With that said, let's get to the *real* review for this book; I'll start with the negatives and finish with the positives so that everyone can leave happy. But before we start I want you all to know one more time that I love Kyle like a brother and he is a fantastic person and software developer.
For want of an editor
At the beginning of this post I mentioned setting my monkey free. Hopefully Manning can follow my example and set the monkey who edited this book free as well. I'm not even talking about the general cohesiveness of the book, which has issues we will discuss later. As a disclaimer, I do not feel it is too lofty or unrealistic to expect that the responsibility of "editor" includes catching and correcting things like:
- 2nd grade spelling mistakes
- sentences that aren't sentences
- paragraphs that end in mid-sentence, never to be finished, e.g. "This also helps your code's 'reversibility'. That is, any changes you make can easily be backed out. This may not sound like [abrupt end of paragraph]." Er, like *what*?
If you disagree, please unsubscribe immediately as you are unlikely to agree with anything I say, ever. Just to head any wiseacres off at the pass who want to start correcting my own grammar and spelling, please keep in mind that I'm not charging you to read this post*!
To be fair to the editors, I'm not sure whether the overall cohesiveness is an editing problem or simply the difficulties of co-authorship. Early chapters assume the reader already has a background in certain topics and then subsequent chapters treat the same topic as if this is the reader's very first time ever seeing it in print. This is particularly noticeable when it comes to the discussion and "introduction" to Design Patterns after they've already been discussed 1700 times previous, or the assumption in 7.1.6 that everyone knows what the Adapter Pattern is before we are "introduced" to it in Chapter 8. The book's stance on datasets swings a bit from "not recommended but we can see how they are used in certain situations" to "datasets are eeeeeeeeeeeeevil we hate em WE HATE EM WE HATE EM". As I'm familiar with both of the book's authors and styles I can pick apart who is saying what, but for someone who isn't that familiar (read 99.99999% of this book's hoped for audience, I would assume) the overall message comes off a bit confusing.
The unit testing/CI/IDE conundrum
Nowhere near as confusing, however, as the stance the book takes regarding automated builds, unit testing, and debugging in the IDE. Page 81 (Chapter 3) states:
"There is one thing that you should be aware of when moving to a project/solution structure favoring a scripted compilation. It is possible that you will create a structure that no longer allows for direct running and debugging in the IDE. With Visual Studio this would mean that you may no longer be able to hit F5 and step into code with the debugger. For some developers this will be a major friction point in their personal development process (code, debug, verify, fix, repeat). For others, the transition to relying on automated tests to do their debugging and verification will be more fluid."
The book then goes on to strongly imply how awesome and 1337 it is for a team to only use automated tests to debug issues and that hey, you're a rock star for breaking free of your IDE chains. Yee haa, everyone's happy, except the guy that actually reads beyond Chapter 6 and gets to this little part in Chapter 7:
"the reality is that unit testing might not be possible"
Why in the world would you recommend a process that potentially you can't accomplish if you can't rely on unit tests in the first place? This gets even weirder when you read the reference to TypeMock in Chapter 10 that talks about it being able to "test the untestable" but provides no explanation or examples as to how it works. Wouldn't it have solved everyone's problems to just show how TypeMock could get around some of this "untestable" code and thus allow you to justify your breaking the IDE build to the remainder of your development team? By the way, if you think it's weird that TypeMock's first real mention is 7 chapters after the chapter on - you know - testing, you're not alone.
More detail please
TypeMock is not the only subject given "short shrift" in this book either:
- 7.2.2 has talk of fluent interfaces but it amounts to "fluent interfaces have their place, and when used appropriately..." So when *is* it appropriate? The book apparently doesn't know because they don't offer any guidance in this area, so I'm honestly not certain why it was even mentioned.
- Database migrations are referred to but in a book that is full of detailed examples on how to set up a NANT script apparently there's not space enough to explain this concept to a reader. If someone is that new to the very *concept* of a continuous build why would they be familiar with this?
- Why bring up Presentation Model but provide no examples?
- Discussion of user interface based testing was superficial and non-commital
- Since it's likely most people's questions around the Presenter would center around Event Handling, why is there no exploration of this?
- pg. 262 - "You'll need a separate layer to translate between domain objects and DTOs. Don't worry, it's not as arduous as it sounds." Obviously not arduous at all since the book offers no explanation as to how this would be done! This is strange considering the Layers chapter assumes the reader is fairly new to many of these concepts.
Less detail please
Likewise there are other places where things could've been cut, such as the code example in Chapter 10 that is shown once in the context of "here's some bad code" but is strangely *not* used when examples of refactoring are provided; why include the example at all if you're not going to do anything with it?
The great debates
As a book that also wants to advocate certain practices I think its arguments (aside from the unit testing ones) are specious:
- pg. 301 - I agree that business logic should be in code rather than in the database. However, while addressing the fact that some business logic is in the hands of overprotective DBAs, it would been nice to see some harder evidence that this is a bad idea. This felt more anecdotal than anything based in fact.
- 9.3.4's discussion on SRP and class explosion is pretty lacking. Yes, I use Resharper just like anyone should but the argument of "overall inefficient navigation is a sign of a problem with your tool: Visual Studio" is a terrible and gross over-simplification. Perhaps some better advice on how to structure class files to aid in navigation or a balanced discussion on SRP would serve the purposes a little better than an argument that boils down to "Your IDE sucks, go spend some money." How would this argument play out in real life?
- Dinosaur Dev, 10 years on the project: "Hey, I think this new structure is a little confusing, I can't really find anything anymore"
- Dev 2, a couple of months on the project: "That's Visual Studio's problem, not mine! Go get Resharper"...not too convincing.
The recommendation of Resharper also assumes that the developer has that sort of purchasing authority and installation authority to make that decision, which is *definitely* not always the case. What happens if they don't? I think going to a boss and saying, "We need to spend $300 per developer because the new guy restructured our file solution to the point we can't work without it" is a tough sell.
The elephant in the room: development management
I will be open and say I had a big philosophical problem with the whole concept of "don't worry about breaking your IDE's ability to do builds, rely on the unit tests". I think that is laudable but it doesn't recognize the friction that *also* creates for a development team that may need to be educated towards even the concept of automated builds. This sort of thing feels more like a "scorched earth" approach to developer management that is at odds with some of the messages in the first chapter of the book. And speaking of development management...
I recognize that working to change developer/development team management is not the focus of this book; it represents the *technical* "how to get there", not the *political* "how to get there". There are a wide variety of different factors that come into play when introducing these ideas; I would've sooner that the book devoted a full chapter to it (not the superficial talk of it in the first chapter) or simply not talked about it whatsoever. To be fair, I don't know that
a) managing software developers and effectively dealing with technical office politics are subjects that either author has a lot of experience with
b) that these *are* subjects the authors should be well-versed in, considering this is largely a code-based book
I think this is why writing about brownfield development is difficult: there are a wealth of political issues at play when a project *does* get into this sort of sorry state, and its handling of those are oftentimes what a developer needs to be able to do in order to make significant change. Compounding the problem - what to actually tackle? The technical topics are so broad that if you focused on everything to the depth it required you'd need a book series rather than a book. Perhaps Manning should consider re-branding some of its other books together under this topic umbrella and linking them as a set? I think this difficulty definitely shows itself when reading the book.
In search of an audience
Lastly, I'm just not sure who the audience is supposed to be for this book. Is it senior consultants who are being brought in with decision-making authority? Is it, like chapter 1 postulates, developers who are new to the existing project that see the potential for improvement? If it's the former, they likely already know quite a bit of what this book has to offer. If it's the latter the way the book handles introducing topics is really confusing as compared to dedicated books on specific topics, and - like the Resharper example demonstrates - there are some assumptions being made about the level of authority that person has that aren't true in most cases.
All right, now that I've gotten all of that out of the way, a brief focus on some of the good points about this book:
The good
- Like I said before, Brownfield is a difficult topic to write about - this book is at least, well, a book on brownfield! Are there really many other books like that in the development space right now? The closest thing I could think of was the old Mike Gunderloy book "Coder to Developer" but that struck me as *very* focused on dev and not so much on maintenance dev work.
- Totally agreed with "Any process that impedes the forward motion of a developer should be rethought, reworked, replaced, or simply eliminated"
- Arguments in favor of unit testing are good and of use to anyone trying to convince their management it's a good idea.
- I strongly agree with The Zero Defect Count philosophy as espoused in the book. Great thing to share with your team.
- I like the Layering chapter.
- First time I've seen a book aside from Fowler that differentitates between Supervising Controller/Passive View
- Kyle Baley is a great and wonderful man who I respect
Guidance
So should you buy this book? On its own merits? Maybe for the Layers chapter and the arguments on unit testing, but otherwise I'd probably lean slightly towards no; at least not until it goes through some more significant editing, and if it Manning doesn't think it is worth at least that, then Manning has basically told you it's not worth your money! If it is tightened up I could see it being compelling at least as an introduction to the more important concepts a developer will deal with in their career, sort of a "Coder to Developer" for the consultant set. It also *might* be worthwhile in its current form provided you only use it as a vague guide to branch off into more detailed explanations/tutoring with a developer, but at that point I'd probably just recommend a different set of books.
However, on the principle of this being Kyle Baley and Kyle Baley being an awesome human being, for sure, give him as much money as you can.
Obviously as long-time readers know I am familiar with both of the authors of Brownfield, so the book having this rough edge was a bit surprising to me. There are certainly some flashes of great things in here but I think the overall content needs a bit of touching up and some focus on what audience is being targeted wouldn't hurt. However, as Manning has said this is presumably the final edit so it may be too late for this edition. However, I *definitely* look forward to seeing what the authors of Brownfield can do as individual authors - and with some tighter editing - in the future!
* although I should