CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: OOP in VB .NET

  1. #1
    Join Date
    Sep 2001
    Location
    Montreal Canada
    Posts
    1,080

    OOP in VB .NET

    .... 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.
    Nicolas Bohemier

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: OOP in VB .NET

    I believe, but could be wrong, that that'll be included in 2005.

  3. #3
    Join Date
    Jul 2005
    Posts
    27

    Re: OOP in VB .NET

    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.

  4. #4
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: OOP in VB .NET

    Quote Originally Posted by DSJ
    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.

  5. #5
    Join Date
    Sep 2001
    Location
    Montreal Canada
    Posts
    1,080

    Re: OOP in VB .NET

    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
    Nicolas Bohemier

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured