John,
In addition to Trev's comments, it has not been deprecated as much as it is
discouraged.
Interesting enough this topic was just discussed on 1/16/2004, search this
newsgroup for a thread titled "Public properties vs. public variables".
IMHO it is better to make your fields Private and use Properties as it
promotes encapsulation.
Remember Encapsulation is one of the top 3 tenants of OOP. The other 2 being
Inheritance and Polymorphism.
Properties are .NET method of encapsulating field or attribute data.
There are Code Critics & Analyzers that you can purchase that will review
your code and identify if you have Non-Private fields as well as other
discouraged practices. Such as
http://www.fmsinc.com/reviews/tnanalyzer/sd1202.htm
Hope this helps
Jay
"John Dann" <news@prodata.co.uk> wrote in message
news:j2ri00tcttunrsl43vbg46d73dv4jhtp9g@4ax.com...[color=blue]
> I'm learning VB.Net with a view to converting from VB6. One simple
> detail I'm unsure of concerns fields (as class members).
>
> In VB6 I'd thought that declaring a class property just as a public
> variable (ie without get/set procedures) was deprecated though valid.
> I'm slightly surprised to see this same approach also turning up in
> what is generally the more formalised structure of .Net and even
> apparently being approved of with the title of a field or class field,
> while still seemingly functioning as a standard property.
>
> Have I misunderstood something about how fields are now to be used in
> .Net, or does a field remain a simple substitute for a full property
> declaration that wouldn't necessarily be used in well structured code?
>
> TIA
> John Dann[/color]