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

Drew Wutka DWUTKA at Marlow.com
Thu Apr 14 13:01:00 CDT 2011


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.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business 
Sensitive material. If you are not the intended recipient, please contact the sender 
immediately and destroy the material in its entirety, whether electronic or hard copy. 
You are notified that any review, retransmission, copying, disclosure, dissemination, 
or other use of, or taking of any action in reliance upon this information by persons 
or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list