My Technological Regrets

TL;DR: Haskell good. TDD good. SPA bad. Complexity bad. Bad thinking bad.

My [technical] thoughts on which software engineering choices could have been made differently for our project and why.

21 Likes

This was great ! The TLDR undersells it. Thanks for sharing these lessons learned, I took mental notes.

1 Like

Great write up!

I am a web developer and using Elixir as my daily programming language, but keep Haskell in my mind.

We transformed a traditional CRUD system into an Event Sourcing style system for auditing purposes. However, we somewhat regret this decision for several reasons: our web application became stateful, the aggregate is now in-memory and ephemeral, we have to deal with eventual consistency, testing has become more challenging, and commands and events are leaking everywhere.

Regarding “Over-Reliance on PostgreSQL Slowed Development,” Elixir’s database abstraction, Ecto, offers a “Sandbox mode” for database testing that allows tests to run in parallel and can be disabled when needed. I think wrap each test in a transaction which is rolled back at the end is a good strategy for this kind of testing.

The Elixir team continues to prioritize speed in building and testing processes. The standard test framework, ExUnit, allows for the distribution of test cases across different runners, and improvements in compiler performance in previous versions have enhanced this capability. With parallel database testing, we can run CI on large codebases within an acceptable time. I hope to see similar advancements in the Haskell ecosystem, and I believe Mercury has significantly contributed to GHC HQ in this area.

Lens. With OverloadedRecordDot and OverloadedRecordUpdate (which still require some boilerplate), the need for using lenses in CRUD applications is decreasing. However, I believe that lenses and functional options are still valuable when working with nested immutable data structures. Elixir’s kernel (similar to Haskell’s Prelude) provides functions like get_in, update_in, and put_in for handling these scenarios. If you’re concerned about error messages, the optics library may be a better option.

Thank you again for sharing your valuable experience.

10 Likes