Today I found an excellent article about Cleaning up your Elixir Code.

It shows how you can refactor your code and use best practices (hexagonal design with adapters/ports, dependency injection, decoupling business logic from implementation details).

I’m excited about learning about clean code and how to write maintainable programs.

For a beginner, it’s still hard to apply these principles.

Some frameworks, like [NestJS][nestjs], make this easier as they are very opinionated and enforce clean code principles.

JavaScript, Node.js/Express.js, and React.js are “loose” and don’t force you to write in an idiomatic way. Thus, it’s easier to write rubbish. For a beginner, an opinionated tool can serve as training wheels.

Further Reading