My Thoughts on “Bad Code”

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • NullAway

    A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead

  • Some patterns arise from language design

    * You can't express `T` where `null` is forbidden in the type system so you get NullPointerException everywhere and defensive null checks.

    * You express a sum type as a product type because your language does not have sum types .

    * Your language doesn't have first class multiple return values (or tuples) so you return extra parameters via out parameters or thread local variables such as `errno`.

    * Your language doesn't have exceptions (or algebraic effects) and can't do IO so you have monad transformers.

    * Your language doesn't have set-theoretic types so you need hacks like `thiserror` .

    * Your language doesn't have stackful coroutines or can't infer async IO for you so you have `async/await` spam or callback hell or "mono's".

    * Your language doesn't have exhaustive checks (or pattern matching) so you need a fallthrough case check on switch statements .

    * Your language doesn't have algebraic effects, so you need to pass context everywhere.

    I know someone will reply about Java's null annotation checking options, so here is one of them: https://github.com/uber/NullAway .

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts