43 ms·
He's kinda missed the point of simplification you get from encapsulation. Encapsulation makes the API smaller and more manageable. If I want to ride a bike I do
by Quarrelsome 17y ago
He's kinda missed the point of simplification you get from encapsulation. Encapsulation makes the API smaller and more manageable. If I want to ride a bike I don't want to have to worry about the internal workings. I just want to use the Pedal() method. Sure, if that throws a FallOffBikeException I might use more of the API to examine the problem. However I don't need an API that tells me everything, such as the chemical composition of the metal used in the frame.
For his gravity he also probably wants to outsource that to some sort of gravitatonal context that is supplied externally as opposed to including the physics in the bicycle. I'm pretty sure that in computer games they don't put the physics in the model code. :D
And btw, points in .NET (omg OOP!) are immutable structs so i'm not sure why he thinks everyone should make them a class.