4.10

Conclusion

In this chapter, we learned how some of the features present in Elm enable us to write reliable and maintainable programs. Much of that reliability comes from immutable values, pure functions, and a powerful type system. These three features are at the core of some of Elm’s truly exciting features such as the Elm Architecture and an amazing debugger which makes reproducing bugs quite easy.

Organizing functions, constants, type definitions, and other values in Elm is relatively easy through the use of modules. Once created, modules can be shared with other programmers first by including them in a package and then publishing the package on the online catalog.

Elm also mitigates the “dependency hell” problem by automatically enforcing semantic versioning on all packages published on its online catalog. Elm’s package manager makes sure that we’ll never run into a breaking API change again when we install a patch.

Elm encourages us to identify important properties of our programs and then use fuzz testing to make sure those properties do hold true for a wide variety of inputs. It also offers traditional unit tests if we feel the need to supplement our test suite with tests that provide better documentation and cover tricky edge cases.

Finally, Elm lets us reach deep into our data structures and match complex patterns, enabling us to write compact yet readable code. In the next chapter, we’ll learn the Elm Architecture in detail and find out how it helps us build robust front-end web applications.

Back to top
Close