I don't recommend the use of public member/instance variables.

I think you were clear, and yes, I agree.

when I'm using an object solely as a data structure

We've got structs for that. :) But yes, they're really the same thing
and in that one case it's ok. Basically the .net/java equivalent of a
data structure in RPG.

P.S. If I'm reading this correctly, the simple dot notation is
actually the
standard in .NET, but with implicit calls to getters/setters. That's
actually kind of neat, and I bet I cold get used to it.

Depending on what you mean, yes. Under the covers you're actually still
calling a method (ignoring inlining) but that is truly under the covers,
IOW, the JIT xlates your property set/get to a method call. The CIL
standard differentiates between properties and methods and member
variables, so it's not just a standard by convention, it's truly part of
the language def. The difference is in the actual machine code JITed at
runtime whether you call a function or dereference a pointer.

The other nice thing this provides is that IDEs can tell the difference
between properties and methods because they're different things and not
just because they're named differently.

-Walden


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.