- Joined
- Nov 8, 2013
- Messages
- 3,378
- Likes received
- 648
- Thanks received
- 177
Why do you think that?
All costs? no. Most of the time? sure.
Why do you think that?
I agree with you but it could be argued in this example that IsCardVerified could be a public method on a class called CardVerification. CardVerification could be passed into your class in the constructor. This would enable this common code to be used through out your app and other apps. BUT I would only do this for code that would be reused out side of calling class.
Yes it would. I just mean that "encapsulating" data by making it private but then just adding a public mutator/accessor in front of it is not really encapsulation at all - it's a token gesture to make yourself feel better.
SpontaneousOrder said:All costs? no. Most of the time? sure.
Presumably you can tell it not to, and still write custom accessors if you need to?Indeed. In C#4 et seq you don't even declare accessors as it just does it all for you.
Presumably you can tell it not to, and still write custom accessors if you need to?
It does get overused, particularly by newer programmers. .

Presumably you can tell it not to, and still write custom accessors if you need to?

Particularly by lecturers at schools/college! which is frustrating.
Presumably most of the lecturers turned to teaching because they weren't very good developers
I love this poster for the Liskov substitution principle:
![]()
I think the teachers always do a bad job teaching inheritance with their "is a?" approach. In the poster they'd say that the toy duck "is a" duck - but clearly it's not. It's a toy with duck-like attributes.
So nothing particularly relevant to the discussion then.
I guess I was right!
I'm pleased to say that, as a signed up hacker of the 70s generation, I can't understand any of this.
And, more to the point, I find I don't care either.![]()
