James Michael Hare

...hare-brained ideas from the realm of software development...
posts - 166 , comments - 1431 , trackbacks - 0

My Links


Welcome to my blog! I'm a Sr. Software Development Engineer in the Seattle area, who has been performing C++/C#/Java development for over 20 years, but have definitely learned that there is always more to learn!

All thoughts and opinions expressed in my blog and my comments are my own and do not represent the thoughts of my employer.

Blogs I Read

Follow BlkRabbitCoder on Twitter

Tag Cloud


Post Categories

Image Galleries



Little Wonders

Little Wonders


April 2010 Entries

C#: Adding Functionality to 3rd Party Libraries With Extension Methods
Ever have one of those third party libraries that you love but it's missing that one feature or one piece of syntactical candy that would make it so much more useful? This, I truly think, is one of the best uses of extension methods. I began discussing extension methods in my last post (which you find here) where I expounded upon what I thought were some rules of thumb for using extension methods correctly. As long as you keep in line with those (or similar) rules, they can often be useful for adding ......

Posted On Wednesday, April 28, 2010 10:58 PM | Comments (1) | Filed Under [ My Blog C# ]

C# Extension Methods - To Extend or Not To Extend...
I've been thinking a lot about extension methods lately, and I must admit I both love them and hate them. They are a lot like sugar, they taste so nice and sweet, but they'll rot your teeth if you eat them too much. I can't deny that they are useful and handy. After all, one of the major components of the Shared Component library where I work is a set of useful extension methods to help simplify common repetitive tasks. But, I also can't deny that they tend to be overused and abused to willy-nilly ......

Posted On Monday, April 26, 2010 10:44 PM | Comments (22) | Filed Under [ My Blog C# Software .NET Fundamentals ]

C#: LINQ vs foreach - Round 1.
So I was reading Peter Kellner's blog entry on Resharper 5.0 and its LINQ refactoring and thought that was very cool. But that raised a point I had always been curious about in my head -- which is a better choice: manual foreach loops or LINQ? The answer is not really clear-cut. There are two sides to any code cost arguments: performance and maintainability. The first of these is obvious and quantifiable. Given any two pieces of code that perform the same function, you can run them side-by-side and ......

Posted On Friday, April 23, 2010 6:54 AM | Comments (30) | Filed Under [ My Blog C# Software .NET Fundamentals ]

More Fun with C# Iterators and Generators
In my last post, I talked quite a bit about iterators and how they can be really powerful tools for filtering a collection of items down to a subset of items. This had both pros and cons over returning a full collection, which, in summary, were: Pros: If traversal is only partial, does not have to visit rest of collection. If evaluation method is costly, only incurs that cost on elements visited. Adds little to no garbage collection pressure. Cons: Very slight performance impact if you know caller ......

Posted On Wednesday, April 21, 2010 10:31 PM | Comments (3) | Filed Under [ My Blog C# ]

Of C# Iterators and Performance
Some of you reading this will be wondering, "what is an iterator" and think I'm locked in the world of C++. Nope, I'm talking C# iterators. No, not enumerators, iterators. So, for those of you who do not know what iterators are in C#, I will explain it in summary, and for those of you who know what iterators are but are curious of the performance impacts, I will explore that as well. Iterators have been around for a bit now, and there are still a bunch of people who don't know what they are or what ......

Posted On Monday, April 19, 2010 10:12 PM | Comments (4) | Filed Under [ My Blog C# ]

C#: A "Dumbed-Down" C++?
I was spending a lovely day this last weekend watching my sons play outside in one of the better weekends we've had here in Saint Louis for quite some time, and whilst watching them and making sure no limbs were broken or eyes poked out with sticks and other various potential injuries, I was perusing (in the correct sense of the word) this month's MSDN magazine to get a sense of the latest VS2010 features in both IDE and in languages. When I got to the back pages, I saw a wonderful article by David ......

Posted On Sunday, April 18, 2010 11:17 PM | Comments (5) | Filed Under [ My Blog C# C++ ]

Powered by: