Published Aug 20, 2019

The Pragmatic Programmer - How to use Exceptions

Delve into the strategic use of exceptions in programming with Joe Zack, Michael Outlaw, and Alan Underwood as they emphasize deliberate coding, clear documentation, and the transition to Kotlin, highlighting crucial error-handling strategies and avoiding programming by coincidence.
Episode Highlights
Coding Blocks logo

Popular Clips

Episode Highlights

  • Coding Plans

    In the realm of software development, planning and structuring code deliberately is crucial to avoid randomness and inconsistency. Alan Underwood emphasizes the importance of understanding the code you write, rather than making assumptions, whether you're working with Kotlin or any other language 1. He suggests that developers should "take the time to code from a plan," highlighting that while it may seem like common sense, it is often overlooked. Michael Outlaw and Joe Zack add their perspectives, with Joe humorously admitting, "I have like eight different plans and they all conflict and I start with one and end up with another" 1.

       

    Coding Plans

    Documentation plays a crucial role in maintaining code clarity and supporting deliberate programming. Michael Outlaw emphasizes the importance of documenting assumptions, noting that if something seems off, it should be clearly noted to avoid future issues 2. Alan Underwood agrees, stating that even if code appears to work, it might not be functioning correctly and could fail if the underlying assumptions change 2. Joe Zack adds a practical tip: "If you put in tickets, say, like, hey, this only works for positive transactions, then no one can get mad at you" 2.

       

    Programming by Coincidence

    Programming by coincidence can lead developers into a false sense of security, ultimately causing unexpected failures. Alan Underwood warns against relying on implicit assumptions, which can become major sticking points if not addressed 2. He advises programmers to "not assume something, prove it," emphasizing the importance of verifying assumptions to prevent future issues. Joe Zack adds that adhering to erroneous code can lead to failures when the original code is corrected, highlighting the need for constant vigilance and readiness to refactor 2.

Related Episodes