CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Property Get vs Function

    In an existing application in a standard module there are several Public Property Get. Who can explain me, why there were used instead of Public Functions. There are no local members at all. Those properties are used as regular functions. Is there any advantage with this approach? Or it's just bad knowledge of VB?
    Thank you.
    Vlad


  2. #2
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Property Get vs Function

    Functionaly, they are the same thing - do some action, return a result. Design-wise, a Get property procedure should return only the current value of some local variable in a class module. If the routine is to perform some sort of action(s), then it should be a function, so everyone knows, just by looking in the object browser, what its purpose is.

    just my $.02

    john

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  3. #3
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Re: Property Get vs Function

    Thank you
    Vlad


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