Browse by Tags
All Tags »
VB (RSS)
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...