Click to See Complete Forum and Search --> : OOP in VB .NET
Boumxyz2
July 14th, 2005, 08:58 AM
:(.... I just found out you can't overload Operators in VB .NET.. Now I wish I would have gone C# instead...
Stuck doing a stupid Compare function instead of a nice clean
a = b
bah...
and I can't do
a = b = c
a.compare(b).Compare(c) won't work.. cause Compare doesn't return a reference to a like a clean operator would do.
DSJ
July 14th, 2005, 08:59 AM
I believe, but could be wrong, that that'll be included in 2005.
JSawyer
July 14th, 2005, 10:06 AM
I'm comming over from C++, and it is annoying to not have things like operator overload, the post/pre increment, and even true pointers. However, remember those things are more of a convenience. You can always program other ways then with pointers, and when you overload operators, you still have all the underlying code to make it work. Which would be pretty much equal to you having to program around it.
jhammer
July 14th, 2005, 11:27 AM
I believe, but could be wrong, that that'll be included in 2005.
DSJ was right. In Visual Studio 2005, indeed there is proper operator overloading.
I recommend on the book in
http://msdn.microsoft.com/vbasic/whidbey/introto2005/
which you can download for free. In the second chapter it is all explained.
You will have proper operator overloading for arithmetical operators, and logical operators. Plus you will have operator overloading for CType. And the cool new operators of IsTrue, IsFalse and Not.
Boumxyz2
July 14th, 2005, 12:32 PM
I don't need Pointer.. but Overloading operator is OOP in my opinion and saying VB .NET is OOP but in fact hasn't Operator overload is a lie. I have to work with methods that are not necessarily as Code explicit and clean than the Operators.
IF A = B then is a whole more explicit than A.equal(b) <------ REMINDS ME OF cough cough bad cough cough Java
But anyway.. I'll work around it
Thx guys
Just wanted to point that out
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.