Robert Martin

The Robert C. Martin Clean Code Collection (Collection)

Notify me when the book’s added
To read this book, upload an EPUB or FB2 file to Bookmate. How do I upload a book?
  • b4777467766has quoted7 days ago
    We had no idea how that would be done because the API had not been designed yet. So we decided to work out the details later.

    To keep from being blocked, we defined our own interface. We called it something catchy, like Transmitter.
  • b4777467766has quoted7 days ago
    we are advising you not to pass Maps (or any other interface at a boundary) around your system. If you use a boundary interface like Map, keep it inside the class, or close family of classes, where it is used. Avoid returning it from, or accepting it as an argument to, public APIs.
  • b4777467766has quoted2 months ago
    Not only are learning tests free, they have a positive return on investment. When there are new releases of the third-party package, we run the learning tests to see whether there are behavioral differences.
  • b4777467766has quoted2 months ago
    Now we know how to get a simple console logger initialized, and we can encapsulate that knowledge into our own logger class so that the rest of our application is isolated from the log4j boundary interface.
  • b4777467766has quoted2 months ago
    In learning tests we call the third-party API, as we expect to use it in our application. We’re essentially doing controlled experiments that check our understanding of that API. The tests focus on what we want out of the API.
  • b4777467766has quoted2 months ago
    It’s not our job to test the third-party code, but it may be in our best interest to write tests for the third-party code we use.
  • b4777467766has quoted2 months ago
    A cleaner way to use Map might look like the following. No user of Sensors would care one bit if generics were used or not. That choice has become (and always should be) an implementation detail.
  • b4777467766has quoted2 months ago
    Providers of third-party packages and frameworks strive for broad applicability so they can work in many environments and appeal to a wide audience. Users, on the other hand, want an interface that is focused on their particular needs. This tension can cause problems at the boundaries of our systems.
  • b4777467766has quoted2 months ago
    This is called the SPECIAL CASE PATTERN [Fowler]. You create a class or configure an object so that it handles a special case for you. When you do, the client code doesn’t have to deal with exceptional behavior. That behavior is encapsulated in the special case object.
  • b4777467766has quoted2 months ago
    When we return null, we are essentially creating work for ourselves and foisting problems upon our callers.
fb2epub
Drag & drop your files (not more than 5 at once)