Rock the JVM thumbnail

Rock the JVM

Robert Martin on Clojure, AI, Programming Languages and the Craft of Good Code

Embracing the Craft of Programming in the Age of AI: Insights from Uncle Bob Martin

In a captivating and wide-ranging conversation, Daniel sits down with Robert "Uncle Bob" Martin, a veteran software engineer with over 50 years of experience and author of seminal books like Clean Code and Clean Architecture. Their discussion spans the evolution of programming languages, the philosophy of software craftsmanship, the role of testing versus static typing, and the emerging challenges and opportunities brought about by AI in programming. Below, we distill key takeaways and reflections from their dialogue that every programmer—newcomer or seasoned—can benefit from.


Rediscovering Simplicity: Why Uncle Bob Loves Clojure

Despite his extensive background spanning assembly, C, C++, Java, and more, Uncle Bob shares his affinity for Clojure, a Lisp dialect running on the JVM. His journey began with reading Structure and Interpretation of Computer Programs (SICP), which challenged his preconceptions about code and introduced him to functional programming without assignment statements—a paradigm shift that captivated him.

He appreciates Clojure’s minimal syntax and maximal expressiveness, contrasting it with verbose languages laden with static typing constraints. For Uncle Bob, the freedom to express ideas succinctly without the rigidity of complex static type systems outweighs potential risks, especially given his seasoned discipline and reliance on rigorous testing.


The Dynamic Typing vs. Static Typing Debate: Lessons from Decades of Experience

Uncle Bob offers a nuanced perspective on static typing. While the industry has embraced static type systems like those in C++ and Java for safety, he recounts how the increasing complexity of generics and type features often led to cumbersome and error-prone code. His experience revealed that static typing did not eliminate bugs or debugging time as much as disciplined unit testing did.

He advocates for a balanced approach:

  • Testing as Dynamic Type Checking: Writing comprehensive unit tests serves as an effective guardrail, dynamically ensuring data structures and behavior conform to expectations.
  • Selective Use of Dynamic Specs: Libraries like Clojure’s spec allow for dynamic yet disciplined type checks, offering flexibility without sacrificing correctness.
  • Avoiding Debugging Rat Holes: The ultimate productivity killer is debugging. Anything that prevents or shortens debugging—be it tests or type checks—is valuable.

This approach provides many of the guarantees of static typing while preserving the flexibility to adapt and evolve code more freely.


The Elusive Quest for Software Correctness: A Scientific, Not Mathematical, Endeavor

Reflecting on the work of Edsger Dijkstra, Uncle Bob highlights the enduring challenge of proving software correctness mathematically. Despite decades of research, software remains more akin to a science than pure mathematics—where falsification through testing and experimentation is the norm, rather than absolute proof.

This scientific view embraces skepticism and continuous validation, recognizing that absolute certainty in software correctness is elusive. Tests, reviews, and iterative refinement form the practical toolkit programmers rely upon.


Staying Grounded: The Value of Understanding Low-Level Fundamentals

Uncle Bob emphasizes the importance of periodically revisiting foundational technologies like assembly language or C—not for day-to-day work, but to stay connected to the roots of computing. This practice:

  • Reminds programmers of the machine’s fundamental workings.
  • Helps maintain a discipline and appreciation for efficient, well-structured code.
  • Provides historical context that enriches understanding of modern abstractions.

He encourages newcomers and veterans alike to engage with the history and low-level details of computing to deepen their craft.


Navigating the AI Revolution: The Programmer’s New Role as Prompt Engineer and Guardian

The conversation turns to AI’s growing role in software development. Uncle Bob welcomes AI tools like GitHub Copilot as productivity aids but warns against blind trust:

  • Maintain Control: Programmers must scrutinize AI-generated code meticulously, ensuring it aligns with design principles and expectations.
  • Writing Tests Remains Crucial: He insists programmers write their own tests rather than relying on AI-generated tests, to avoid replicating bugs.
  • The Importance of Prompt Engineering: Crafting precise, structured prompts will become a key skill—akin to legal drafting—to guide AI effectively.
  • Future Outlook: While enthusiasm for AI is high, Uncle Bob predicts that fully trusting AI-generated code without human oversight is decades away, given current limitations and resource constraints.

Ultimately, programmers will transition into roles resembling "machine lawyers" or "machine psychologists," deeply understanding and supervising AI behavior rather than being replaced by it.


Timeless Principles of Software Craftsmanship Persist

Despite technological upheaval, Uncle Bob asserts that core principles of good software design remain constant:

  • Separation of Concerns
  • Meaningful Naming
  • Low Coupling and High Cohesion
  • Clear Organization

Whether coding in assembly, Clojure, or crafting structured prompts for AI, these principles guide maintainable, understandable code. He draws parallels between these concepts and legal drafting, underscoring their universality.


Internalizing Craftsmanship: The Role of Reading, Mentorship, and Apprenticeship

How does one truly internalize these principles? Uncle Bob offers several insights:

  • Read Widely and Deeply: Engage with classic and contemporary literature—from The Art of Computer Programming to Design Patterns and Refactoring—to absorb foundational ideas.
  • Learn from Experienced Mentors: Apprenticeship and working alongside seasoned programmers accelerates understanding and filters out the "churn" of fleeting trends.
  • Embrace Mistakes as Teachers: Whether through mentorship or trial and error, learning values and craftsmanship is a gradual process.
  • Resist Quick Fixes: Beware of boot camps or short courses that promise mastery without depth.

Evolving Views on Testing and Function Size

Uncle Bob acknowledges that his thinking on certain practices has matured over time:

  • While still a strong advocate for Test-Driven Development (TDD), he recognizes scenarios where writing tests first may not be practical.
  • He has softened rigid rules on function size, noting that overly fragmented code can increase coupling and obscure logic.

This willingness to adapt reflects a mature craftsman’s mindset—principled yet pragmatic.


The Power of Passion and Engagement in Teaching

Beyond programming, Uncle Bob shares his passion for teaching, cultivated since childhood and influenced by great communicators like Richard Feynman and even comedians like Bill Cosby (notwithstanding later controversies). His advice to aspiring teachers:

  • Have Fun: Genuine enthusiasm is contagious and engages learners.
  • Practice Delivery: Refine how you communicate ideas for clarity and impact.
  • Be Authentic: Let personality shine through to create memorable experiences.

Final Wisdom: Don’t Fear the Future, Be Great

To conclude, Uncle Bob leaves us with a simple yet powerful message:

“Don’t be afraid of the future. Be great.”

In an era of rapid change and AI disruption, the call is to embrace growth, uphold craftsmanship, and continue striving for excellence.


Recommended Reading List from Uncle Bob

For those seeking to deepen their programming craft, Uncle Bob recommends:

  • The Art of Computer Programming by Donald Knuth
  • Structured Systems Analysis by Tom DeMarco
  • Design Patterns by Gamma, Helm, Johnson, and Vlissides
  • Structure and Interpretation of Computer Programs by Abelson and Sussman
  • Refactoring by Martin Fowler
  • Analysis Patterns by Martin Fowler
  • A Philosophy of Software Design by John Ousterhout

These classics provide a rich foundation that bridges past wisdom with modern practice.


In Summary

This conversation with Uncle Bob Martin offers a profound reflection on the enduring art of programming amidst evolving languages and AI advances. His perspectives challenge us to balance discipline with flexibility, embrace testing as a cornerstone of quality, remain grounded in fundamentals, and approach AI as a powerful tool—never a replacement—for human creativity and judgment.

For programmers at any stage, the path forward is clear: continue honing your craft, engage deeply with timeless principles, and face the future without fear.


If you found these insights valuable, consider exploring Uncle Bob’s books and talks to enrich your journey in software craftsmanship.

← Back to Rock the JVM Blog