Developer's Guide to Collections in Microsoft .NET

Author: Calvin "Lee" Janes
Publisher:Microsoft Press, 2010
Pages: 624
ISBN: 978-0735659278
Aimed at: Advanced .NET programmers
Rating: 3
Pros: Exclusively on collections
Cons: Code in both C# and VB leads to redundancy; doesn't cover recent innovations
Reviewed by: Mike James

Many skilled programmers find the .NET collections libraries difficult to cope with. Does this book help?

Author: Calvin "Lee" Janes
Publisher:Microsoft Press, 2010
Pages: 624
ISBN: 978-0735659278
Aimed at: Advanced .NET programmers
Rating: 3
Pros: Exclusively on collections
Cons: Code in both C# and VB leads to redundancy; doesn't cover recent innovations
Reviewed by: Mike James

I know that many a skilled programmer finds the .NET collections libraries difficult to cope with. Part of the problem is theoretical - when to use a dictionary rather than a list - but some of the confusion is caused by the different versions of the collection classes that are available. So a book on the Collection Classes seems like a really good idea. However, what you make of this particular take on the subject depends very much on what you are looking for and on how tolerant you are of diversions.

 

Banner

 

The first part of the book, approximately 110 pages, provides a practical course in collections. You are shown how to build your own collection classes - arrays, linked lists, associative arrays, queues, stacks and buffers. The code is given in both VB and C#. There is a reasonable explanation of the theory behind each data structure and a discussion of how best to implement it but you do need to know that most of the pages are taken up with heavily commented code.

If you are interested in how collections work, or if you missed out on the theory, then this might be of use to you, but it doesn't get you to understand the .NET collections classes. An alternative approach to Part I of the book would be to explain the theory and then illustrate the ideas using the collection classes; this would at least get you deeper into the specifically .NET material.

Part II of the book does at last focus on the collections classes. Chapter 4 delves into the Generic collections, which for many programmers are the hardest to use, perhaps because they don't make much use of generics in their programming. The chapter begins with some theory, but not of how generics are used. Instead we get an overview of ordering, delegates, anonymous methods and lambda expressions. Then we look at the List(T) class and the book gets back to being code-heavy very quickly as it illustrates how to do all of the standard operations - sorting, searching and so on. This sets the pattern for the following data types. We go over LinkedList(T) at the end of the chapter and then on to Queue(T), Stack(T), Dictionary(T), BitArray, CollectionBase, DictionaryBase, HashSet(T) and SortedList in Chapter 5. This part of the book can be best described as reference documentation with examples.

Part III is all about using collections, which sounds like a great idea, but some of the topics could just as well have been in Part II. For example, adding enumerators isn't really an advanced topic. Chapter 7 explains the basics of Linq, which is a technology that both makes heavy use of collections and makes collections easier to use. Chapter 8 tackles the difficult topic of using threads with collections. This is perhaps the most advanced and most useful of all of the chapters. Given how important multi-threading is becoming any help on how to use supplied classes is welcome. Chapter 9 brings the section to a close with information about serializing collections.

Part IV starts to look a little wider in the rest of .NET and specifically the UI. Using collections with controls is all about databinding. Chapter 10 looks at the general principles of databinding and Windows Forms and Chapter 11 takes a quick look at how WPF and Silverlight are different.

This is a book that is very heavy on code. Before you raise a cheer you need to remember that the code is given in both C# and VB and so there is a lot of redundancy. In addition the code is given in long chunks usually, but not always, with lots of comments. As to the topics covered, they are mostly just examples of the sorts of things you can find in the documentation and the book rarely goes off the beaten track. In particular, it doesn't cover the relationships between the collections and the more recent innovations just as PLinq, TPL, and Rx.

Overall I found the book difficult to read for reasons that aren't entirely easy to work out. It was hard work reading the code and if you skipped the code it was difficult to discover where to read next. Although there are some reasonably good explanations they are mostly buried under a lot of fairly obvious and duplicated code. If this is the sort of book you like then you might get something out of it. For me the book sat between being too difficult an introduction and too simple an advanced work.




Banner


WebGL: Up and Running

Author: Tony Parisi
Publisher: O'Reilly
Pages: 230
ISBN: 978-1449323578
Audience: JavaScript programmers
Rating: 4.5
Reviewer: Mike James

 

Can you learn WebGL without getting involved in the very basic nuts and bolts like shaders and so on?



Lean Analytics, Use Data to Build a Better Startup Faster

Author: Alistair Croll and Benjamin Yoskovitz
Publisher: O'Reilly
Pages: 440
ISBN: 978-1449335670
Aimed at: Would-be entrepreneurs (and data analysts)
Rating: 4.5
Reviewed by: Kay Ewbank

You have to admire a book that starts “Let’s face it: you’re delusional.”


More Reviews

Last Updated ( Monday, 09 January 2012 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.