← Back to Podcast

Episode 14 - AI Code Generation Works Best Within Strict Boundaries

How AI tools like Claude and Cursor perform when generating code for event-sourced systems

Episode Summary

Martin and Adam explore their experiences with AI-powered code generation, revealing that AI performs remarkably well when constrained by event modeling’s clear specifications. They discuss nightmares from AI hallucinations in unstructured contexts versus the reliability achieved when AI works within event modeling boundaries. The episode emphasizes why expert human guidance remains essential despite AI capabilities.

Main Discussion Points

  • AI Within Boundaries: How event modeling’s structured specifications eliminate the ambiguity that causes AI hallucinations
  • Code Generation Success Stories: Real examples of AI tools generating accurate implementations from given-when-then timelines
  • AI Nightmares: Cases where AI goes off the rails without proper constraints and clear specifications
  • Expert Guidance Still Needed: Why even with great AI tools, organizations still need human experts to guide adoption and architecture decisions
  • Prompt Engineering: Techniques for effectively communicating with AI tools to generate event-sourced code
  • Future of Development: How AI changes the role of developers from writing boilerplate to designing systems and reviewing generated code

Key Takeaways

AI code generation achieves remarkable accuracy when working within event modeling’s well-defined boundaries. The structured nature of given-when-then specifications, clear event schemas, and predictable patterns provide AI tools with the unambiguous input they need to avoid hallucinations. However, AI cannot replace expert guidance in architecture decisions, pattern selection, or organizational adoption strategies. The future developer role shifts toward system design, specification, and quality assurance rather than manual coding of predictable patterns.

Memorable Quotes

  1. “Event modeling itself is not enough you need basically you need the organizational support to provide the right environment for it to work” - Martin
  2. “If there is no one who takes care of the agenda of the meeting um if there are many more developers they go down the rabbit hole to discuss implementation” - Martin
  3. “The problem is not the developers the problem is not the teams the problem is the the whole environment” - Martin
  4. “Looking at just um information flow I think event modeling and event sourcing are the proof of the opposite that we don’t have code reviews we don’t have these coding you know standard practices” - Adam
  5. “Your best practices have to shift” - Adam

Key Learnings

  1. Successfully implementing event modeling requires organizational support and proper facilitation - you can’t just tell teams to do it without guidance
  2. Without experienced facilitation, event modeling sessions derail as developers discuss implementation details or business people lose themselves in business discussions
  3. The environment and system structure matters more than individual developer quality - a good system makes average developers effective
  4. Best practices from traditional development (like extensive code reviews, DRY principles) don’t apply the same way in event-sourced slice architectures
  5. Expert help is essential for learning fundamentally new approaches - reading books and taking courses alone isn’t sufficient for successful adoption at scale

Ready to Learn More?

Explore Event Modeling and Event Sourcing in depth with our tutorials and book.

Join our Event Modeling Workshop to get hands-on experience.

Want to learn how to apply Event Modeling and Event Sourcing in practice?

Follow the Online Course “Implementing Eventsourcing” - comes with a Lifetime Event Modeling Toolkit License.

Start Learning →