Catalog of Elixir-specific code smells

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

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

    Catalog of Elixir-specific code smells

  • I've been doing elixir professionally for 6 years. I realize I'm in the minority, but as someone who _reads_ a lot of code, I feel that the strong emphasis (and in some cases, requirement) to extract functions seriously hurts readability.

    Quickly glancing through this, I see the Complex Branching case as an example (https://github.com/lucasvegi/Elixir-Code-Smells#complex-bran...). It makes my brain need to act like the runtime, storing the stack of the current function in my head, jumping to the function call, then returning back to the original function and restoring the stack (to be clear, I'm not talking about the actual execution, I'm talking about what my brain goes through reading this).

    In a complex codebase, the jumping can be far (physically and figuratively), especially since there's a strong preference for pattern matching in function parameters (so in the given example, there might be 4 `success_api_response/2`.

    Inline code is _often_ easier to read and reason about, even when you aren't concerned about a function mutating a parameter (as in the case with elixir).

  • credo

    A static code analysis tool for the Elixir language with a focus on code consistency and teaching.

  • [Credo](https://hex.pm/packages/credo) comes with a nice set of default checks and it is straightforward to add your own.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS 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