Results 1 to 9 of 9

Thread: *RESOLVED* Properties... why do we use them?

Threaded View

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    *RESOLVED* Properties... why do we use them?

    What's wrong with having a public variable in a class? I'm not asking what are the advantages of having a property, but why shouldnt we have a public variable?
    I was analyzing a small project with Project Analyzer and it said:

    "Variables that aren't Private should be avioded in classes. Read/Write access to a Class's memeber variables should only be allowed via properties."
    why!?!
    Last edited by MrPolite; Sep 30th, 2002 at 10:41 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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