Story Details

  • Two Hard Things (2009)

    Posted: 2025-01-20 00:18:48

    Martin Fowler's short post "Two Hard Things" humorously points out the inherent difficulty in software development. He argues that naming things well and cache invalidation are the two hardest problems. While seemingly simple, choosing accurate, unambiguous, and consistent names within a large codebase is a significant challenge. Similarly, knowing when to invalidate cached data to ensure accuracy without sacrificing performance is a complex problem requiring careful consideration. Essentially, both challenges highlight the intricate interplay between human comprehension and technical implementation that lies at the heart of software development.

    Summary of Comments ( 20 )
    https://news.ycombinator.com/item?id=42763592

    HN commenters largely agree with Martin Fowler's assertion that naming things and cache invalidation are the two hardest problems in computer science. Some suggest other contenders, including off-by-one errors and distributed systems complexities (especially consensus). Several commenters highlight the human element in naming, emphasizing the difficulty of conveying nuance and intent, particularly across cultures and technical backgrounds. Others point out the subtle bugs that can arise from improper cache invalidation, impacting data consistency and causing difficult-to-track issues. The interplay between these two hard problems is also mentioned, as poor naming can exacerbate the difficulties of cache invalidation by making it harder to understand what data a cache key represents. A few humorous comments allude to these challenges being far less daunting than other life problems, such as raising children.