Other articles


  1. Header Interfaces vs Role Interfaces

    In some languages such as C++ you must define header interfaces. These constructs define how a public type is exposed in terms of its public interface. Other languages take a different route. C# or Java do not require headers but they are still very much in circulation. This unfortunately brings …

  2. Production Code is Dirty

    Production code is dirty. Dirty may be the wrong word however. Complex could be more suitable. Unlike code that is not yet in production, it is weathered, proven, and full of edge cases including numerous bug fixes. After some time this build up of additions can cause the code to …

  3. Static Code

    Static code is considered a bad thing by developers. This is especially true when working with legacy code. The use of static code is often seen as a smell and should not be used.

    This is not as black and white as it first seems. Static code can be problematic …

  4. Guard Clauses and Assertions

    Two simple techniques to increase code quality, resilience, and ease debugging scenarios is to use guard clauses effectively and ensure that assertions are used liberally.

    Guard Clauses

    • Any public method should perform guard clauses to ensure pre conditions are met.
    • Ensures the code's invariants are not broken.
    • Throw exceptions, because …
  5. Lists or Objects

    "Our rule of thumb is that we try to limit passing around types with generics (the types closed in angle brackets). Particularly when applied to collections, we view it as a form of duplication. It's a hint that there's a domain concept that should be extracted into a type." [Growing …