A debugging carol by Emil Hernvall

December 8, 2021

In A debugging carol by Emil Hernvall, the character Scrooge is visited by his nephew, who invites him to a functional programming workshop to improve his team’s software development. Scrooge initially resists, focusing on fixing a null pointer exception and criticizing his team’s lack of quality and resistance to learning new languages. His nephew argues for the value of any language and teamwork, but Scrooge becomes defensive. Later, he encounters the ghost of his former friend and teammate, Marley, who reveals the team’s failed deliverables led to Marley’s firing and his becoming a manager. This encounter leaves Scrooge with a sense of dread and newfound appreciation for teamwork and communication. In another part of the video, Scrooge reflects on the past, present, and future of software development, encountering ghostly developers representing different eras. The first shows him past issues with global state and maintenance problems. The second criticizes his current stagnation and lack of passion. The third introduces him to functional programming and its benefits. Scrooge debates the merits of imperative and functional programming, reflecting on the evolution of programming, specifically the use of globals and concurrency. Later, Scrooge discusses programming issues with a lactose intolerant man, reflecting on the importance of modern programming techniques and tools like algebraic data types, pattern matching, static typing, and functional programming. They discuss the benefits of catching errors at compile time and reducing mistake cases. Despite challenges like tricky algorithms, misunderstood requirements, and the complexity of asynchronous coding, the speaker expresses his conviction that functional programming is gaining ground and tools like OCaml and PureScript can help solve programming problems.

A debugging carol: A comprehensive overview

The invitation and the initial refusal

The story begins with Scrooge being visited by his enthusiastic nephew, who invites him to a functional programming workshop. The nephew hopes to spark some inspiration in Scrooge and help him improve his team’s software development practices. However, Scrooge is too preoccupied with fixing a null pointer exception, frustrated by his team’s lack of quality, and dismissive of new programming languages. He sees no value in attending the workshop, arguing that his problems can’t be solved by learning another language. His nephew counters, insisting that valuable ideas can be found in any language and that Scrooge doesn’t need to change languages to make improvements. Despite this, Scrooge remains defensive and uninterested, eventually dismissing the idea entirely.

 

The ghost of development past

After a frustrating day, Scrooge returns home, only to be visited by the ghost of his former friend and teammate, Marley. Marley, now burdened by the consequences of poor teamwork and failed projects, warns Scrooge about the dangers of ignoring best practices and the importance of communication in software development. This encounter leaves Scrooge with a sense of dread and regret, setting the stage for the visits from the three ghostly developers.

The first ghost takes Scrooge on a journey back to his early days in programming. They revisit a drawing program Scrooge had written in C, plagued by global state issues that made maintenance a nightmare. Scrooge admits the mistakes of his past, but justifies them by saying that many programs from that era were written in a similar fashion. The ghost’s lesson is clear: while those methods were once the norm, they are no longer suitable for modern software development.

 

The ghost of development present

Next, Scrooge is visited by the Ghost of Development Present. This ghost shows Scrooge how he has stagnated in his career, clinging to outdated practices and losing his passion for the craft. The ghost emphasizes the importance of staying current with evolving programming techniques, highlighting how Scrooge’s resistance to change is holding his team back. The ghost points out that while Scrooge may have once been an expert, his reluctance to adopt new methodologies has caused him to fall behind. This haunting experience forces Scrooge to confront the reality of his situation: his outdated approaches are leading to poor outcomes, both for himself and his team.

 

The ghost of development future

Finally, Scrooge is visited by the Ghost of Development Future, who introduces him to the world of functional programming. The ghost explains the benefits of composability, the lack of shared state, and the power of algebraic data types and pattern matching. Scrooge, initially skeptical, debates the merits of imperative versus functional programming with the ghost. However, as the discussion progresses, Scrooge begins to see the potential of these modern approaches, especially in handling concurrency and minimizing errors at compile time.

The ghost also highlights the resurgence of static typing and the growing popularity of property-based testing. Despite the challenges that remain — such as tricky algorithms, misunderstood requirements, and the complexity of asynchronous coding — Scrooge starts to appreciate the advantages of functional programming. The ghost suggests that tools like OCaml and PureScript could help Scrooge’s team solve their programming problems more effectively.

 

A new beginning for Scrooge

By the end of these visits, Scrooge is transformed. He no longer sees programming as a static field where one can rely solely on old knowledge. Instead, he recognizes the importance of continuous learning, adapting to new paradigms, and fostering a culture of collaboration and open-mindedness within his team.

The next day, Scrooge takes a bold step. He revisits his nephew’s invitation to the functional programming workshop and decides to attend, eager to explore new ideas and methodologies. He also begins to rethink his team’s development process, considering the integration of optional types, monads, and other modern programming techniques. Scrooge is no longer resistant to change; instead, he embraces it, understanding that the evolution of software development is not a threat but an opportunity.

 

Conclusion: Embracing the future of programming

A Debugging Carol is a creative and thought-provoking exploration of the challenges many developers face today. Through the character of Edgar Scrooge, Emil Hernvall reminds us that the world of programming is always evolving, and those who wish to succeed must be willing to evolve with it. Whether it’s embracing new languages, refining best practices, or simply staying open to new ideas, the lesson is clear: change is inevitable, and those who adapt will thrive. Just like Scrooge, we must learn from the past, engage with the present, and prepare for the future if we are to continue building better, more robust software.

 

Additional resources

Check out more from the MeetUp Func Prog Sweden. Func Prog Sweden is the community for anyone interested in functional programming. At the MeetUps the community explore different functional languages like Erlang, Elixir, Haskell, Scala, Clojure, OCaml, F# and more.