Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
photo of a dart missing the bull-eye
Software Development

Failing Forward: the “Fail Fast” Approach in Software Development

October 19, 2023
Dawid Boksa

Every software engineer has been there: deep into the coding process, everything seems smooth, and then boom — an unexpected error emerges. Instead of dreading these moments, what if we welcomed them?

Let’s dive into the “fail fast” mantra and see how it shapes the coding journey for the better, primarily through the eyes of a software engineer.

Understanding “Fail Fast”

In software development, “fail fast” doesn’t mean being careless or reckless. Instead, it’s a principle that encourages us to create systems that can quickly identify and alert us to errors.

It’s not about making our applications crash dramatically or frustrating our users. Rather, it’s about ensuring that problems are detected promptly, preventing them from silently compromising the quality of our software.

Breaking it Down

  1. Spot it ASAP: As soon as a problem pops up, it should get flagged.
  2. Clear Alerts: Issues shouldn’t be buried in logs; they should stand out.
  3. Act Swiftly: The sooner you fix it, the fewer complications later on.

Why Every Engineer Should “Fail Fast”

  • Immediate Feedback is Gold: Imagine working on a large module and finding out much later that an initial function had a flaw. Backtracking is a nightmare! Failing fast ensures we get feedback loops right when needed, making rectifications more manageable.
  • Efficient Debugging: Nothing tests an engineer’s patience quite like debugging. By adhering to a fail-fast principle, we cut down on the hours spent chasing elusive bugs. Instead, we’re directed straight to the heart of the problem.
  • Polished Codebase: Every error caught and rectified through the fail-fast approach means one less potential catastrophe in production. Over time, this approach makes our codebase robust and cleaner.
  • Transparency with End Users: Clear, immediate error responses aren’t just for us but also for our users. Instead of leaving them frustrated with unexpected behavior, a prompt error message can offer reassurance that the issue is recognized.

Photo by David Pupăză on Unsplash

Living the “Fail Fast” Life in Your Engineering Routine

  1. Embrace TDD: I can’t stress this enough. Test-driven development is a game-changer. By scripting tests before diving into the functionality, we’re setting ourselves up to catch failures from the get-go.
  2. Tool Up: Leverage error monitoring tools. Having real-time notifications can make a world of difference.
  3. Clear & Concise Errors: A vague error message can be worse than no error at all. Craft messages that give a clear idea of what went haywire. (By the way, we've made a Linkedin post with a selection of terrible error messages as an inspiration of what not to do. Go check it out, even if it's just for the laughs!).
  4. Open Channels with Users: Incorporate user feedback mechanisms. They’re our first line of real-world testers, after all.

Elixir’s Take on Failing Fast

If you’ve dipped your toes into the world of Elixir, a functional programming language designed for building scalable and maintainable applications, you’re likely familiar with its “let it crash” motto. This philosophy doesn’t imply negligence; it’s a strategic approach to building robust systems by acknowledging that failures are inevitable.

Elixir, built upon the Erlang Virtual Machine (BEAM), inherently embraces the fail-fast principle. Here’s how:

  • Supervision Trees: One of Elixir’s most lauded features is its supervision tree. It allows processes to be monitored and automatically restarted upon failure, ensuring that errors are managed and resolved without human intervention. Thus failing fast, spotting where things break, and swiftly recovering.
  • Immutable Data: Elixir’s functional nature and its use of immutable data prevent side effects that could hide underlying issues. When data doesn’t change unexpectedly, functions become more predictable, and issues surface immediately, allowing for a fail-fast approach.
  • Concurrent Processes: Elixir’s lightweight process creation and message-passing model enable it to run multiple processes concurrently. When one process fails, it doesn’t take the whole system down. Instead, issues can be isolated and dealt with individually, embodying the spirit of failing fast and recovering gracefully. For developers using Elixir, adopting the fail-fast philosophy isn’t just a best practice; it’s woven into the fabric of the language and its ecosystem, ensuring that applications are as robust, reliable, and resilient as possible.

Wrapping Up

The “fail fast” approach is a software engineer’s ally, not an adversary. By pivoting our perspective towards early error detection, we’re not just patching up our code — we’re refining our problem-solving skills and becoming more attuned to the nuances of our software.

So, the next time you stumble upon an error, remember: it’s just another step in perfecting your craft. Keep coding, keep failing (fast!), and keep improving.

Development
Elixir

Subtitle

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,

List item

List item

List item

List item

Design is not just what it looks like and how it feels. Design is how it works

- Steve Jobs

Subtitle

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,

List item

List item

List item

List item

Lorem Ipsum voluptate velit
Lorem Ipsum voluptate velit

Subtitle

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,

List item

List item

List item

List item