ailon's DevBlog: Development related stuff in my life

Book Review: Framework Design Guidelines. Conventions, Idioms, and Patterns for Reusable .NET Libraries by Krzysztof Cwalina and Brad Abrams (Second Edition)

6/11/2010 3:38:05 PM

5138dM4PHnL._SS500_ This book is a must-read and a must-have for anyone developing .NET libraries and frameworks. It’s basically an internal Microsoft document describing how .NET itself and related frameworks should be developed.

Guidlines are divided into DO, DON’T, CONSIDER and AVOID depending on how strong authors feel about them. In addition to official guidelines the book is filled with notes and commentary from other Microsoft gurus. Quite often these notes are even more valuable than guidelines themselves. That said there were a few places where guideline was just thrown out there without any explanation of the reasoning behind it. Sometimes it was obvious but a few times not so much.

If you are an experienced .NET developer you probably follow most of these guidelines automatically but this book provides all of them in one place. You can force your less experienced colleagues read this book and save them from learning these rules the hard way. And when in doubt it’s an excellent reference to turn to.

I must say this is not a fascinating read. To tell the truth it’s one of the most boring books I’ve ever read. Nevertheless it’s extremely valuable and I don’t hesitate to recommend it to any .NET developer. And even if you don’t do .NET you can gather quite some wisdom from it.

If you follow tech news you probably know that Brad Abrams left Microsoft and went to Google, so, I guess, we shouldn’t expect a third edition of this book (at least by the same authors) in the foreseable future. So this is probably as good as it gets for now.

Buy this book from Amazon

Tags: ,

Book Review: The Art of Unit Testing by Roy Osherove

2/2/2010 7:49:36 PM

The Art of Unit Testing by Roy Osherove

Personal preface

I must admit – I haven’t been doing any real-life unit testing until now. Back in 2004 I was leading a relatively big WinForms project and I thought we should do unit testing on it. Unfortunately we had already finalized our conceptual designs (which didn’t consider unit testing), the tooling at the time wasn’t as mature as it is now and, most importantly, we had no knowledge on how this unit testing thing should be done properly. So after playing around with NUnit for some time I’ve concluded that it was neither the time nor the place to start doing it for real and put it away.

After that project I was mostly involved with smaller ASP.NET projects and never thought that unit testing was really feasible for them. So, basically unit testing was always somewhere on my mind but not too close to the surface.

Five years later I’ve started working on amCharts for WPF & Silverlight and as we release new products, add new features and fix bugs I’ve started feeling a real fear of breaking something while fixing a bug or adding a new feature. Manual testing helps but the fear is always there. I understood that it’s time for “take 2” on unit testing.

This time I knew that I have to do it right. This is one of those subjects where you can’t just start doing it and learn as you go. That is a sure way to fail (see my experience above).

The Book

Fortunately this time there is this book and it’s targeted at .NET developers which is not essential but a nice bonus. I’ve been reading Roy Osherove’s blog for quite some time and following him on twitter. I’ve been using his Regulator regular expression testing tool before that. So, I sort of “knew” and respected the author, the book got raving reviews at Amazon – buying it was a no-brainer.

The book is short (less than 300 pages) but on point with almost none “water spilled” and space wasted. I’ve swallowed it in less than a week reading it in the evenings only. That wouldn’t be that fast for a fiction book, but I think that’s a record for me for a technical book. I usually fall asleep reading technical books in bed pretty quickly and I only did it once with this book ;)

It covers all the aspects of unit testing, writing good tests and testable code, tooling for .NET (also mentions tools for Java, C++, etc.). It also offers quite strong author’s opinions on the matters. Some people might not like this, but as long as you can see that it’s an opinion and not something written in stone, I really do like it.

Minor Criticism

I can’t say anything bad about the content of this book, but I have a few minor complaints about presentation. First of all I didn’t like the font used. I’m no expert of fonts and this could be the default Manning (publisher) font, but it didn’t feel right to me (too wide or something). The use of some “comic” type of font for ToC and headings is another story, but since it’s not the main font it didn’t bother me much. There were some minor issues with sample code too: incorrect indentation, a couple of auto-capitalized “return” statements and things like that, but nothing major.

The book comes with free access to ebook version in PDF, ePub and Mobipocket formats w/o DRM (as far as I understand). Unpleasant thing was that my name and email address was inserted in the footer of every page of the PDF. I don’t even know what is more unpleasant DRM or this. Should I protect the PDF now so it doesn’t spread over internet accidentally or something? If I wanted to spread illegal copies I’d find a way to remove this, but now I don’t even feel comfortable giving that PDF to my colleague which I consider a fair use (I’ll give him a paper book anyway). Anyway this is a minor issue and I should stop complaining.

Conclusion

If you are serious about starting unit testing or improving your skills, do yourself a favor and don’t just jump right in, but buy this book (especially if your main platform is .NET). It’s a really excellent starting point for anyone who doesn’t consider himself a unit testing guru (and I guess even gurus might find something new). After reading this book I feel pretty confident that my next project will include unit tests and I’ll have a good basis and this book as a reference if I have questions.

Links

Tags: , ,

Book Review: Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition by Matthew MacDonald

4/29/2009 1:42:00 PM

prowpf After a pretty bland and unexciting ASP.NET book this was a very good change. Matthew MacDonald covers all aspects of WPF in a very good and interesting style. All the basics are covered, principles explained and practical advices are given.

Probably my only but pretty serious complaint is about a Chapter 24 - Custom Elements. This was one of the main chapters (aside from basic WPF principles) why I bought this book in the first place. I was developing our WPF charting controls and expected to find some insights and guidance in this chapter. Unfortunately a big chunk of the chapter (which is not so long to start with) was dedicated to explaining logical implications of building a masked text box. Probably quite interesting stuff on it’s own but not directly related to what it takes to build custom WPF elements in general.

Aside from that I’m very satisfied with this book and can highly recommend it to any .NET/C# developer interested in programming for Windows Presentation Foundation.

Verdict: close to perfect

Buy this book on Amazon.

Tags: , , ,

Book Review: Professional ASP.NET 3.5: In C# and VB

4/24/2009 4:29:00 PM

proaspnet About a year ago I bought this book when Scott Guthrie promoted a deal on it at Amazon. This was probably the biggest technology book I’ve ever read and it took me months to read and not only because of the size but because it was boooring.

Most of the book is written by Bill Evjen (as far as I understand) and his chapters are very dry and not very different from just browsing through MSDN documentation. There are almost no personal opinions, recommendations or anything. Just plain reference.

Some chapters are written by Scott Hanselman and you can see it right from the start. These chapters offer opinions, advices and you can see a person behind them. I don’t know, maybe it’s just me, but I prefer seeing a person behind a book or an article rather than reading a book which looks like it’s written by some technical documentation team. Unfortunately only a few chapters are authored by Scott.

I couldn’t identify chapters by Devin Rader so he either writes indistinguishably from Bill or Scott :)

The other point to criticize would be the fact that book has samples in both C# and VB. I understand that it’s easier to publish one book instead of two but the book could’ve been like 20-30% thinner and lighter and I wouldn’t have to decide against bringing it with me on the flight (yes, it’s that heavy). And, you know, 300-400 useless pages for almost every reader (either VB or C# developers) doesn’t help preserve Amazonia forests.

Overall this is not a bad book if you are looking for printed ASP.NET reference but not quite a good read if you want some insight, recommendations and depth.

Verdict: complete but dry and boring.

Other recommended books about ASP.NET: 4 years ago I’ve read Programming Microsoft ASP.NET 2.0 Applications: Advanced Topics by Dino Esposito and it was really good. Unfortunately it doesn’t seem that there’s an updated edition of this book by Dino, but there’s other book called Programming Microsoft ASP.NET 3.5. I’m not sure how this new book is related to the older ones (in terms of topics) but I really like Dino Esposito’s style and depth of his books.

Tags: ,

Essential Silverlight 2 (Up-to-Date) by Christian Wenz

6/18/2008 4:04:03 PM

Finished reading Essential Silverlight 2 (Up-to-Date) by Christian Wenz. I've posted about the look and feel of the "Up-to-Date" concept when I got the book. To that aspect I can only add that it was actually more comfortable to read than I've anticipated. The binder doesn't stand in the way and probably is sturdier than paperback or even hardcover.

Now let's move on to the reason why I bought this book - content. The book succeeds at getting you excited about the technology and that's basically it. It shows you how to do basic XAML and how to access the objects from C# and JavaScript very briefly (currently it's only about 200 pages long). I really missed a part dealing with creation of objects and drawing directly from C#. I don't think that's something outside of the scope of "essential" book. It also seems that some chapters are being rewritten from JavaScript to C# but the text still says "JavaScript" while the code in the example is in C#.

I was mostly interested in Part 3: Programming Silverlight with .NET. But to my surprise it dealt with embedding Silverlight into ASP.NET pages rather than actual programming of Silverlight apps.

Anyway I got my share of excitement about the technology and feel pretty comfortable to start actually doing some stuff with it after reading this book.

Verdict: succeeds at getting reader excited about Silverlight 2 and stops right there

P.S.: This review refers to the book with "Update 1" (Beta 1) applied.

Accelerated C# 2008 by Trey Nash

6/13/2008 3:56:01 PM

accelerated_csharp_2008I've been developing in C# (on and off) since version 1.0 was in beta. I've read a book about it when version 1 came out and then I relied on online articles, blogs and docs to stay updated. Now (2 versions later) I decided that it's about time to read something systematic on the language to get a complete overview of the things I could've missed over the years and to familiarize myself with new features in C# 3.0 (btw, book title is probably a work of some crazy marketing mind since there's no such thing as C# 2008 AFAIK) .

And the book delivers just what I needed: concise overview of most of the language features complete with samples, usage patterns and best practices. Accelerated C# 2008 (Accelerated) is targeted at developers with some prior experience. It's stated in several places that it's for C++, Java and Visual Basic developers though it's perfectly clear that Trey Nash has lots of things to say to C/C++ and C# guys and not so much to the Java and Visual Basic crowd. Almost all comparisons are done with C++ world so if you are Java/VB developer I suggest you look elsewhere or at least be warned that you wont find many references to these languages.

Verdict: highly recommended for C++ and C# developers, not so much for beginners and Java and VB developers

P.S.: actually in this case I've read a Russian translation of this book titled "C# 2008 ускоренный курс для профессионалов" so I can't talk about publishing related qualities of the book.

Tags: , ,

Book Preview: Essential Silverlight 2 (Up-to-Date)

5/28/2008 12:30:24 PM

Essential Silverlight 2 Got a copy of Christian Wenz's "Essential Silverlight 2" (Up-to-Date) I ordered from Amazon. It arrived in 20 days which is quite fast provided that Amazon predicted it would take 4-6 weeks. Obviously I haven't read it yet but I just wanted to blog about the "Up-to-Date" concept from O'Reilly.

With Up-to-Date books you get a book looking like binder and once book's subject is updated the book is updated and you can download new/changed pages, print them (or order pre-printed updated pages from O'Reilly) and add/replace pages in the binder. Looks good on paper.

As I wrote the book is essentially a binder. There are about 200 printed pages (100 sheets) and about 100 sheets of plain pre-punched paper to print updates on. I went right to O'Reilly site and registered my book. There was an update already with 80 pages of new and updated content based on Silverlight 2 Beta 1. You can download 4 versions of PDF pages: 2 to print on provided sheets (either single-side or double-side) and 2 for standard Letter/A4 with cut-out and punch markers.

My first question was can I use prepunched paper with our HP LaserJet 1300? After some RTFM'ing I found a statement in HP's user guide saying

Do not use paper with cutouts or perforations other than standard 3-hole punched paper.

whatever "standard" means in this context. And what would happen if I had a 2 or 4-hole punched paper? Anyway I decided that it would be ok.

IMAG0017 The next challenge was to fit the content perfectly to the page. The title of the PDF for precut pages says "Pre-cut 7x9 Single-sided". But in reality the paper is 7.17"x10.12" (182mm x 257mm) which is actually B5. It took me some time to figure this out. But even when I knew the right size I couldn't make it fit perfectly. All the new pages have printed tabs saying "Update 1 (Beta 1)" and I couldn't make these fit.

Maybe that was my fault, maybe O'Reilly's, maybe Adobe's, maybe HP's. Who knows? It is not a very crucial information but I decided to not take a risk losing useful info on some pages and just shrink the pages a little to make them fit. The font on "my" pages is a little smaller now than on original pages but it's ok.

All-in-all I've spent about 2 hours updating the book. Since my printer can't print on both sides automatically I had to use single-side approach and spent like 80% of bundled paper. So I don't think I'll have enough paper for another update.

IMAG0012

Btw, the holes on the blank paper are not exactly at the same distance from the edge as on original pages so it was a little difficult to assemble the binder back and it doesn't look very pretty.

IMAG0015

And why use B5 for these series? I know it looks like a real book this way but I doubt I can get punched or even not punched B5 paper here in reasonable quantities and for reasonable price. And when using Letter/A4 you have to cut from all 4 sides which is a total overkill. And shipping of pre-printed updates to Lithuania is $19+. Add $4 for the updates themselves and you get the price of the whole book.

Why not just use Letter/A4? I know the book would be a little clunky this way but it would make life of the customers who bought this book to be able to update it themselves (which is the idea, isn't it?) much much easier.

Conclusion

The concept is interesting and it's really nice to have an actual book on the product that is still in beta and know that you can update the book to the latest version. But the "maintenance" of the book is too painful to my taste.

kick it on DotNetKicks.com

Copyright © 2003 - 2010 Alan Mendelevich
Powered by BlogEngine.NET 1.6.1.0