codymanix said:
count is a private variable in ArrayList whereas Count is a public property.
so What is the problem?
So the author of ArrayList may well want to be able to set Count as a
property, rather than as a direct variable access - whether for bounds
checking purposes or whatever. Currently, you can't do that unless
Count is publicly settable as well.
A getter and setter of a property imho always belongs together. As I said
you cannot separate public and private members if they belong to the same
property.
You can't, but that's the problem.
A sourcefile should separarate the code public and private into
separate sections
According to you, maybe - not everyone works like that though. I know I
don't. I don't really see that it adds much value, to be honest.
Personally I organise my source by type of operation - so I might have
a public method which calls some private methods for implementation,
and I would group those together, possibly in a region.
which is not possible with a private setter and a public
getter.
The c# language designers had their reasons why they made them
together.
For general clarity, yes. When they had to have the same access
modifier, that didn't upset your "organise source by access" way of
doing things - but now it will. I don't believe the C# language
designers' reasons were for your code organisation scheme though.
But sure, it would certainly have its advantages. We will see what the next
version of C# will bring to us.
Indeed. Maybe it won't affect you, but it'll certainly affect me. I
like to avoid setting variables directly anywhere other than in
properties - and basically I can't do that at the moment