Welcome to MSDN Blogs Sign in | Join | Help

jaredpar's WebLog

Code, rants and ramblings of a programmer.

Syndication

News

Now Reading

Pragmatic Programmer

Pragmatic programming at it's best. The book is a light read and worth the time

Essential WPF

Thus far the best book I've read on WPF. Gets right down to working with WPF and the goals/history.

Purely Functional Data Structures

Reading this book makes me feel like I'm back in college. It will really get your mind going and is best read with a whiteboard handy.


Browse by Tags

All Tags » VB   (RSS)
Making Equality easier
Recently I've done a bit of posting about the difficulties of properly implementing equality in VB (and DotNet in general). While most of the problems can be fixed with a standard snippet the one really hard to implement issue is GetHashCode(). The rules Read More...

Posted Tuesday, June 03, 2008 8:00 AM by Jared Parsons | 2 Comments

Filed under: ,

Equality isn't easy
After my recent postings on the rules of Equality , I thought it would be a good idea to post a simple example of equality. The class in question, Example, has only one field of type Integer name m_field1. Two instances of Example are equal if m_field1 Read More...

Posted Monday, May 12, 2008 8:00 AM by Jared Parsons | 0 Comments

Filed under:

IEquatable(Of T) and GetHashCode()
This is a bit of a follow up to a previous post we discussed how to properly implement equality in VB. Several users commented/asked that IEquatable(Of T) could be used in place of overriding Equals(). Since IEquatable(Of T) doesn't define a GetHashCode() Read More...

Posted Friday, May 09, 2008 8:00 AM by Jared Parsons | 0 Comments

Filed under: ,

Properly Implementing Equality in VB
Many developers want to implement equality functions for their objects.  DotNet made equality a deep part of the framework and added support all the way up to System.Object with Equals and GetHashCode .   In addition to the strongly enforced Read More...

Posted Monday, April 28, 2008 8:04 AM by Jared Parsons | 6 Comments

Filed under: ,

Me, MyBase, MyClass and MyPost on the subject
Recently we had a good discussion on an internal alias about the use of Me, MyClass and MyBase in VB. Me, MyBase and MyClass are all ways to access instance member data in a VB class or structure. There was a little bit of confusion on the actual workings Read More...

Posted Friday, April 25, 2008 11:09 AM by Jared Parsons | 0 Comments

Filed under:

BinaryInsert Part2
Previously I discussed a potential missing API in List(Of T).BinaryInsert. One of the items I mentioned was it had better performance because it was O(Log N) vs Insert and Sort which is O(NLogN). Several users correctly pointed out this was incorrect Read More...

Posted Monday, April 07, 2008 3:09 PM by Jared Parsons | 7 Comments

Filed under:

Have a IComparable(Of T) but need an IComparer(Of T)?
IComparable(Of T) is an interface saying "I can compare myself to other objects of the same type".  And IComparer(Of T) is an interface saying "I can compare two objects of this type.".  Often API's which need to perform Read More...

Posted Wednesday, April 02, 2008 9:33 PM by Jared Parsons | 0 Comments

Filed under: ,

Missing API: List(Of T).BinaryInsert
One API that seems to be missing from List(Of T) is a BinaryInsert method.  Especially since there is already a BinarySearch method. Binary insert is a method for inserting a value into an already sorted list.  Since the list is already sorted Read More...

Posted Monday, March 31, 2008 10:26 AM by Jared Parsons | 3 Comments

Filed under: ,

Dealing with Exceptions in a Future
Besides waiting, the another important issue when dealing with Futures is how to deal with exceptions thrown by the user specified code.  Option 1: Ignore the Exception Don't take any actions in the future code and force users to write exception Read More...

Posted Monday, February 11, 2008 11:36 AM by Jared Parsons | 7 Comments

Filed under: , ,

Tuples Part 1
A tuple in computer science can be described as a set of name/value pairs. In some cases it can be described as simply a set of values that are accessible via an index [1]. Previously I discussed how to create a Tuple inside of PowerShell . This series Read More...

Posted Thursday, January 03, 2008 11:25 AM by Jared Parsons | 6 Comments

Getting my Fortune
Fortune is a Unix command that gets a random message from a set of databases and displays it on the screen.  These messages have a wide variety but tend to be funny, quirky or famous quotes (most are indeed geeky).  Nearly all unix systems have Read More...

Posted Monday, December 03, 2007 12:57 PM by Jared Parsons | 1 Comments

Filed under: ,

Calling Extension Methods on Null Objects
One of the gotchas for Extension Methods is that it's legal to call them on Null References. This isn't really surprising when you think about the feature. Boiled down to a fundamental level, extension methods are just syntactic sugar for calling a static Read More...

Posted Friday, November 30, 2007 12:19 PM by Jared Parsons | 1 Comments

Filed under: , ,

Type Inference and IEnumerable
This is somewhat of a follow up on a previous post I did on the difference between IEnumerable(Of T) and the IEnumerable interfaces. I've seen several people type in the following code and wonder if there was a fundamental bug in the type inference code. Read More...

Posted Monday, November 26, 2007 5:32 PM by Jared Parsons | 2 Comments

AutoSize and DockStyle.Fill don't mix
The title of this post essentially says it all.  AutoSize and DockStyle.Fill don't mix well together.  Both properties exist to describe the size relationship relative to the rest of the control but they do so in conflicting ways. AutoSize is Read More...

Posted Wednesday, November 21, 2007 12:29 AM by Jared Parsons | 1 Comments

Filed under: ,

Lambda Unexpected Behavior
One item you strive to avoid when you design and implement a feature is unexpected behavior.  Unfortunately there is one case we couldn't avoid with Lambda's in VB9.  I just ran into the this problem when coding up a handler.  I wanted Read More...

Posted Monday, November 19, 2007 10:38 PM by Jared Parsons | 1 Comments

Filed under: , ,

More Posts Next page »
Page view tracker