filmov
tv
Code Complete Essentials | Course Excerpt #2: Encapsulation
Показать описание
In this excerpt, Steve McConnell discusses the highly problematic differences when programming “through” vs. “to” the interface.
In modern programming languages, or currently popular programming languages, we don’t have good support for real encapsulation. Without encapsulation, abstraction breaks down. This introduces subtle semantic coupling between the client code and the implementation, which increases overall complexity.
In the words of P.J. Plauger, “It ain’t abstract if you have to look at the underlying implementation to understand what’s going on.” This is really an issue, and the industry could pay a lot more attention to the abstractions that presented in the interfaces.
Without abstraction, encapsulation breaks down.
If the interface doesn’t tell how to use the class, a natural response is to read the implementation to learn how the class works. This is “business as usual” for most software projects. We as an industry need to do a much better job of creating interfaces that other programmers can actually use.
Focus more on interfaces.
Implementation affects code quality. Interfaces affect longevity, extendibility, ability to scale up a system, etc.
In modern programming languages, or currently popular programming languages, we don’t have good support for real encapsulation. Without encapsulation, abstraction breaks down. This introduces subtle semantic coupling between the client code and the implementation, which increases overall complexity.
In the words of P.J. Plauger, “It ain’t abstract if you have to look at the underlying implementation to understand what’s going on.” This is really an issue, and the industry could pay a lot more attention to the abstractions that presented in the interfaces.
Without abstraction, encapsulation breaks down.
If the interface doesn’t tell how to use the class, a natural response is to read the implementation to learn how the class works. This is “business as usual” for most software projects. We as an industry need to do a much better job of creating interfaces that other programmers can actually use.
Focus more on interfaces.
Implementation affects code quality. Interfaces affect longevity, extendibility, ability to scale up a system, etc.
Комментарии