A
Agents Marlow
I am new to C# (but not to programming, I have been using C++ for many
years). I have started reading "The C# Programming Language" and have
got to the bit on access specifiers. I am trying to understand the
comment made by Krzysztof Cwalina:
People need to be careful with the public keyword. public in C# is not
equivalent to public in C++! In C++, it means “internal to my
compilation unit.” In C#, it means what extern meant in C++ (i.e.,
everybody can call it). This is a huge difference!
Can someone explain this please?
Is it to do with symbol visibility? Does public mean externally
visible to the known universe? Not every class needs to have such
visibility but classes that cooperate do need some sort of visibility
among themselves. What sort of access would this be when public would
be too much? Would that be 'internal'? I am struggling to understand
this, any help would be greatly appreciated.
Regards,
Andrew Marlow
http://www.andrewpetermarlow.co.uk
years). I have started reading "The C# Programming Language" and have
got to the bit on access specifiers. I am trying to understand the
comment made by Krzysztof Cwalina:
People need to be careful with the public keyword. public in C# is not
equivalent to public in C++! In C++, it means “internal to my
compilation unit.” In C#, it means what extern meant in C++ (i.e.,
everybody can call it). This is a huge difference!
Can someone explain this please?
Is it to do with symbol visibility? Does public mean externally
visible to the known universe? Not every class needs to have such
visibility but classes that cooperate do need some sort of visibility
among themselves. What sort of access would this be when public would
be too much? Would that be 'internal'? I am struggling to understand
this, any help would be greatly appreciated.
Regards,
Andrew Marlow
http://www.andrewpetermarlow.co.uk