Is encapsulation possible without OOP?
问题 I was asked a question in an interview: if encapsulation is possible without OOP, e.g. in a procedural language? 回答1: Bob Martin has stated that encapsulation is not only possible without OOP, it was better before OOP came along. Here is an excerpt from a talk he gave in 2014 at Yale School of Management. We had perfect encapsulation. In C, all you had to do was forward declare your functions and your data structures. You didn't have to implement them. You would forward declare them in a