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 quotedlast month
    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 quotedlast month
    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 quotedlast month
    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 quotedlast month
    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 quotedlast month
    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 quotedlast month
    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 quotedlast month
    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 quotedlast month
    When we return null, we are essentially creating work for ourselves and foisting problems upon our callers.
  • b4777467766has quotedlast month
    you are tempted to return null from a method, consider throwing an exception or returning a SPECIAL CASE object instead.
  • b4777467766has quotedlast month
    Returning null from methods is bad, but passing null into methods is worse. Unless you are working with an API which expects you to pass null, you should avoid passing null in your code whenever possible.
fb2epub
Drag & drop your files (not more than 5 at once)