[AccessD] First real stumble with using VB.Net over VB

jwcolby jwcolby at colbyconsulting.com
Thu Apr 14 14:26:37 CDT 2011


LOL.  Snarky?  I like it.

I never really did VB6 so i can't discuss that.  In VBA a field and a property are not the same, and 
in .Net they are not the same so i assume the same for VB6.

"Considered a property" by who?  One says "property" in the definition line and the other says 
public varname.  I certainly wouldn't consider them both properties.

;)

John W. Colby
www.ColbyConsulting.com

On 4/14/2011 2:01 PM, Drew Wutka wrote:
> Wow... a little snarky today, are we?
>
> Actually was describing a DIFFERENCE between VB 6 and VB.Net.  In VB 6,
> both were considered properties... and that isn't me 'protesting till
> the cows come home', it's how it is. If it's not, if you can show me
> some documentation that refers to 'Public SomeVariable As String' as
> being a FIELD in VB 6, I will gladly apologize and bow to your superior
> knowledge.  ;)
>
> As for the lazy programmer comment..... who's the one that uses the
> 'canned' bound format?
>
> <BIG GRIN>
>
> Drew
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Thursday, April 14, 2011 4:39 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] First real stumble with using VB.Net over VB
>
> Drew,
>
>   >  Both create a 'property' called SomeValue.
>
> No they don't!  A field is *not* a property.
>
> A field stores data.
>
> A property is code that (may or may not) get / set a field.  Setting a
> field public makes it emulate
> a property which retrieves that field but the two are not the same
> thing.
>
>
> A property may or may not even reference data.  A property may simply
> return a hard coded value.
>
> property get SomeValue() as int
> 	SomeValue = 1/3
> end property
>
> You may protest till the cows come home that is not what *you* call a
> property, but none the less it
> is a property.
>
> Private int MyValue
>
> property Get myValue() as int
> 	return myValue
> end property
>
> MyValue is a field not a property.  It stores an integer.
>
> myValue is a property, it gets but does not allow the external world to
> set, MyValue.
>
> Entirely different.
>
> I understand that you are a lazy programmer, we have had this discussion
> before.  Your claim was
> IIRC that exposing your fields as public was much less work than making
> them private and exposing
> them via properties, and properties were pretty much useless.  You fell
> into the trap of thinking of
> them as the same thing.  Properties are very valuable constructs and
> exist for a reason.
>
> John W. Colby
> www.ColbyConsulting.com
>
> On 4/13/2011 6:22 PM, Drew Wutka wrote:
>> Figured I'd post this here, for those that may be tinkering or
> thinking
>> about tinkering with .Net.



More information about the AccessD mailing list