I am sorry, but I got your post again on my feed. And seeing inheritance I couldn’t resist to say: “Inheritance is the base class of evil”. Nothing against you, its against inheritance.
Nope. Its just the reverse tbh. Its not about just reading definitions of OS concepts. Its about implementing them. Youtube videos just gives a fake dopamine boost that you are productive. But in reality you aren’t as you are avoiding to do engineering in real.
Its sad to see that java despite of being a really bad language for writing correct programs is so demanding. And that’s why most programs in world are buggy.
“The purpose of encapsulation is to guarantee the consistency of the object by preventing clients from making arbitrary modifications to its representation.” This straight comes from his OO software construction book.
This is how Bertrand Meyer defines it:
“The ability to confine certain aspects of an object’s state and behavior to the object itself, ensuring that no external entity can violate the object’s integrity.”
No. That’s not it. And thus code example is really bad for teaching encapsulation. Encapsulation is about protecting class invariants. In example you are providing read and write access to every data member. Then there is no point making them private. (atleast in swift)
Category theory provides another nice way to look into problem. So we model async computation as f: A -> M B. So its not function from A to B but we added some monadic context M. Now that M is a temporal monad. And it is a sync function when M is simply identity monad 😉.
I think you see async in very narrow sense. Formally, a function f: T -> U is async if it guarantees to eventually produce U on call. f is sync if additionally guarantees to produce U before call ends. And that’s it. No CPU, nothing. Just maths.