Re: VB Conversion Keywords And .NET Conversion Routines
From: Bob Grommes (bob_at_bobgrommes.com)
Date: 03/01/05
- Next message: Bob Grommes: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: VB Conversion Keywords And .NET Conversion Routines"
- In reply to: Scott M.: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Next in thread: Bob Grommes: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Reply: Bob Grommes: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Mar 2005 09:36:11 -0700
I'm given to understand that CType() itself is in fact equivalent to the
corresponding Convert methods, and that DirectCast is about the same as a C#
cast, which is faster since it's a cast rather than a conversion.
In reality I'm not sure that we're doing anything but splitting hairs here
though ... this conversation is interesting but ultimately, in real world
line of business scenarios, the differences in performance are not that
significant. If we were doing matrix math or image manipulation, it might
matter. But if we're simply unboxing datarow values and converting textbox
strings to integer or decimal, and other *typical* operations, it probably
doesn't in fact matter how you accomplish it, from a performance
perspective. So I go for consistency and use metaphors that would be
familiar to any developer who knows the .NET framework, regardless of their
language experience.
--Bob
"Scott M." <s-mar@nospam.nospam> wrote in message
news:e8%23tzEnHFHA.588@TK2MSFTNGP15.phx.gbl...
> Well, I don't necessarily agree, in that with CType, there is just one
> function to use. Rather than the 5 or 6 legacy conversion functions. I
> find CType to be more consistent.
- Next message: Bob Grommes: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: VB Conversion Keywords And .NET Conversion Routines"
- In reply to: Scott M.: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Next in thread: Bob Grommes: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Reply: Bob Grommes: "Re: VB Conversion Keywords And .NET Conversion Routines"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|