<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Justin Rich on Medium]]></title>
        <description><![CDATA[Stories by Justin Rich on Medium]]></description>
        <link>https://medium.com/@justinrich?source=rss-ac582212e474------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4VmPFS7VhL_OPNS3i_t-Vg.jpeg</url>
            <title>Stories by Justin Rich on Medium</title>
            <link>https://medium.com/@justinrich?source=rss-ac582212e474------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:31:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@justinrich/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mastra Agent System Review: A Fresh Take on AI Development]]></title>
            <link>https://justinrich.medium.com/mastra-agent-system-review-a-fresh-take-on-ai-development-04ca3e8e3a1b?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/04ca3e8e3a1b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devtools]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 16:19:00 GMT</pubDate>
            <atom:updated>2025-06-17T16:19:00.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L29nvJi2X05IbZ7m.png" /></figure><p>After working extensively with both <a href="https://www.langchain.com/">LangChain</a> and <a href="https://mastra.ai/en/docs">Mastra</a>, I’ve found Mastra to be a refreshingly straightforward approach to building AI applications. While LangChain dominates the market, Mastra offers several compelling advantages that make it worth serious consideration, especially for JavaScript-first teams.</p><h3>Lightweight and Transparent Architecture</h3><p>Mastra uses the <a href="https://ai-sdk.dev/docs/introduction">Vercel AI SDK</a> for all LLM interactions rather than building its own abstraction layer, creating a notably lightweight feel compared to LangChain’s dense abstractions.</p><p><strong>LangChain approach:</strong></p><pre>import { ChatOpenAI } from &quot;@langchain/openai&quot;;<br>import { AgentExecutor, createOpenAIFunctionsAgent } from &quot;langchain/agents&quot;;<br>import { pull } from &quot;langchain/hub&quot;;<br><br>const llm = new ChatOpenAI({ temperature: 0 });<br>const prompt = await pull(&quot;hwchase17/openai-functions-agent&quot;);<br>const agent = await createOpenAIFunctionsAgent({ llm, tools, prompt });<br>const agentExecutor = new AgentExecutor({ agent, tools });</pre><p><strong>Mastra approach:</strong></p><pre>import { openai } from &#39;@ai-sdk/openai&#39;;<br>import { Mastra } from &#39;@mastra/core&#39;;<br>import { myTool } from &#39;../tools&#39;;<br><br>const mastra = new Mastra({<br>  agents: [{<br>    name: &#39;assistant&#39;,<br>    model: openai(&#39;gpt-4&#39;),<br>    tools: [myTool]<br>  }]<br>});</pre><p>You know exactly what’s happening: your input goes through clear, documented functions to execute LLM calls. When debugging, you’re not diving through layers of abstractions to understand execution paths.</p><h3>JavaScript-First Development</h3><p>Mastra is built natively for TypeScript, while LangChain’s JavaScript version often requires workarounds.</p><p><strong>LangChain type issues:</strong></p><pre>// Often requires &#39;as&#39; casting to overcome type conflicts<br>const tool = new SomeBaseTool({<br>  description: &quot;A tool&quot; as string, // shouldn&#39;t need this<br>  name: &quot;myTool&quot; as any // brittle workaround<br>});</pre><p><strong>Mastra clean types:</strong></p><pre>// Types work seamlessly<br>const myTool = {<br>  name: &#39;myTool&#39;,<br>  description: &#39;A tool&#39;,<br>  parameters: z.object({<br>    query: z.string()<br>  })<br>};</pre><p>This native TypeScript approach reduces runtime errors and makes development more confident and productive.</p><p>Additionally using <a href="https://zod.dev/">Zod</a> for structured input/output typechecking is a common utility in Typescript used by several other TS frameworks like <a href="https://trpc.io/">TRPC</a> and <a href="https://ts-rest.com/">TS-Rest</a>. While LangChain also uses Zod for structured output, how Mastra uses it in tool/workflow definitions felt more first class and straight forward for planning/executing agentic dataflows.</p><h3>Functional Core, Object Shell</h3><p>Mastra is more functional because it cleanly separates data from behavior, following the “functional core, imperative shell” pattern.</p><p><strong>LangChain mixes logic with class inheritance:</strong></p><pre>class WeatherTool extends BaseTool {<br>  async _call(location) {<br>    // Logic mixed with inherited state and methods<br>    const result = this.processLocation(location); // where does this come from?<br>    return this.formatResponse(result); // what does this do?<br>  }<br>}<br><br>// Testing requires understanding the full inheritance chain<br>test(&#39;weather tool&#39;, async () =&gt; {<br>  const tool = new WeatherTool();<br>  // Must set up complex class state and mock inherited methods<br>  const result = await tool._call(&#39;Seattle&#39;);<br>});</pre><p><strong>Mastra separates concerns:</strong></p><pre>// Pure function - business logic isolated<br>const weatherHandler = (location) =&gt; fetchWeather(location);<br><br>// Object as data container - no behavior inheritance<br>const weatherTool = {<br>  name: &#39;weather&#39;,<br>  description: &#39;Gets weather data&#39;,<br>  handler: weatherHandler // function is separate, composable<br>};<br><br>// Testing the pure function directly<br>test(&#39;weather handler&#39;, async () =&gt; {<br>  const result = await weatherHandler(&#39;Seattle&#39;);<br>  expect(result).toEqual({ temp: 65, condition: &#39;cloudy&#39; });<br>});</pre><p>In Mastra, configuration lives in objects (which is just data) while business logic lives in pure handler functions. Classes become lightweight containers rather than behavior carriers. This makes code more predictable because you’re not inheriting both data AND behavior from parent classes — you’re composing pure functions with simple data structures.</p><p>The result: you can test weatherHandler as an isolated function instead of instantiating classes and figuring out what inherited methods like processLocation actually do.</p><h3>Workflow and Agent Pattern Distinction</h3><p>Mastra makes a clear architectural distinction between deterministic and probabilistic problem-solving approaches.</p><p><strong>Mastra workflow (deterministic):</strong></p><pre>const workflow = new Workflow({<br>  name: &#39;support-ticket&#39;,<br>  steps: [<br>    step(&#39;validate&#39;).then(&#39;categorize&#39;),<br>    step(&#39;categorize&#39;).then(&#39;assign&#39;),<br>    step(&#39;assign&#39;).then(&#39;route&#39;)<br>  ]<br>});</pre><p><strong>Mastra agent (probabilistic):</strong></p><pre>const researchAgent = new Agent({<br>  name: &#39;researcher&#39;,<br>  model: openai(&#39;gpt-4&#39;),<br>  tools: [webSearch, dataAnalysis, reportGenerator],<br>  // Agent decides which tools to use and when<br>});</pre><p><strong>Hybrid approach:</strong></p><pre>const hybridWorkflow = new Workflow({<br>  steps: [<br>    step(&#39;intake&#39;).then(&#39;research&#39;),<br>    step(&#39;research&#39;).tools([webSearch, dataAnalysis]), // Limit agent tools per step<br>    step(&#39;review&#39;).then(&#39;finalize&#39;)<br>  ]<br>});</pre><p><strong>Practical Examples:</strong></p><p><em>Deterministic Problem (Use Workflow):</em> Processing a customer support ticket through defined stages — intake validation, category classification, priority assignment, and routing to appropriate team. Each step has clear success/failure criteria and predictable next steps.</p><p><em>Probabilistic Problem (Use Agent):</em> Researching market trends for an investment decision where the agent needs to dynamically choose which data sources to consult, what questions to ask, and how to synthesize conflicting information based on emerging patterns.</p><p>Mastra’s ability to filter available tools at different workflow steps enables a hybrid approach — you can solve some problems probabilistically by restricting which tools an agent can access at each deterministic workflow stage. This provides the reliability of workflows with the flexibility of agents when needed.</p><h3>Performance and Maintainability Benefits</h3><p>The functional approach and clear separation of concerns translate to real-world benefits:</p><p><strong>Testing:</strong> Pure functions are easier to unit test than complex class hierarchies. You can test individual workflow steps or agent behaviors in isolation.</p><p><strong>Debugging:</strong> When something goes wrong, you’re debugging clear function calls rather than investigating inheritance chains or hidden class state.</p><p><strong>Maintenance:</strong> Code changes have more predictable impacts when you’re modifying functions rather than altering class behavior that might affect unknown subclasses.</p><h3>Conclusion</h3><p>I’m not suggesting developers should categorically avoid LangChain or that Mastra surpasses it in every dimension. LangChain has a mature ecosystem, extensive integrations, and proven production deployments. However, my experience with Mastra has been notably more enjoyable and productive.</p><p>Since Mastra is JavaScript-native, it feels significantly more accessible to developers already working in the JavaScript ecosystem. The combination of transparent architecture, clean TypeScript support, and thoughtful separation between deterministic workflows and probabilistic agents allows me to solve both types of problems with greater confidence.</p><p>For teams prioritizing developer experience, code maintainability, and clear architectural patterns, Mastra represents a compelling alternative that’s worth serious evaluation alongside LangChain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04ca3e8e3a1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Breakfast Manifesto: Rebuilding Startup Culture Without the Burnout]]></title>
            <link>https://justinrich.medium.com/the-breakfast-manifesto-rebuilding-startup-culture-without-the-burnout-eb6932b4407d?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb6932b4407d</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[management-and-leadership]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Mon, 19 May 2025 18:55:41 GMT</pubDate>
            <atom:updated>2025-05-19T18:55:41.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M6yDI08y_oeGdCZhcwcXMg.png" /></figure><h3>I. Introduction: Corporate Trauma and Startup Reality</h3><p>I’ve worked at companies so large they had their own zip codes, and startups so small we shared a desk with the office dog. And let me tell you something weird I’ve noticed: the phrase “work like a startup” is wielded like a medieval torture device in both. It’s the corporate equivalent of when your dad said “because I said so.” It’s not a methodology; it’s a threat.</p><p>You know what happens when people hear “work like a startup” enough times? The same thing that happens when you put a hamster in one of those balls and push it down the stairs. Sure, it’ll move really fast for a while, but eventually it’s going to stop moving altogether, and you’re going to feel terrible about the whole experiment.</p><p>What’s fascinating is that when companies fail, everyone points fingers at the product. “The market wasn’t ready.” “The feature set wasn’t complete.” But I’ve sat in enough windowless conference rooms eating sad sandwiches to know the truth: it’s almost never the product that fails first. It’s the organization. The product is just the innocent bystander who gets chalk-outlined.</p><h3>II. The Chicken and Pig Analogy: More Than Just Breakfast</h3><p>There’s this old agile parable that perfectly captures why our teams keep imploding. A chicken and a pig are strolling down the street when they spot a diner with a sign: “Breakfast Special: Ham and Eggs — $5.99!” The chicken gets all entrepreneurial and says, “Hey! That’s us on the menu! We should go into business together!”</p><p>The pig looks at the chicken the way you look at someone who suggests splitting the check evenly when they ordered three appetizers and you had tap water. “Easy for you to say,” the pig replies. “For you, it’s just a contribution. For me, it’s a total commitment.”</p><p>This isn’t just farm animal banter. This is the fundamental tension of every product team you’ve ever been on. Some people are involved. Others are committed. And the failure to recognize this distinction is why your company keeps having those awful all-hands meetings where the CEO talks about “pivoting” while staring at the floor.</p><h3>III. Been Both Barnyard Animals: A Dual Perspective</h3><p>Here’s where things get interesting. I’ve lived both lives in product development’s animal kingdom, but in reverse order of what you might expect. I started as a product manager — the quintessential chicken. I was involved in everything but ultimately committed to nothing specific. I could say things like, “What if we tried…” or “Have we considered…” and then wander off to another meeting while engineers stared at each other like they’d just been asked to build a time machine out of paperclips.</p><p>Then I made the unusual migration and became an engineer — transforming into the pig. Suddenly I was fully committed, inseparable from the outcome. My code either worked or it didn’t. There was nowhere to hide. I couldn’t say, “Let’s circle back on that bug next quarter.” The compiler doesn’t care about your quarterly planning.</p><p>It’s like when you go from being a sports commentator to actually playing in the game. As a product manager, I could analyze and strategize all day. As an engineer, I had to execute. One miss and the whole team feels it.</p><p>This reverse journey taught me something critical: the tension between chickens and pigs isn’t just inevitable; it’s necessary. But it has to be acknowledged and respected, or you end up with resentful pigs and clueless chickens. And nobody wants breakfast at that diner.</p><h3>IV. Misalignment: The Silent Startup Killer</h3><p>Here’s what no one tells you in those gleaming VC pitch decks: organizations don’t die from bad product ideas. They die from misalignment. It’s like those stories where a couple gets divorced and when asked why, they say, “We grew apart.” What they really mean is, “We stopped having systems to stay connected.”</p><p>In Malcolm Gladwell terms, this is the “tipping point” where normal startup friction transforms into organizational cancer. The chickens and pigs stop seeing themselves as part of the same breakfast special. Instead, they’re just animals trapped in the same overcrowded barn, each convinced the other is making their life miserable.</p><p>You see it in the engineering team that builds features nobody asked for. In the product team that promises impossible deadlines. In the leadership team that changes direction every two weeks while expecting implementation to happen instantaneously. These aren’t product failures — they’re alignment failures. And they’re completely preventable.</p><p>The reason “work like a startup” becomes toxic is because it’s typically code for “ignore the systems you need to function.” It’s like telling someone to drive like a race car driver but removing their steering wheel. The goal isn’t the problem; it’s the lack of infrastructure to achieve it safely.</p><h3>V. Agile: Not Just Meetings, But Communication Architecture</h3><p>When people roll their eyes at “agile,” they’re missing the point spectacularly. Agile isn’t a collection of annoying meetings that prevent you from doing “real work.” It’s communication architecture — a deliberate system designed to create alignment between chickens and pigs without everyone losing their minds.</p><p>Sprint planning, daily standups, retrospectives — these aren’t bureaucratic time-wasters. They’re alignment machines. They’re the farm-to-table restaurant where chickens and pigs collaborate on what breakfast should look like before anyone fires up the stove.</p><p>The magic happens when you recognize that different stakeholders need different touchpoints. Weekly stakeholder meetings prevent chickens from randomly swooping in with “urgent” requests that derail the entire farm. Sprint demos give chickens appropriate venues to provide feedback without crawling into the code. Daily standups help pigs coordinate without constant chicken interruption.</p><p>But there’s a subtle brilliance to well-implemented agile that most people miss: it makes alignment visible. When the sales team promises a feature that’s not on the roadmap, good agile processes don’t just say “no” — they show the tradeoffs. “If we do that, here’s what comes out.” It transforms abstract chicken wishes into concrete pig realities.</p><p>The companies that scale without burning everyone out aren’t the ones working 80-hour weeks. They’re the ones who’ve built communication systems that scale with the organization. Because as any marriage counselor will tell you, it’s not lack of love that kills relationships — it’s lack of systems to stay connected when things get complicated.</p><h3>VI. The Timeline Coup: Why Pigs Must Seize the Clock</h3><p>Let’s address the elephant in the barnyard: deadlines. In the vast majority of failing organizations, timeline authority sits firmly with the chickens. Product managers, executives, and sales teams set dates with the casual confidence of people who won’t be pulling all-nighters to meet them.</p><p>This isn’t just unfair — it’s unsustainable. It’s like having someone who’s never cooked set the dinner timeline. “Twenty-minute beef Wellington? Sure, that sounds reasonable!” The resulting mess is entirely predictable.</p><p>The organizations that thrive are the ones who’ve engineered a timeline coup — transferring deadline authority from chickens to pigs. This doesn’t mean engineers get to disappear for years like they’re building Duke Nukem Forever. It means their expertise about what’s possible becomes the foundation of planning, not an inconvenient footnote.</p><p>In practice, it looks like this: Product articulates the business need and relative priority. Engineering determines the timeline and approach. Together they negotiate scope. Notice who owns which piece — the chicken doesn’t set the timeline, and the pig doesn’t determine the business priority.</p><p>This works because it respects the natural order of the barnyard. Chickens are excellent at identifying which breakfast items will sell. Pigs are uniquely qualified to determine how long those items take to prepare. When either animal steps into the other’s territory, disaster follows.</p><p>The companies I’ve seen escape the startup burnout cycle all have this trait in common: they’ve created systems where the people doing the work have meaningful influence over how and when that work happens. Not unlimited authority — but a voice proportional to their commitment.</p><h3>VII. Scaling Systems, Not Just Headcount</h3><p>As companies grow, the instinct is always to add more chickens. More product managers! More program managers! More coordinators to coordinate the coordinators! The result is predictable: noise increases while velocity decreases.</p><p>The alternative isn’t eliminating chickens — it’s building systems that scale with headcount. It’s creating frameworks where alignment happens naturally without requiring a 1:1 ratio of managers to makers.</p><p>What does this look like in practice? Tiered planning processes where high-level alignment happens quarterly, with autonomy for teams to execute within established guardrails. Clear escalation paths when conflicts arise. Decision frameworks that explicitly state who has input versus decision rights.</p><p>The best scaling companies create what Gladwell might call “sticky systems” — processes that become self-reinforcing because they clearly benefit everyone involved. Chickens get more predictable delivery. Pigs get more focused work time. The organization gets sustainable growth instead of burnout and churn.</p><p>These systems are never perfect and always evolving. But they share a common trait: they’re designed with the explicit recognition that different team members have different levels of commitment, and that this fundamental truth won’t change no matter how much you invoke startup mythology.</p><h3>VIII. The Sustainable Startup: Building to Last</h3><p>The great irony is that the companies most obsessed with “working like a startup” are the ones least likely to become sustainable businesses. They’re the organizational equivalent of crash dieters — they might drop weight fast, but they’re setting themselves up for spectacular failure in the long run.</p><p>True startup success comes from building systems that acknowledge the chicken/pig dynamic while creating alignment that scales. It’s not about eliminating differences between team members — it’s about creating infrastructure that turns those differences from weaknesses into strengths.</p><p>The startups that escape the burnout trap aren’t the ones with the most dedicated employees or the most brilliant products. They’re the ones who’ve built organizations where alignment is baked into everyday operations. Where chickens and pigs understand and respect their different roles. Where systems prevent the misalignment that kills companies long before product-market fit becomes relevant.</p><p>So the next time someone tells you to “work like a startup,” ask them which part they mean. The sleepless nights and inevitable burnout? Or the intentional communication systems that turn different levels of commitment into a strength rather than a liability?</p><p>Because the truth is, organizations don’t fail because their products are bad. They fail because they never built systems that could withstand the natural tension between involvement and commitment. And no amount of bacon or eggs can fix that once it’s broken.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb6932b4407d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Can’t Someone Else Do It?” — Why Engineers Aren’t Using AI Coding Tools (And Why They Should)]]></title>
            <link>https://justinrich.medium.com/cant-someone-else-do-it-why-engineers-aren-t-using-ai-coding-tools-and-why-they-should-901ffc0d208a?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/901ffc0d208a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-tools]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Mon, 05 May 2025 20:57:48 GMT</pubDate>
            <atom:updated>2025-11-10T00:22:59.145Z</atom:updated>
            <content:encoded><![CDATA[<h3>“Can’t Someone Else Do It?” — Why Engineers Aren’t Using AI Coding Tools (And Why They Should)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xO1qVoEamejnHpeQM2ttyw.jpeg" /></figure><h3>The Simpson’s Sanitation Commissioner Syndrome</h3><p>Picture this: Homer Simpson, our favorite nuclear safety inspector (a job title that should terrify us all), decides the garbage men in Springfield aren’t doing their job properly. After a heated exchange with the sanitation workers who refuse to pick up his overflowing trash, Homer launches a vengeful campaign to become Sanitation Commissioner. His entire platform? <a href="https://www.youtube.com/watch?v=QDYF_nu2I4M">“Can’t someone else do it?”</a></p><p>It’s a perfect encapsulation of our collective desire to offload repetitive tasks — a sentiment that drives much of technological progress. And yet, paradoxically, many AI engineers — the very people building these labor-saving tools — aren’t using them effectively in their own workflows.</p><p>I’m not saying we’re all Homer Simpson, promising the moon and then hiding when the garbage piles up… but also, are we not exactly Homer Simpson? Think about it: we’re building AI to automate tasks, then stubbornly refusing to let those same tools help us write code.</p><h3>The Social Adoption Gap</h3><p>This resistance isn’t about technology — it’s about mental habits. It reminds me of my dad, who will drive to REI six separate times to look at the same camping tent, circling it like a wary predator, without ever considering that he could compare models online in minutes. It’s not that he can’t use websites — he just doesn’t think to start there.</p><p>The technology exists, but the mental model — the ingrained pattern of problem-solving — hasn’t shifted. We’re creatures of habit, and changing how we approach problems is harder than learning new technical skills.</p><p>When my dad needs a specific piece of camping gear, he’ll spend an entire Saturday driving between outdoor shops instead of thirty seconds using a comparison tool online. Not because he can’t use the internet (he can), but because his brain doesn’t default to that solution path.</p><p>This is precisely what’s happening with AI coding tools. According to research, AI excels at handling routine, repetitive coding tasks like <a href="https://docs.github.com/en/copilot/using-github-copilot/best-practices-for-using-github-copilot">writing tests, generating boilerplate code, and fixing syntax errors</a>. These are the exact “can’t someone else do it?” moments in a developer’s day. Yet many engineers still manually grind through these tasks — the digital equivalent of my dad driving to six stores for a tent he won’t buy.</p><h3>The Adoption Curve</h3><p>The adoption of new technologies rarely follows a linear path. Instead, it reaches a critical mass when enough people demonstrate its value. AI in coding is approaching this threshold, with Sam Altman noting that in many companies, AI is already handling “<a href="https://www.businessinsider.com/sam-altman-ai-coding-job-market-software-engineer-students-openai-2025-3">probably past 50%</a>” of coding tasks.</p><p>But widespread adoption requires more than just capability — it requires a shift in thinking. It requires us to recognize the “can’t someone else do it?” moments in our workflow.</p><p>I used to write all my own regex patterns, carefully crafting each character like I was defusing a bomb. Now I just tell an AI model what I want to match, and it gives me five options that are all better than what I would have written. The first time I did this, it felt like cheating. The tenth time, it felt efficient. The hundredth time, I couldn’t imagine working any other way.</p><h3>The Homer Simpson Trigger</h3><p>The <a href="https://docs.github.com/en/copilot/using-github-copilot/best-practices-for-using-github-copilot">research</a> reveals that AI is most valuable in three specific scenarios: handling repetitive and predictable tasks, serving as a strategic partner in requirements and planning, and facilitating rapid prototyping in green field development.</p><p>Let me translate that into Homer Simpson terms:</p><ol><li><strong>When you’re doing something boring and repetitive</strong> — AI can write your tests, generate boilerplate, and fix syntax errors. You know, all the stuff that makes you want to slam your head on the keyboard.</li><li><strong>When you’re planning something complex</strong> — AI can help analyze requirements, draft specifications, and validate your approach. It’s like having a really smart friend who never gets tired of your questions.</li><li><strong>When you’re starting from scratch</strong> — AI can help you rapidly prototype and explore different approaches. It’s like having an entire team of junior developers, except they don’t drink all the coffee or ask you questions while you’re wearing headphones.</li></ol><p>This aligns with what experts like Vincent Hellendoorn identify as the transition “<a href="https://mse.s3d.cmu.edu/news/2025/speaker-vincent-hellendoorn.html">from simple code completion tools to fully interactive agents capable of handling complex engineering workflows.</a>” The key is recognizing when to use these tools.</p><h3>Social Barriers to Adoption</h3><p>Imagine a software engineer — let’s call him Dave. Dave has been coding for 15 years. He knows his IDE shortcuts, has strong opinions about tabs versus spaces, and can write a binary search algorithm from memory. Dave hears about these AI coding assistants and thinks, “That’s nice for beginners, but I don’t need that.”</p><p>Then one day, Dave needs to write yet another CRUD API for yet another microservice. It’s his fourth this month. As he stares at the blank file, something stirs deep in his soul. A voice that sounds suspiciously like Homer Simpson whispers: “Can’t someone else do it?”</p><p>And that’s the moment. The trigger. That’s when Dave should reach for AI tools. Not because he can’t write the code himself (he can), but because his time and mental energy are better spent on more complex problems. As Marco Giordano, an analytics professional, notes, “<a href="https://www.linkedin.com/posts/marco-giordano96_is-using-ai-bad-for-coding-i-tell-you-activity-7220166714666221568-6B0-">It took me hours to write complex code before, now it’s a matter of minutes.</a>” The productivity gains are real, but they require a shift in mindset.</p><h3>The Social Adoption Playbook</h3><p>Community guidelines emphasize <a href="https://www.reddit.com/r/ChatGPTCoding/comments/1fyti60/8_best_practices_to_generate_code_with_generative/">breaking down complex tasks</a>, providing clear context, and iterating on AI-generated solutions. This isn’t just technical advice — it’s a social framework for collaboration. It’s about recognizing when to delegate and how to communicate effectively with your AI assistant.</p><p>Here’s my three-step playbook for adopting AI coding tools:</p><ol><li><strong>Recognize your “Can’t someone else do it?” moments</strong> — What tasks do you dread? What work feels repetitive? These are your AI opportunities.</li><li><strong>Start small</strong> — Don’t ask AI to architect your entire system. Ask it to write a single function, generate a test, or debug a specific issue.</li><li><strong>Iterate and verify</strong> — Treat AI output as a starting point, not a final solution. Verify, modify, and improve. The AI is your collaborator, not your replacement.</li></ol><h3>The Call to Action</h3><p>As we move forward, the relationship between developers and AI will continue to evolve. Those who learn to <a href="https://www.businessinsider.com/sam-altman-ai-coding-job-market-software-engineer-students-openai-2025-3">collaborate effectively with these tools</a> — understanding both when to use them and when to rely on human expertise — will be best positioned to thrive in the changing landscape of software engineering.</p><p>So the next time you find yourself thinking, “Can’t someone else do it?” — reach for your AI coding assistant. Not because you can’t do it yourself, but because your time and talent deserve to be spent on more challenging problems.</p><p>And unlike Homer Simpson your AI assistant won’t make ridiculous promises it can’t keep… well, it might hallucinate a solution or two. But at least it won’t leave your city buried in garbage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901ffc0d208a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blindfolded AI: Why Your System Is Missing Critical Business Context (And How to Fix It)]]></title>
            <link>https://justinrich.medium.com/blindfolded-ai-why-your-system-is-missing-critical-business-context-and-how-to-fix-it-eb0d0c33321f?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb0d0c33321f</guid>
            <category><![CDATA[ai-evaluation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[emerging-technology]]></category>
            <category><![CDATA[human-ai-collaboration]]></category>
            <category><![CDATA[ai-management]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Mon, 31 Mar 2025 19:07:43 GMT</pubDate>
            <atom:updated>2025-03-31T19:25:20.995Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U6Iexa2279dhAasCdMYwww.png" /></figure><h3>TLDR;</h3><p>Many AI implementations fail to deliver business value not because of technical limitations, but because they lack essential domain expertise. This article demonstrates how involving subject matter experts in evaluating AI outputs transforms performance. I outline a practical framework for business leaders to ensure AI systems capture critical business context through structured human-in-the-loop evaluation. The most successful AI implementations aren’t defined by technology sophistication, but by how effectively they incorporate domain knowledge into their development and refinement processes.</p><h3>A Tale of Automation Gone Wrong (and Then Right)</h3><p>Recently I was working with an investment firm to automate steps of their real estate lending process. The leadership team was excited about implementing an AI system to streamline their loan processing workflow. On paper, the plan looked flawless: use large language models to extract key information from application documents, classify loan types, and generate preliminary approval recommendations. The engineering team selected a cutting-edge framework that promised “optimized prompts” and “enterprise-grade accuracy.”</p><p>Six weeks and considerable investment later, the results were disappointing. Employees reported inaccurate classifications, missing information, and recommendations that defied common sense in the mortgage industry.</p><p>We kept tweaking settings in the AI framework dashboard, but nothing seemed to help. The engineering was solid and everything was working as designed.</p><p>The breakthrough came when we took a radically different approach. We sat down with the firm’s Sr. Financial Analysts, a man with years of experiences and thousands of loans under his belt. Together they reviewed 50 actual outputs from the AI system.</p><p>From the moment the analyst looked at the first few examples he immediately spotted patterns that our engineering team had missed. He’d say things like ‘this rental income calculation is completely wrong’ or ‘the system is missing co-borrower information that’s clearly on page three.’”</p><p>This simple act — having a domain expert evaluate real outputs — transformed the project. With the feedback, the we completely rewrote the prompts, focusing on the specific data elements that mortgage professionals actually use to make decisions. Within two weeks, accuracy jumped from 62% to 94%.</p><p>The lesson from this experience reflects a powerful principle highlighted by software engineer <a href="https://hamel.dev/">Hamel Husain</a>: when it comes to AI systems, nothing matters more than looking at the actual data and having domain experts evaluate real outputs.</p><h3>The Hidden Problem with Many AI Frameworks</h3><p>Many modern AI frameworks promise to abstract away the complexity of working with large language models. As Husain points out in his provocative article “<a href="https://hamel.dev/blog/posts/prompt">Show Me The Prompt</a>,” these tools often “encourage users to disintermediate themselves from prompting”.</p><p>This creates what Husain calls “<a href="https://hamel.dev/blog/posts/prompt/#motivation-minimize-accidental-complexity">accidental complexity</a>”. By hiding what’s happening behind the scenes, these frameworks can make it harder — not easier — to build effective AI systems.</p><p>The fundamental issue is simple: <strong>if you can’t see the actual prompts being sent to the AI model, you can’t effectively evaluate whether they’re appropriate for your specific business needs</strong>. As Husain’s experiments reveal, frameworks that hide these details can lead to inefficient implementations, wasted resources, and ultimately, poor results.</p><h3>The Business Value of Looking at the Data</h3><p>Amazon Web Services (AWS) recognizes this principle in their approach to enterprise AI. Their Amazon Bedrock services <a href="https://aws.amazon.com/blogs/machine-learning/evaluating-prompts-at-scale-with-prompt-management-and-prompt-flows-for-amazon-bedrock/">emphasize</a> “systematic evaluation at scale” as a critical component of successful prompt engineering.</p><p>Similarly, <a href="https://aragonresearch.com/every-enterprise-must-invest-prompt-engineering/">Aragon Research</a> stresses that “every enterprise must invest in prompt engineering” as a strategic necessity.</p><p>But what exactly does effective prompt engineering entail? At its core, it’s about:</p><ol><li>Having domain experts review actual outputs</li><li>Using that feedback to improve prompts</li><li>Creating a continuous feedback loop</li></ol><h3>A Simple Example: Before and After Human Evaluation</h3><p>Let’s look at a simplified example from the the mortgage case:</p><p><strong>Original Prompt (Before Domain Expert Review):</strong></p><blockquote>Extract all numerical data related to income, assets, and debts from the loan application. Calculate debt-to-income ratio. Determine if the application meets standard approval criteria.</blockquote><p>When our experienced loan processor reviewed the outputs, he identified several specific issues:</p><ol><li>The AI wasn’t distinguishing between different types of income (W-2, self-employment, rental)</li><li>It wasn’t correctly identifying which debts were already being paid off in the transaction</li><li>It was missing critical information about co-borrowers</li><li>It wasn’t following industry-standard calculation methods for debt-to-income ratios</li></ol><p><strong>Revised Prompt (After Domain Expert Review):</strong></p><blockquote>Extract the following specific financial information from the loan application:<br>1. For Primary Borrower: W-2 income (line 1), self-employment income (Schedule C net profit), and rental income (Schedule E)<br>2. For Co-Borrower (if applicable): Same income categories<br>3. List all outstanding debts that will remain after closing, excluding any marked as “to be paid off at closing”<br>4. Calculate debt-to-income ratio using the industry formula: total monthly debt payments / gross monthly income<br>5. Flag applications with DTI &gt; 43% for manual review<br>6. Verify that rental income is only counted at 75% of stated amount per industry standards</blockquote><h3>Why Domain Experts Are Critical to AI Success</h3><p>TrueLaw.ai makes <a href="https://www.truelaw.ai/blog/lawyers-as-ai-evaluators-not-prompt-engineers-the-key-to-better-legal-ai">a compelling case</a> that “lawyers as AI evaluators, not prompt engineers” is the key to better legal AI. This principle applies across industries.</p><p>Domain experts bring several irreplaceable advantages to AI implementation:</p><ol><li>They understand the nuances and edge cases in their field</li><li>They can identify when AI outputs don’t match real-world decision processes</li><li>They recognize industry-specific terminology and standards</li><li>They know which errors are minor and which are critical</li></ol><p>As Ankit Pareek notes in his work on <a href="https://www.linkedin.com/pulse/data-driven-prompt-engineering-parameterization-making-ankit-pareek">data-driven prompt engineering</a>, successful implementations require approaches that are “tailored to specific tasks and datasets”.</p><h3>Practical Steps for Implementation</h3><p>How can businesses apply these principles? Here’s a practical framework:</p><ol><li><strong>Start with domain expertise, not technology:</strong> Involve subject matter experts from the beginning, not just IT teams.</li><li><strong>Create an evaluation dataset:</strong> Compile a representative set of examples that covers common cases and edge cases.</li><li><strong>Implement human review cycles:</strong> Have domain experts regularly review actual AI outputs against this dataset.</li><li><strong>Focus on specific improvements:</strong> Use Husain’s approach of “<a href="https://hamel.dev/blog/posts/prompt/#intercepting-llm-api-calls">intercepting API calls</a>” to see exactly what prompts are being sent and how they can be improved.</li><li><strong>Break evaluation into stages:</strong> As <a href="https://www.mckinsey.com/featured-insights/mckinsey-explainers/what-is-prompt-engineering">McKinsey’s research</a> on prompt engineering explains, breaking prompt evaluation into multi-step processes allows for more effective assessment and systematic improvement.</li><li><strong>Create structured data management processes:</strong> Proper <a href="https://www.sei.com/insights/article/data-management-best-practices-for-enhanced-prompt-design/">data structure and organization</a> are vital for effective prompt engineering.</li></ol><h3>Conclusion: The Power of Human-in-the-Loop Evaluation</h3><p>For business leaders the lesson is clear: the most sophisticated AI framework in the world couldn’t match the value of having SMEs review actual outputs and provide feedback.</p><p>Hamel Husain captures this principle perfectly in <a href="https://hamel.dev/blog/posts/prompt/#my-personal-experience">his philosophy</a> of “show me the prompt”. By insisting on transparency and focusing on what actually matters — the data and how it’s being processed — businesses can avoid costly mistakes and build AI systems that truly deliver value.</p><p>The most successful AI implementations aren’t the ones with the most advanced technology or the most complex frameworks. They’re the ones that start and end with a simple principle: <strong>look at the data, with domain experts, and let their insights guide your approach</strong>.</p><p>As AWS, Aragon Research, and <a href="https://aws.amazon.com/blogs/machine-learning/evaluating-prompts-at-scale-with-prompt-management-and-prompt-flows-for-amazon-bedrock/">industry leaders agree</a>, “effective prompt development is not a one-time task but an ongoing process of evaluation and refinement based on real-world data and performance metrics.” By putting this principle at the center of your AI strategy, you can avoid the pitfalls of accidental complexity and build systems that truly enhance your business.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb0d0c33321f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MCP: Making Your AI More Like Sherlock And Less Like Watson]]></title>
            <link>https://justinrich.medium.com/mcp-making-your-ai-more-like-sherlock-and-less-like-watson-7a4912161e15?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a4912161e15</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-assistant]]></category>
            <category><![CDATA[ai-integration]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Wed, 26 Mar 2025 17:02:46 GMT</pubDate>
            <atom:updated>2025-03-26T17:06:52.252Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔍 MCP: Give Your AI “Sherlock” A Clue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bhAziO90obwI5wmmlE5qYw.png" /></figure><p>Even the world’s greatest detective is useless without evidence. That’s your AI assistant without proper context — brilliant deductive reasoning trapped in an information vacuum.</p><p>Today’s AI models are like Sherlock Holmes locked in an empty room with no case files, no witnesses, and no crime scene to examine. They’ve mastered the methods of deduction from studying billions of documents, yet when you ask them about your company’s Q3 sales figures, they’re reduced to saying, “I’m afraid I have insufficient data to draw any conclusions.”</p><h3>The Evidence Problem</h3><p>Just like detectives, AI has limitations on what evidence it can consider at once. We call this “context” — the information an AI can hold in its “working memory” while investigating your case. No matter how brilliant the AI detective, it’s constrained by what clues it can examine at any given moment.</p><p>Until now, getting your company’s private evidence into that limited investigation space required an engineering team, custom code, and a prayer that it would all work together. Each integration was like building a custom evidence transfer system between police departments — complex, unreliable, and different every time.</p><h3>Enter the Model Context Protocol: The Universal Evidence Retrieval System</h3><p>This is where the <a href="https://www.anthropic.com/news/model-context-protocol">Model Context Protocol (MCP)</a> comes in — think of it as a standardized evidence collection and transfer system for AI detectives. Just as modern forensics standardized how crime scene evidence is collected and processed, MCP standardizes how AI models request and receive information.</p><p>Before MCP, connecting AI to your business data was like Sherlock trying to solve cases across different countries where each police force had different evidence handling procedures. After MCP, it’s like every department suddenly agreed to use the same evidence bags, labeling system, and chain of custody.</p><h3>How MCP Works: Sherlock’s Investigation Process</h3><p>Imagine Sherlock, your AI detective, is investigating a baffling murder case:</p><p>You: “A wealthy businessman has been found dead in his locked study. The police are stumped!”</p><p>Sherlock, intrigued, begins his investigation using the Model Context Protocol (MCP) to access a network of digital evidence sources. Here’s how the case unfolds:</p><p><strong>Surveying the Crime Scene</strong>: Sherlock consults his MCP directory, listing all available evidence sources, each with metadata explaining its contents and proper interrogation methods.</p><p><strong>Retrieving Data</strong>: Sherlock identifies key sources in his directory:</p><ul><li>Crime Scene Photos Database</li><li>Victim’s Personal Records</li><li>Security Camera Footage</li><li>Forensic Lab Results</li></ul><p>Based on the descriptions, he determines that Crime Scene Photos and Forensic Lab Results are crucial starting points.</p><p><strong>Forensic Analysis</strong>: Sherlock formulates precise queries for the Forensic Lab:</p><pre>{   <br>  &quot;evidence_type&quot;: [&quot;toxicology&quot;, &quot;fingerprints&quot;, &quot;trace_evidence&quot;],   <br>&quot;timeframe&quot;: &quot;last_24_hours&quot;,   <br>&quot;location&quot;: &quot;victim&#39;s_study&quot; <br>}</pre><p><strong>Gathering Evidence</strong>: Sherlock sends his request to the Forensic Lab. MCP ensures all sources understand his inquiries, regardless of their internal systems.</p><p><strong>Examining Clues</strong>: The lab provides results in clear, standardized text:</p><pre>Toxicology: Traces of rare poison found in victim&#39;s system.<br>Fingerprints: Unknown prints on window latch.<br>Trace Evidence: Unusual pollen grains on victim&#39;s sleeve.</pre><p><strong>Following Leads</strong>: Intrigued by the pollen, Sherlock queries the Victim’s Personal Records and discovers the businessman recently visited a botanical garden.</p><p><strong>Solving the Case:</strong> Sherlock pieces together the evidence into a comprehensive solution.</p><p>Sherlock: “I’ve cracked the case! The victim was poisoned by a rare plant from the botanical garden. The killer, likely a botanist, entered through the window using specialized knowledge to bypass the lock. The pollen on the victim’s sleeve suggests a struggle before the poison took effect.”</p><p>When you ask about potential suspects, Sherlock doesn’t restart his investigation. He immediately queries the Security Camera Footage to identify recent visitors to the botanical garden, narrowing down the list of potential botanist-murderers.</p><p>Just as the literary Sherlock Holmes might follow a trail from a footprint to a suspect’s profession, your AI Sherlock uses MCP to connect disparate pieces of digital evidence — transforming raw data into a coherent narrative of the crime</p><h3>Why This Matters: The Power of Complete Investigations</h3><p>The true power of MCP is that it gives Sherlock access to all the evidence. He’s not limited to a single witness statement or piece of evidence — he has a network of informants, each with specific knowledge about different aspects of the case.</p><p>This mirrors how real analytical work happens in organizations. When performing financial analysis, you usually consult accounting. When making decisions on product delivery, you may want to turn to your head of logistics. With an MCP interface for your data, Sherlock now has the same ability to consult the right “experts” in your digital ecosystem.</p><p>And because MCP standardizes how these sources respond, Sherlock never has to deal with incompatible evidence formats or technical jargon. Everything comes back as clear, usable information — just as if he had a team of competent assistants preparing case briefs.</p><h3>The Business Impact</h3><p>Without MCP, your AI is like Sherlock Holmes trying to solve cases blindfolded with his hands tied behind his back. With MCP, it’s like giving him access to Scotland Yard’s evidence room, forensic laboratories, and a network of informants across London.</p><p>The result is an AI detective that:</p><ul><li>Knows which evidence sources to consult for different cases</li><li>Can access and cross-reference multiple information sources</li><li>Builds comprehensive case files from disparate evidence</li></ul><p>For business leaders, this means AI that delivers actual insights from day one — not just impressive deductive reasoning that falls apart when faced with real-world questions about your specific business.</p><p>The most brilliant detective in the world is useless without evidence. With MCP, your AI assistant finally has access to the clues it needs to solve your business mysteries — not just generally smart, but specifically valuable to your unique cases.</p><p>The game is afoot — and now your AI actually has the evidence to play it properly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a4912161e15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evals: Why Both Your AI and Humans ‘Just Can’t Do That!’]]></title>
            <link>https://justinrich.medium.com/evals-why-both-your-ai-and-humans-just-cant-do-that-8fd9845df903?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fd9845df903</guid>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 23:42:46 GMT</pubDate>
            <atom:updated>2025-03-12T15:43:25.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*5NbdPJ4eSJ4n8MUUR3Xt7g.jpeg" /></figure><p>Imagine investing millions in an AI system, only to find it’s as unreliable as a magic 8-ball. Frustrating, right? But before you blame the technology, ask yourself: How well would your human employees perform with vague instructions and zero feedback? The key to unlocking AI’s true potential lies not in the algorithms, but in how we evaluate and refine them.</p><p>Recently, I worked on a project where team members exclaimed, “AI just can’t tag data like people can.” The process lacked examples and a clear feedback loop to manage the AI’s instructions. It was like inviting someone off the street to tag data, handing them a tome of stories, and expecting perfection. In the real world, we’d hire someone, monitor their performance, and provide feedback. Yet in the digital realm, we give our artificial team members less grace than the intern who keeps mixing up coffee orders.</p><p>Enter “AI Evaluations” — a methodology that could boost your digital workers’ performance by 20–30%, according to <a href="https://www.pwc.com/us/en/tech-effect/ai-analytics/ai-predictions.html">research</a> from PwC. Turns out, treating your AI like more than just a fancy calculator with delusions of grandeur yields impressive results. PwC’s findings suggest that systematic evaluations and iterative feedback loops can drive significant gains in productivity, speed to market, and overall efficiency. Who knew giving feedback to something without feelings could be so effective?</p><p>This approach mirrors how human team members respond to feedback. The parallels between human and AI performance are striking — and understanding this connection could be the key to unlocking your competitive advantage.</p><h3>The Human Performance Parallel</h3><p>Consider how well human employees perform when given good instructions and regular feedback.<a href="https://www.mckinsey.com/capabilities/people-and-organizational-performance/our-insights/in-the-spotlight-performance-management-that-puts-people-first"> Researc</a>h from McKinsey &amp; Company highlights that organizations that prioritize performance management are 4.2 times more likely to outperform their competitors and experience an average of 30% higher revenue growth. This underscores the critical role of structured feedback and clear goal-setting in driving organizational success.</p><p>This insight provides a crucial parallel to AI systems. Just like human employees, AI requires clear guidance, regular feedback, and ongoing evaluation to perform at its best. The emerging concept of AI evaluations as a form of “performance review” for artificial intelligence is gaining traction among thought leaders in the field.</p><h3>The Power of Feedback Loops in AI</h3><p>The experts are catching on: AI needs performance reviews just like your human employees do.</p><p>Industry bigwigs aren’t just theorizing here — they’re seeing real results. <a href="https://www.businessinsider.com/ai-chiefs-top-consulting-firms-how-to-use-ai-prompts-2025-2">Jim Rowan</a> at Deloitte doesn’t just throw AI at problems and hope for the best. His team uses AI for research and newsletter drafting, but the secret sauce? “We’re constantly tweaking our prompts based on what works and what bombs,” he explains. “It’s like training a new hire who’s brilliant but needs direction.”</p><p><a href="https://www.businessinsider.com/ai-chiefs-top-consulting-firms-how-to-use-ai-prompts-2025-2">Dan Priest</a> from PwC is singing the same tune. His team has AI cranking out labor productivity research and drafting policies, but they don’t just set it and forget it. “Every time our AI delivers something that misses the mark, we adjust the instructions,” Priest says. “It’s basically digital coaching — and the results speak for themselves.”</p><p>Sound familiar? It should. Just like your star performers improve with good feedback, your AI tools transform when you stop treating them like fancy calculators and start treating them like team members who need clear direction. The difference between mediocre and mind-blowing AI isn’t in the code — it’s in the conversation you’re having with it.</p><h3>AI Performance Reviews: A Systematic Approach</h3><p>This approach mirrors how human team members respond to feedback. What does a “performance review” look like for AI? It means systematically creating test cases that reflect what we want the AI to accomplish, running those cases, evaluating the outputs against our standards, and then refining the instructions (prompts) based on those results.</p><p>Let’s walk through a concrete example:</p><p><strong>Original Support Ticket:</strong> “I’ve been trying to access the admin dashboard for the last 3 hours and keep getting error code E-1234. This is extremely frustrating as I have a deadline today. The system was updated yesterday — could this be related?”</p><p><strong>1. Original Prompt:</strong> “Summarize this customer support ticket.”</p><p><strong>2. Suboptimal Output:</strong> “Customer reports error code E-1234 when attempting to access admin dashboard. System was updated yesterday.”</p><p><strong>3. Expected Output (Evaluation Benchmark):</strong> “Technical issue: Error E-1234 preventing admin dashboard access, possibly related to yesterday’s update. Customer frustration: High due to deadline pressure. Priority: High (business-critical work stoppage). Department: Technical Support should investigate recent system update as potential cause.”</p><p>Notice how the original output completely misses crucial context. It doesn’t mention the customer’s high frustration level or the urgency created by their deadline. It fails to assign any priority level, making it impossible for support teams to properly queue the ticket. There’s no suggestion about which department should handle it or what they should investigate first. In essence, the AI has merely repeated basic facts without adding the business intelligence needed for effective ticket management.</p><p><strong>4. Refined Prompt:</strong> “Summarize this customer support ticket by: 1) identifying the technical issue, 2) noting the customer’s level of frustration (low/medium/high), 3) assigning a priority level (Low/Medium/High) based on business impact, and 4) suggesting which department should handle it.”</p><p><strong>5. Improved Output:</strong> “Technical issue: Error code E-1234 when accessing admin dashboard, possibly related to yesterday’s system update. Customer frustration: High (deadline-driven urgency). Priority: High due to work stoppage. Department: Technical Support should investigate if the recent update caused this issue.”</p><p>Now that I’ve updated the prompt with specific instructions, the output closely matches our expected benchmark. It captures all four critical elements that were missing before. This comprehensive summary enables proper ticket routing and prioritization, ultimately improving customer satisfaction and operational efficiency.</p><p>This systematic approach transforms vague dissatisfaction with AI outputs into actionable improvements, ensuring your AI systems evolve to meet specific business needs.</p><h3>The Challenge of Obscured Prompts</h3><p>One significant obstacle to effective AI evaluation is the tendency for prompts and processes to be obscured within code. While programmatic execution of prompts is necessary for efficiency (imagine manually pasting and processing results from 20 calls to GPT), this approach often excludes non-technical stakeholders from the development and maintenance process.</p><p>Hamel Husain, a prominent voice in AI engineering, <a href="https://hamel.dev/blog/posts/prompt/">warns</a> against this practice. He notes that many libraries aim to enhance LLM outputs by rewriting or constructing prompts, but they often encourage users to disintermediate themselves from prompting. This can lead to a situation where the AI logic becomes a “black box” accessible only to technical teams, thereby limiting an organization’s ability to refine and improve AI systems based on business insights.</p><h3>Emerging Tools for Inclusive AI Development</h3><p>Recognizing this challenge, new tools are emerging to help bridge the gap between technical implementation and business oversight. Platforms like <a href="https://dify.ai/">Dify.AI</a> are designed to make AI systems more transparent and accessible to non-technical stakeholders.</p><p>Dify.AI, an open-source platform for building AI applications, combines Backend-as-a-Service and LLMOps capabilities with a business-friendly interface. Its visual workflow orchestration and Prompt IDE enable business users to design, deploy, and manage AI applications with minimal technical expertise.</p><p>These tools allow business leaders to:</p><ul><li>Monitor AI systems in real-time through intuitive dashboards</li><li>Visualize how systems process information with user-friendly interfaces</li><li>Participate in prompt management and evaluation without coding knowledge</li></ul><p>For organizations with more technical users, platforms like Arize’s open-source project <a href="https://phoenix.arize.com/">Phoenix</a> offer advanced observability and evaluation capabilities. Phoenix provides deeper technical features for monitoring model performance, detecting issues such as bias or drift, and troubleshooting complex LLM applications.</p><p>By empowering non-technical team members to actively participate in AI development and maintenance, organizations can create more effective, business-aligned AI solutions while ensuring proper governance and oversight of their AI systems.</p><h3>The Business Imperative</h3><p>For business leaders, understanding and implementing effective AI evaluation processes is not just a technical necessity — it’s a strategic imperative. Here’s why:</p><ol><li><strong>Improved Accuracy</strong>: Systematic evaluations lead to more accurate, reliable AI systems.</li><li><strong>Better Alignment</strong>: Regular feedback ensures AI outputs remain aligned with business objectives.</li><li><strong>Increased ROI</strong>: Well-evaluated AI systems deliver greater value, justifying and often exceeding their investment.</li><li><strong>Risk Mitigation</strong>: Ongoing assessment helps identify and address potential issues before they impact the business.</li><li><strong>Competitive Advantage</strong>: Organizations that master AI evaluation can adapt and improve their systems faster than competitors.</li></ol><h3>Conclusion</h3><p>As AI becomes increasingly integral to business operations, the ability to effectively evaluate and improve these systems will be a key differentiator. By applying principles from human performance management to AI, and leveraging new tools that facilitate non-technical involvement, business leaders can ensure their AI investments deliver maximum value.</p><p>The future of AI in business isn’t just about having the most advanced algorithms — it’s about creating a culture of continuous evaluation and improvement that allows both human and artificial intelligence to thrive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fd9845df903" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tamagui: The Quest for the One UI Library to Rule Them All]]></title>
            <link>https://medium.com/inkitt-tech/tamagui-the-quest-for-the-one-ui-library-to-rule-them-all-7a6c663ba85d?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a6c663ba85d</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 20:19:57 GMT</pubDate>
            <atom:updated>2025-01-08T20:19:57.819Z</atom:updated>
            <content:encoded><![CDATA[<p>In the realm of cross-platform development, a great challenge loomed over the lands of Inkitt. Our brave developers sought to forge a single UI library that could unite our digital kingdoms — Web (Galatea Web) and Mobile (Galatea Mobile on both Android and iPhone). As we embarked on rebuilding our web properties with the mighty <a href="https://nextjs.org/docs">NextJS</a>, we knew we needed a UI framework as powerful and consistent as the One Ring itself.</p><h3>The Problem: A Fragmented UI Realm</h3><p>Our journey began with a familiar struggle: multiple platforms, each with its own unique requirements and constraints. We faced the daunting task of maintaining consistent user experiences across Galatea Web and Galatea Mobile while rebuilding our web properties with NextJS. The need for a unified UI framework became apparent, much like the need for a single ring to bind them all.</p><p>It’s important to note that our mobile app is written in React Native, but we had elected not to rewrite our website in React Native Web due to open <a href="https://github.com/necolas/react-native-web/discussions/2474">concerns</a> with server-side rendering (SSR) in React Native Web. These concerns primarily revolve around the use of client-side context in React Native Web components, which can cause issues with SSR. Additionally, there are challenges with style differences between SSR and client-side hydration, potentially leading to layout shifts or requiring extra code to maintain consistent behavior.</p><h3>Considerations: Exploring the Paths Before Us</h3><p>As we ventured forth, we considered several paths:</p><ol><li><strong>Maintaining separate codebases</strong>: This approach would allow mobile and web to have exactly what they needed. However, like the divided kingdoms of Middle-earth, it would lead to fragmentation and duplication of efforts.</li><li><a href="https://tailwindcss.com/docs"><strong>Tailwind</strong></a><strong> integrations:</strong> While powerful, Tailwind presented its own challenges. The large class lists could become unwieldy, and customization beyond utility classes could be complex.</li><li><a href="https://tamagui.dev/"><strong>Tamagui</strong></a>: A cross-platform solution that promised to unite our UI realms under one banner.</li></ol><h3>The Chosen One: Tamagui</h3><p>After much deliberation, we chose Tamagui as our UI library of power. Like the One Ring, Tamagui offered capabilities that could bind our platforms together:</p><ul><li><strong>Cross-platform compatibility</strong>: Tamagui’s ability to work seamlessly across web and mobile platforms aligned perfectly with our quest for unity.</li><li><strong>Performance optimization</strong>: With its static extraction and compile-time optimizations, Tamagui promised <a href="https://tamagui.dev/docs/intro/why-a-compiler">performance</a> gains that could rival the swiftness of Elven archers.</li><li><strong>Theming and styling system</strong>: Tamagui’s powerful <a href="https://tamagui.dev/docs/intro/themes">theming</a> capabilities allowed us to maintain a consistent look and feel across our digital realms, much like the shared aesthetics of Elven kingdoms.</li><li><strong>Component-driven development</strong>: The library’s approach to components aligned with our vision of reusable, modular UI elements.</li></ul><h3>Forging the UI: Implementation</h3><p>With Tamagui chosen, we set out to implement our new UI framework. Our implementation strategy focused on creating a foundation of atomic components that could be shared across all platforms. We established a set of <a href="https://tamagui.dev/docs/core/configuration">design tokens</a> and themes that would serve as the building blocks of our UI, much like the elements that went into forging the rings of power.</p><h3>Creating a Theming System</h3><p>We faced an additional challenge in maintaining two distinct theming systems for Galatea (reader) and GalateaTV (video platform). Each application had its unique visual identity and user interaction model:</p><ul><li><strong>Galatea Theme</strong>: Focused on reading experiences with a calming green palette.</li><li><strong>GalateaTV Theme</strong>: Designed for video content with a vibrant blue palette complemented by secondary pink accents.</li></ul><h3>Galatea Theme Example:</h3><pre>const light: BaseTheme = {<br>  background: galateaTokens.color.neutral100,<br>  primary: galateaTokens.color.green300,<br>  // Other theme properties...<br>};</pre><pre>const dark: BaseTheme = {<br>  background: galateaTokens.color.neutral900,<br>  primary: galateaTokens.color.green300,<br>  // Other theme properties...<br>};</pre><h3>GalateaTV Theme Example:</h3><pre>const light: GTVTheme = {<br>  background: gtvTokens.color.neutral100,<br>  primary: gtvTokens.color.blue300,<br>  secondary: gtvTokens.color.pink300,<br>  // Other theme properties...<br>};</pre><pre>const dark: GTVTheme = {<br>  background: gtvTokens.color.neutral900,<br>  primary: gtvTokens.color.blue300,<br>  secondary: gtvTokens.color.pink300,<br>  // Other theme properties...<br>};</pre><h3>Trade-offs and Resolutions</h3><p>The main trade-off was balancing consistency across platforms while preserving each application’s unique identity. Maintaining two separate theme systems increased complexity but allowed us to tailor experiences specifically for reading or viewing content.</p><p>To resolve these challenges:</p><ul><li>We ensured both themes shared a common base structure (BaseTheme) for easier maintenance.</li><li>Leveraged Tamagui’s theming capabilities to dynamically switch themes based on user preferences or system settings.</li><li>Documented each theme’s specificities extensively to guide developers in making informed design decisions.</li></ul><h3>Challenges in the Shadows</h3><p>Yet, like Frodo’s journey, our path was not without its trials. We encountered limitations with certain UI libraries, such as the <a href="https://www.radix-ui.com/docs/primitives/components/accordion">@radix-ui/react-accordion</a>, which proved incompatible with our cross-platform aspirations. For these cases, we devised a strategy of conditional rendering, allowing components to manifest on supported platforms while fading into the shadows on unsupported ones.</p><p>We documented these limitations meticulously, like the scrolls of lore in Rivendell, guiding future developers in their quests and leaving room for their wisdom in navigating platform-specific challenges.</p><h3>Conclusion: One UI Library to Bind Them</h3><p>In our quest for the One UI Library, we may not have found perfection, but we’ve forged a powerful tool in Tamagui. Like the fellowship of the ring, our team has united around a common purpose, creating a UI framework that bridges the gaps between our digital realms.</p><p>As we continue on this journey, we remain vigilant, always ready to adapt our strategies and face new challenges. For in the world of cross-platform development, as in Middle-earth, the landscape is ever-changing, and only by working together can we hope to create experiences that truly rule them all.</p><p>And so, dear reader, our quest continues. May your own UI journeys be filled with less peril and more reusable components!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a6c663ba85d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inkitt-tech/tamagui-the-quest-for-the-one-ui-library-to-rule-them-all-7a6c663ba85d">Tamagui: The Quest for the One UI Library to Rule Them All</a> was originally published in <a href="https://medium.com/inkitt-tech">Inkitt Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“We Fear Change”- From REST Endpoints to GraphQL Entity Ownership]]></title>
            <link>https://justinrich.medium.com/we-fear-change-from-rest-endpoints-to-graphql-entity-ownership-274cff1158e0?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/274cff1158e0</guid>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Tue, 03 Dec 2024 18:09:52 GMT</pubDate>
            <atom:updated>2024-12-03T18:19:01.011Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*iue4G898T-TBzA0O.png" /></figure><p>In the Movie “Waynes World”, Dana Carvey’s character Garth nervously received feedback from producer (Rob Lowe) to change his show. Garth kinda represents all of us developers at one moment of time or another. We sit nervously next to our mechanical arms while wearing a helmet rigged with random gadgets. When developers approach new technologies, like GraphQL, we do so with a mix of fascination and fear. “We fear change,” we mutter, and it’s a sentiment that resonates deeply in tech.</p><p>One such technology I’ve had this reaction to has been GraphQL. Sure, some of that resistance comes from the GraphQL evangelists who, like Rob Lowe’s character, swagger in and tell us how they’re going to change everything about the way we work. But beneath all the hype and fear lies something transformative: a fundamental shift in how we think about API design and data ownership.</p><h3>The Common Concerns (The Short Version)</h3><p>Yes, developers have concerns about GraphQL. Complex queries can hurt performance (use query limits), security needs careful attention (implement field-level permissions), and the N+1 problem is real (DataLoader is your friend). But these technical challenges aren’t the real reason for resistance.</p><h3>The Real Story: Rethinking Data Ownership</h3><p>The true resistance to GraphQL comes from something deeper: it challenges everything we’ve been taught about API design and data ownership. Traditional REST APIs trained us to think in terms of endpoints — discrete chunks of functionality owned by specific teams. GraphQL asks us to think differently.</p><h3><strong>The Old Way: Endpoint Ownership</strong></h3><p>In the REST world, teams fight over endpoint ownership like it’s the last slice of pizza:<br>- “This is my /users endpoint!”<br>- “But I need to add these fields for my feature!”<br>- “Well, I need to modify the response format!”</p><p>Each endpoint becomes a battleground of competing interests, leading to either:<br>1. Bloated endpoints trying to serve everyone’s needs<br>2. Multiple similar endpoints with slight variations<br>3. Endless meetings about API changes</p><h3><strong>The New Way: Entity Ownership</strong></h3><p>GraphQL proposes a different model: ownership at the entity level. Instead of owning URLs, teams own concepts. Let’s look at a real-world example.</p><p><strong>Entity Ownership in Action</strong></p><p>Let’s consider a video streaming service where multiple teams manage different aspects of the content ecosystem:</p><pre>type Show {<br> id: ID!<br> title: String! # Content team owns basic metadata<br> synopsis: String!<br> releaseDate: DateTime!<br> <br> viewerRating: Float! # Analytics team owns viewing metrics<br> popularityScore: Float! # Complex calculation based on views, completion rates, etc.<br> <br> streamingRights: [Region!]! # Rights management team owns licensing data<br> availableUntil: DateTime # Different regions have different expiration dates<br> <br> recommendedEpisodes: [Episode!]! # ML team owns recommendation engine<br> similarShows: [Show!]! # Different algorithm than episodes<br> <br> cast: [CastMember!]! # Talent team owns cast relationships<br> crew: [CrewMember!]! # and crew information<br>}</pre><p><strong>Why Field Resolvers Matter</strong></p><p>Each field in our Show type might need different handling:</p><ol><li><strong>Performance Characteristics</strong></li></ol><pre>type Show {<br> # Cached for 24 hours - rarely changes<br> streamingRights: [Region!]! @resolver(field: &quot;showRights&quot;) <br> <br> # Real-time calculation, expensive operation<br> popularityScore: Float! @resolver(field: &quot;calculatePopularity&quot;)<br> <br> # Personalized for each viewer, needs user context<br> recommendedEpisodes: [Episode!]! @resolver(field: &quot;getRecommendations&quot;)<br>}</pre><p><strong>2. Security and Access Control</strong></p><pre>type Show {<br> # Public information<br> title: String!<br> <br> # Need licensing team access<br> contractDetails: ContractInfo! @resolver(field: &quot;getContractInfo&quot;)<br> <br> # Need analytics team access<br> viewerDemographics: Demographics! @resolver(field: &quot;getViewerStats&quot;)<br>}</pre><p><strong>3. Team Autonomy</strong><br>Each team can deploy and update their resolvers independently:<br>- ML team can improve recommendation algorithms<br>- Analytics team can modify popularity calculations<br>- Rights management team can update regional availability logic</p><h3>Real-world Impact</h3><p>This ownership model solves real problems:</p><p>1. The Rights Management Team<br>- Owns all licensing-related fields<br>- Can handle complex regional rules<br>- Doesn’t need to coordinate with other teams for updates</p><p>2. The ML Team<br>- Owns recommendation fields<br>- Can A/B test new algorithms<br>- Can handle user-specific context</p><p>3. The Analytics Team<br>- Owns viewing metrics<br>- Can optimize calculation performance<br>- Can add new analytics without affecting other teams</p><p><strong>Field Resolution in Practice</strong></p><p>Let’s look at how different teams implement their resolvers:</p><pre>// Rights Management Team&#39;s Resolver<br>async function showRights(show, args, context) {<br> const rights = await getRightsFromDatabase(show.id)<br> const userRegion = context.userRegion<br> return rights.filter(right =&gt; <br> right.isActiveInRegion(userRegion) &amp;&amp; <br> right.isWithinContract(new Date())<br> )<br>}<br>// ML Team&#39;s Resolver<br>async function getRecommendations(show, args, context) {<br> const userPreferences = await getUserPreferences(context.userId)<br> const modelVersion = await getActiveExperiment(context.userId)<br> return recommendationEngine[modelVersion].getRecommendations({<br> showId: show.id,<br> preferences: userPreferences,<br> limit: args.limit<br> })<br>}<br>// Analytics Team&#39;s Resolver<br>async function calculatePopularity(show, args, context) {<br> const cache = await getCache(`popularity:${show.id}`)<br> if (cache) return cache<br> <br> const metrics = await Promise.all([<br> getViewCount(show.id),<br> getCompletionRate(show.id),<br> getSocialShares(show.id)<br> ])<br> <br> return calculateScore(metrics)<br>}</pre><h3>Making the Transition</h3><p>Moving to entity-based ownership requires:<br>1. Organizing teams around business domains rather than technical layers<br>2. Establishing clear boundaries between entities<br>3. Creating processes for schema evolution and cross-team coordination<br>4. Building shared understanding of entity ownership</p><p><strong>Avoiding Anti-Patterns</strong></p><p>Don’t create artificial operations that bypass this elegant entity structure:</p><p>Bad Example:</p><pre>type Query {<br> getShowWithRightsAndRecommendations(id: ID!): ShowWithEverything!<br>}</pre><p>Good Example:</p><pre>type Query {<br> show(id: ID!): Show!<br>}</pre><p>Let the schema’s natural entity relationships do the work. The client can request exactly what they need, and each field resolver handles its part efficiently.</p><h3>Conclusion</h3><p>GraphQL isn’t just a new way to query data — it’s a new way to think about API design and team organization. By aligning data ownership with business domains and leveraging field-level resolvers, we create APIs that are:<br>- More maintainable (teams own their domains)<br>- More scalable (independent resolution of fields)<br>- Better aligned with how organizations actually work<br>- More flexible for evolving business needs</p><p>Like Dana Carvey clutching his mechanical arm, we all start out muttering “we fear change” when confronted with GraphQL. But once you embrace entity-based thinking and understand the power of field-level resolution, you’ll find yourself doing a full Wayne and Garth “We’re not worthy!” bow to its elegance. Party on, developers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=274cff1158e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are We Doing NextJS Server Components Wrong?]]></title>
            <link>https://justinrich.medium.com/are-we-doing-nextjs-server-functions-wrong-98a881772f3f?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/98a881772f3f</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Mon, 05 Aug 2024 16:09:21 GMT</pubDate>
            <atom:updated>2024-08-07T15:44:56.576Z</atom:updated>
            <content:encoded><![CDATA[<h3>Are We Doing NextJS Server Components Wrong? A Cautionary Tale of Spaghetti Code and Sleepless Nights</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*nZaigsNf0kWSs6_su6fFeA.jpeg" /><figcaption>Let’s remember Uncle Ben’s sage advice.</figcaption></figure><p>As a grizzled software veteran who’s seen more JavaScript frameworks come and go than I’ve had hot dinners, I recently found myself neck-deep in a project using NextJS’s shiny new App Router. At first, I was like a kid in a candy store, marveling at the ability to fetch data securely on the server at request time. But as the old saying goes, “With great power comes great responsibility” — and boy, did we need a dose of Uncle Ben’s wisdom on this one.</p><h4>The Siren Song of Server-Side Rendering</h4><p>NextJS’s App Router promises a land of milk and honey for data fetching. It’s secure! It’s fast! It’ll make you coffee in the morning! (Okay, maybe not that last one… yet.) But as I dove deeper into our project, I started to feel a familiar itch — the kind that usually precedes a massive refactoring headache.</p><h4>The “It Works, Don’t Touch It” Trap</h4><p>In our project, we fell into the oh-so-tempting trap of querying the database directly from the page function. It looked a little something like this:</p><pre>// app/users/page.tsx<br>import { sql } from &#39;@vercel/postgres&#39;;<br>export default async function UsersPage() {<br> const { rows } = await sql`SELECT * FROM users`;<br> <br> return (<br>   &lt;ul&gt;<br>     {rows.map((user) =&gt; (<br>       &lt;li key={user.id}&gt;{user.name}&lt;/li&gt;<br>       ))}<br>   &lt;/ul&gt;<br>   );<br>}</pre><p>Sure, it works. It’s secure because it only runs on the server. Heck, it even looks kind of elegant in its simplicity. But remember the last time you thought, “I’ll just put this one little piece of logic in the component”? Yeah, me too. It never ends well.</p><h3>The “Oh No, We Need to Change Something” Moment</h3><p>Fast forward a few sprints, and suddenly we need to add an email column to our users table. No big deal, right? Wrong. Now we&#39;re playing a fun game of &quot;Find Every Place We Queried the Database Directly&quot;. It&#39;s like Where&#39;s Waldo, but instead of a cheerful guy in a striped shirt, we&#39;re looking for potential bugs and inconsistencies.</p><pre>// app/users/page.tsx<br>const { rows } = await sql`SELECT id, name, email FROM users`;<br><br>// app/admin/page.tsx<br>const { rows } = await sql`SELECT id, name, email, role FROM users WHERE role = &#39;admin&#39;`;<br><br>// app/some-other-page-we-forgot-about/page.tsx<br>const { rows } = await sql`SELECT id, name FROM users`; // Oops, forgot the email here!</pre><p>This, my friends, is what we in the biz call a “maintenance nightmare”. It’s the kind of code that makes future you want to jump in your Delorean and travel back in time to give present you a kick in the ass.</p><p>As <a href="https://www.linkedin.com/pulse/separating-business-logic-jo%C3%A3o-h%C3%A9lio-%C3%A1vila-miranda/">João Hélio Ávila Miranda</a> so eloquently puts it (and I couldn’t agree more):</p><blockquote>“By understanding and applying the principles of separating business logic, we will be able to design and develop software systems that are modular, maintainable, and adaptable to meet the ever-changing needs of your users and stakeholders.”</blockquote><h3>Solution 1: The “Let’s Just Wrap It in a Function” Approach</h3><p>One way to address this is by encapsulating our data access logic in server based functions:</p><pre>// app/api/users.ts<br>import { sql } from &#39;@vercel/postgres&#39;;<br><br>export async function getUsers() {<br>  const { rows } = await sql`SELECT * FROM users`;<br>  return rows;<br>}<br><br>// app/users/page.tsx<br>import { getUsers } from &#39;../api/users&#39;;<br><br>export default async function UsersPage() {<br>  const users = await getUsers();<br>  <br>  return (<br>    &lt;ul&gt;<br>      {users.map((user) =&gt; (<br>        &lt;li key={user.id}&gt;{user.name}&lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}</pre><p>This is better. It’s like we’ve taken our spaghetti code and… well, made it into slightly more organized spaghetti. But here’s the rub: these functions are still tied to NextJS like a ball and chain. They come with some serious limitations that might make you want to pull your hair out down the line. Here’s the ones that have caused me some bald spots:</p><p><strong>Harder to Reuse Logic</strong>: When business logic is tightly coupled with Next.js server components, it becomes challenging to reuse this logic in other contexts. For example, imagine you’ve built a complex pricing algorithm within a Next.js API route. If you later decide to create a mobile app or a separate microservice that needs this same logic, you’ll find yourself duplicating code or performing awkward extractions.</p><p><strong>Scalability Constraints</strong>: Next.js API routes, while convenient, come with limitations that can impede scalability. They have restrictions on request body size (typically 4MB) and execution time, especially when deployed as serverless functions. As your application grows and handles more complex operations or larger datasets, these constraints can become significant bottlenecks.</p><p><strong>Testing Complexity</strong>: When business logic is embedded in Next.js server components, unit testing becomes more challenging. You often need to mock Next.js-specific features or set up complex environments to test what should be straightforward business logic. This can lead to slower, more brittle tests and make it harder to achieve good test coverage.</p><p>The list goes on, but hopefully you get my point.</p><h4>Solution 2: The “Let’s Actually Do This Right” Approach</h4><p>To achieve true separation of concerns (and save our future selves from countless hours of debugging), we can define proper endpoints for our data contract and access them through server based functions. It’s like creating a beautiful, well-organized library for your data, instead of just shoving books wherever they fit.</p><p>Here’s what that might look like:</p><pre>// api/users.ts (in a separate service)<br>import { sql } from &#39;@vercel/postgres&#39;;<br><br>export async function getUsers() {<br>  const { rows } = await sql`SELECT * FROM users`;<br>  return rows;<br>}<br><br>// app/api/users.ts (function defined in NextJS app)<br>import { getUsers as getUsersFromService } from &#39;../../api/users&#39;;<br><br>export async function getUsers() {<br>  const users = await getUsersFromService();<br>  // Feel free to do some UI-specific magic here, like sorting<br>  return users.sort((a, b) =&gt; a.name.localeCompare(b.name));<br>}<br><br>// app/users/page.tsx<br>import { getUsers } from &#39;../api/users&#39;;<br><br>export default async function UsersPage() {<br>  const users = await getUsers();<br>  <br>  return (<br>    &lt;ul&gt;<br>      {users.map((user) =&gt; (<br>        &lt;li key={user.id}&gt;{user.name}&lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}</pre><p>Granted this implementation still relies on the NextJS api framework, in an ideal world we would be able to spin out and maintain our data contracts on their own independent services. But if you need to move fast modularizing your data contracts in a proper endpoint on NextJS is a perfectly acceptable stopgap. Later with routing you can always forward calls on to your shiny new data service.</p><p>In the end, this approach is like Marie Kondo for your code — everything has its place, and it all sparks joy.</p><h4>Conclusion: A Stitch in Time Saves Nine (or More Like Nine Hundred)</h4><p>A little bit of organization at the beginning of your project can save you from turning into a coffee-fueled, bug-fixing machine later on. Trust me, I’ve seen businesses brought to their knees by tightly coupled integrations between UI and database. (Firebase, I’m looking at you. You know what you did.)</p><p>I get it — when you’re racing to prove product-market fit, it’s tempting to cut corners. But take it from someone who’s been there: making clear architecture decisions early will help you sprint faster in the long run. Your future self (and your future team) will thank you.</p><p>As the wise <a href="https://emlandre.com/2024/01/05/on-separation-of-concern-soc/">Einar Landre</a> points out:</p><blockquote><em>“Separating the business logic allows for a clear distinction between the core functionality of the application and the implementation details of external components. It enables developers to focus on the unique requirements and rules of the domain without being tightly coupled to specific technologies or frameworks.”</em></blockquote><p>So, the next time you’re tempted to query that database directly from your NextJS page function, remember: just because you can, doesn’t mean you should. Your code (and your sanity) will thank you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98a881772f3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hiring for Innovation and the “Diversity Bonus” by breaking your engineer recruiting process]]></title>
            <link>https://justinrich.medium.com/hiring-for-innovation-and-the-diversity-bonus-by-breaking-your-engineer-recruiting-process-e4b10b019872?source=rss-ac582212e474------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4b10b019872</guid>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[diversity-in-tech]]></category>
            <category><![CDATA[tech-recruiting]]></category>
            <category><![CDATA[engineering-interview]]></category>
            <category><![CDATA[cognitive-diversity]]></category>
            <dc:creator><![CDATA[Justin Rich]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 20:40:19 GMT</pubDate>
            <atom:updated>2023-12-21T23:03:16.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*Ca3QeO21RRXyY7kO" /></figure><p>I’m going to suggest a radical idea: <strong>your company will be more innovative if you break your technical interview process</strong>. No, I’m not just salty; though I am salty about the status quo of the tech interview process. I honestly believe the best way to increase innovation at any company is to break the standard “LeetCode Medium” (or “LCM”) engineering interview process. To understand WHY I believe this we have to consider 2 things:</p><ol><li><strong>Innovation REQUIRES cognitive diversity</strong></li><li><strong>Building cognitively diverse teams requires companies to break the standard interview process</strong></li></ol><p>Let me explain:</p><h3>Innovation REQUIRES diversity</h3><p>I’m a fan of the work of <a href="https://sites.lsa.umich.edu/scottepage/bio/">Dr. Scott Page</a>, who’s demonstrated that a key variable to innovation is cognitive (as well as other types of) diversity. If you’d like to learn more, take a look at his book <a href="https://sites.lsa.umich.edu/scottepage/home/the-diversity-bonus/">“The Diversity Bonus”</a> or check out his lecture “<a href="https://www.youtube.com/watch?v=2GYOx1PF3Bc&amp;t=3s">Why we need more diversity to solve complex problems</a>”.</p><p>In his theory, Dr. Page breaks down all work into two problem types: simple and complex. <strong>Simple problems</strong> (or linear problems) are those where all the inputs and tasks are known. Think baking a cake, in most cases you have a clear recipe and the effort to complete the task is well known (or linear). However, if you are solving problems with many unknowns these are complex (or nonlinear) tasks. In Dr. Page’s research, <strong>innovation is defined as solving complex non-linear problems efficiently</strong>. And as Dr. Page has found the more diverse a team’s composition the better they do at producing innovative solutions to complex problems.</p><p>One example of diversity playing a real world role in engineering innovation is the victory of a diverse set of AT&amp;T research engineers who won <a href="https://lsa.umich.edu/social-solutions/diversity-democracy/oci-series/excerpts/volume-ii/the-netflix-prize.html">Netflix’s Prize for data science</a>. In this case the cognitive diversity of the team members enabled the team to design a movie recommendation algorithm more efficient than any other competitor and win the $1,000,000 prize.</p><p>In my experience, management/HR treat diversity simply as a PR risk mitigation initiative. This is short sighted. If you are trying to build teams to innovate systems and processes then building teams that consist of members of different points of view is essential. Which leads me to my next point:</p><h3>Building cognitively diverse teams requires companies to break the standard interview process</h3><p>Assuming the work of Dr. Page is true, tech companies looking to innovate should be interviewing software engineering candidates in a way that selects for cognitively diverse individuals. In my experience this is not what the tech industry is doing. The”LCM” technical interview is still a standard screening process for software engineers at many tech companies. These technical interviews are usually in the format of presenting a candidate with an algorithm or data structure question they’ve never seen before for which they are expected to solve in front of an interviewer they’ve never met.</p><p>I use the term “LCM” or “LeetCode Medium” because to prepare for interviews engineers will need to spend at least 20 hrs a week practicing questions on <a href="http://leetcode.com/">leetcode.com</a> to have a fighting chance at passing technical interviews (on top of the 40+ hrs at their day job). At most companies if you can’t perform under the pressure of the technical interviewer’s scrutiny you don’t move on to even meet the hiring manager.</p><p>Requiring every candidate to be evaluated by the same high pressure brain teaser “LCM” interview process is a formula for a cognitively homogeneous team. Given my experience both administering and receiving “LCM” interviews I can’t help but think this is the point. Some large companies just don’t prioritize innovation. Like Little Debbies, they’ve figured out a recipe that works and they’re just looking for engineers who can mix ingredients and produce more of the same. <strong>If you’ve staffed your engineering department with cognitively homogeneous developers don’t be surprised when you get disrupted by small startups who can innovate because their team is cognitively diverse.</strong></p><p>So if we value innovation we will want diverse teams. It follows that to evaluate diverse talent correctly we can’t use a standard “LCM” interview process. Full disclosure, I have <a href="https://www.nimh.nih.gov/health/topics/obsessive-compulsive-disorder-ocd#:~:text=Obsessive%2Dcompulsive%20disorder%20(OCD),or%20interfere%20with%20daily%20life.">OCD</a> and consider myself <a href="https://my.clevelandclinic.org/health/symptoms/23154-neurodivergent">neurodivergent</a>. I do my best work when I’m allowed to solve problems independently because when someone’s looking over my shoulder my anxiety turns me into a puddle. Does this mean I’m not cut out to be an engineer? No. If anything it makes me a great engineer because in real world work conditions engineers solve problems alone and present solutions to their teams in code reviews. But if companies primarily use in person technical problem solving to select engineers they will only hire homogeneous non-innovative engineering teams that are specifically skilled at solving brain teaser algorithm questions in person.</p><p>If a company wants to innovate they need to diversify how they build teams so that they can staff teams with a diverse and thus innovative set of problem solvers. Hiring managers looking to innovate their industry are thus best served if they work together with candidates to identify an evaluation method that will best evaluate their problem solving skills.</p><p>Because the tech industry isn’t set up to hire diverse candidates, I’ve adopted the approach of telling hiring managers how to effectively value my skills. During the first interview I tell my potential employer that:</p><ol><li>I’m looking for an innovative company</li><li>innovation requires cognitive diversity</li><li>To measure my cognitively diverse skills I must be evaluated through means other than the standard LCM technical interview.</li></ol><p>I usually request an accommodation to receive a technical challenge question in person so I can ask clarifying questions. But after this initial session I request my employer let me break out alone to synthesize a solution. Lastly, when I’ve composed a solution I return and present my findings to my interviewer so I can answer questions and explain my reasoning. I explain that not only does this process more closely reflect the ACTUAL engineering process, but also it will provide my employer a more accurate view of the problem solving skills I bring to the table.</p><p>My interview process is but one alternative to the “LCM” interview many organizations could employ to identify cognitively diverse candidates for innovative teams. Companies dedicated to building an innovative business could create a “choose your own adventure” interview culture where creative managers identify common interview pathways that are effective in identifying qualified but diverse sets of candidates. In such a way we need not look at hiring for diversity as “lowering the bar” but recognizing that there are multiple “bars” that enable us to build innovative teams.</p><h3>In Summary</h3><p>Some of you might think I’m just a salty engineer that can’t hack it. And in the context of traditional tech companies who select engineers that produce more of the same you may be right. But there’s a reason why Xerox, HP, and Yahoo aren’t at the bleeding edge of technology. At some point these companies stopped innovating, and as Dr. Page’s work suggests its probably due these companies selecting a workforce based on cognitive homogeneity.</p><p>Admittedly, Dr. Page cites Google as selecting for diverse thinkers because they hire for “critical reasoning” from populations of students who attend both state and ivy league schools. I’ll give him a pass because I don’t know how much exposure he’s had to the software engineer hiring process Google has spawned and championed through the work of Gayle McDowell of “<a href="https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=sr_1_1?hvadid=598574096343&amp;hvdev=c&amp;hvlocphy=9029755&amp;hvnetw=g&amp;hvqmt=e&amp;hvrand=14167158833056410515&amp;hvtargid=kwd-20040243067&amp;hydadcr=16409_13457184&amp;keywords=cracking+the+coding+interview&amp;qid=1703186591&amp;sr=8-1">Cracking the Coding Interview</a>” fame. Google’s rigid approach to assessing talent leads me to believe that unless Google and the like tear down the homogeneous staffing practices they built they may be joining Yahoo on “Disrupted Company Island.”</p><p>The changes I’ve observed with smaller startups who are breaking away from “LCM” brain teasers gives me hope. And as both hiring managers and diverse candidates demand diverse hiring methodologies I think we will increasingly see more and more innovation in the tech industry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4b10b019872" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>