<?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 Adel Khalil on Medium]]></title>
        <description><![CDATA[Stories by Adel Khalil on Medium]]></description>
        <link>https://medium.com/@adelkhalil?source=rss-8910b46d7cfe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tLpOAaOwGrMtMMx-3M-7Uw.png</url>
            <title>Stories by Adel Khalil on Medium</title>
            <link>https://medium.com/@adelkhalil?source=rss-8910b46d7cfe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:15:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adelkhalil/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[Your API Works Fine. Your Agent Doesn’t.]]></title>
            <link>https://medium.com/@adelkhalil/your-api-works-fine-your-agent-doesnt-83124ffc5497?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/83124ffc5497</guid>
            <category><![CDATA[mcp-protocol]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mcps]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Mon, 18 May 2026 08:26:41 GMT</pubDate>
            <atom:updated>2026-05-18T08:26:41.523Z</atom:updated>
            <content:encoded><![CDATA[<p>What I learned building a raw and semantic MCP server against the same database</p><p>Everyone building AI agents is focused on the same things: which model to use, how to write better prompts, which orchestration framework to pick. These are legitimate questions. But there is a quieter problem sitting one layer below all of them, and most teams won’t notice it until they are already in production.</p><p>The API.</p><p>Not whether the API works. It probably does. But whether an AI agent can use it correctly, confidently, and without guessing.</p><p>I spent a session building an experiment to test exactly this. The results were more concrete than I expected, and I think they are worth sharing.</p><h3>A Quick Word on MCP</h3><p>MCP (Model Context Protocol) is the emerging standard for how AI agents call external tools. Think of it as a structured way for an agent to say “I need to look something up” and get a reliable answer back from your systems.</p><p>If you are building agents that interact with real business data, whether that is orders, customers, products, or anything else, you will eventually expose your systems via MCP. The question is not whether to do it. The question is how well you do it.</p><p>Most teams will do it the naive way, and I wanted to understand what that actually costs.</p><h3>The Experiment</h3><p>I took Northwind, the classic Microsoft sample commerce database that many of us used years ago to learn SQL. It has customers, orders, products, employees, shippers. A realistic enough domain to be interesting.</p><p>I built two MCP servers on top of it:</p><p><strong>northwind-raw:</strong> a naive, one-to-one wrap of the database. Every function exposes exactly what the database returns, with minimal descriptions. This is what you get if you point an OpenAPI-to-MCP generator at your existing API and call it done.</p><p><strong>northwind-semantic:</strong> the same underlying functions, but with a semantic layer on top. Better descriptions, documented enums, row limits, composite tools, and actionable error guidance.</p><p>Same database. Same underlying queries. Different tool definitions.</p><p>I then ran four realistic agent tasks against both servers using Claude (Haiku 4.5) and recorded exactly what happened.</p><p>Choice of Haiku was deliberate to establish a low-cost baseline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAwlf-KLNMS4XfYpPiIkXQ.png" /></figure><h3>The Four Tasks</h3><h3>Task 1: Find customers by country</h3><p><strong>Prompt:</strong> “Find me all customers from Germany”</p><p>Both servers passed this cleanly. One tool call, correct filter, 11 results. This is the easy case, a direct lookup with no ambiguity. I include it because every fair comparison needs a baseline.</p><h3>Task 2: Find orders shipped via express courier</h3><p><strong>Prompt:</strong> “Find me orders for customer ALFKI shipped via express courier”</p><p>This is where things got interesting.</p><p>The raw server has a ShipVia field that accepts integers: 1, 2, or 3. The tool description says nothing about what these mean. There is a get_shippers tool available that would answer the question, but the tool description gives no reason to call it first.</p><p>Here is what the raw tool definition looks like:</p><pre>@mcp.tool()<br>def raw_get_orders(customer_id: str = None, ship_via: int = None) -&gt; list:<br>    &quot;&quot;&quot;Get orders, optionally filtered by customer or shipper.&quot;&quot;&quot;<br>    return get_orders(customer_id=customer_id, ship_via=ship_via)</pre><p>The agent fetched 126 orders for ALFKI with no shipper filter, then used its own training knowledge to guess that ShipVia 2 means “United Package (express).” It got lucky. Northwind is well known enough that the model had seen it in training data. In a real system with internal shipper codes, it would have guessed wrong silently.</p><p>Now here is the semantic version:</p><pre>@mcp.tool()<br>def orders(customer_id: str = None, ship_via: int = None, limit: int = 50) -&gt; list:<br>    &quot;&quot;&quot;Retrieve orders from the Northwind database.    Parameters:<br>        ship_via: Filter by shipper company ID. This is an integer,<br>            1 = Speedy Express, 2 = United Package, 3 = Federal Shipping.<br>            Always call get_shippers() first to look up the correct value<br>            rather than guessing.<br>        ...<br>    Notes:<br>        - ShippedDate being NULL means the order has not shipped yet.<br>        - Freight is in USD.<br>    &quot;&quot;&quot;</pre><p>The agent called shippers() first, identified ShipVia 1 as Speedy Express, then called orders(customer_id=&quot;ALFKI&quot;, ship_via=1) with the correct filter. The database did the filtering. No 126 rows loaded into memory. No guessing.</p><p>One instruction in a docstring changed the entire behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SrQ86dCAHslcNeWYK7z6ZA.png" /></figure><h3>Task 3: Find overdue orders</h3><p><strong>Prompt:</strong> “Which orders are overdue, meaning the required date has passed but they haven’t shipped yet?”</p><p>The raw server answered from stale context left over from the previous conversation. It never made a new tool call. The answer was scoped to one customer without saying so.</p><p>The semantic server made one fresh tool call, correctly understood that a NULL ShippedDate means the order has not shipped (documented in the tool description), and found zero genuinely overdue orders. It then did something I did not expect: it proactively pivoted to find orders that shipped after their required date, surfaced four of them, and flagged the most problematic one. That is good agent behavior, not just correct behavior.</p><p>The remaining weakness was that it only checked 50 rows by default. The answer was correct for the sample, but the agent had no way to know it was working from an incomplete dataset. It stated its conclusions with full confidence. That is a documentation gap I need to fix.</p><h3>Task 4: Top performing employee by order count</h3><p><strong>Prompt:</strong> “Who is our top performing employee by number of orders handled?”</p><p>The raw server crashed. get_orders with no filter returned the entire orders table, hit the 1MB tool result size limit, and the agent gave up. Its suggestions for what to do next included &quot;upload a CSV&quot; and &quot;connect to Salesforce.&quot; Neither was useful.</p><p>The semantic server did not crash. The limit parameter capped the result set. The agent fetched employees, fetched a sample of orders, grouped them in memory, and returned Employee 4 with 37 orders. It then asked if I wanted the actual name.</p><p>It was not a complete answer. The grouping was done on 50 rows, not the full dataset, so the count was potentially wrong. And the agent had already fetched the employee list with names but did not join the data. These are real gaps.</p><p>But it was a partial answer instead of a complete failure. That matters.</p><p><strong>[INSERT DIAGRAM 3: Results comparison table]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sFwPb-XvKQ0tOm_DoK_tZQ.png" /></figure><h3>What Actually Makes the Difference</h3><p>None of this required changing the underlying API. The database functions stayed exactly as they were. Everything that improved agent behavior lived in the tool definitions.</p><p>There are six things that matter:</p><p><strong>Field naming.</strong> ShipVia means nothing to an agent. &quot;Filter by shipper company ID&quot; does.</p><p><strong>Enum translation.</strong> An integer with values 1, 2, 3 is a dead end. A documented enum with human-readable values is a lookup table the agent can reason over.</p><p><strong>Composite operations.</strong> Some agent tasks require multiple underlying calls. Wrapping them into a single intent-shaped tool prevents sequencing errors and reduces token cost.</p><p><strong>Shaped responses.</strong> Legacy APIs return everything. Agents need only what is actionable. Trimming the response to relevant fields cuts noise and reduces the chance of misreasoning.</p><p><strong>Actionable errors.</strong> “ERR_4471” tells an agent nothing. “Customer credit limit exceeded, ask the customer to pay their outstanding balance first” tells it exactly what to do next.</p><p><strong>Workflow notes.</strong> Which tools should be called first? What is the typical sequence? An agent without this context invents its own sequence and gets it wrong.</p><p>None of these are protocol features. MCP allows descriptions but does not define what good descriptions look like. That gap is the entire problem.</p><h3>The Part Models Will Not Fix</h3><p>I want to address the obvious counterargument: will better models just make this irrelevant?</p><p>For some of it, yes. Models are getting better at handling ambiguous schemas, and that trend will continue. But there is a category of knowledge that no model will ever have, because it is private.</p><p>What does status code 3 mean in your system? That mapping lives in a comment in a codebase from 2019, or in the head of a developer who left two years ago, or in a Confluence page behind a login. No model was trained on it. No amount of capability improvement changes that.</p><p>Your API’s private business logic, its currency conventions, its error codes, its return policies, its delivery zone naming, none of that is in any training data. That gap has to be bridged somewhere. Right now, nobody bridges it. Teams expose their APIs and wonder why the agent gets things wrong.</p><h3>What I Am Building</h3><p>This experiment is the starting point for probe_mcp, an open source eval harness for MCP servers. The idea is simple: point it at any MCP server, give it a set of natural language tasks, and get a score.</p><p>Not “does the tool definition look correct.” Does the agent actually succeed?</p><p>What exists today is the testbed described in this article, two MCP servers against Northwind, a manual eval log, and the beginning of the measurement infrastructure. The next step is automating the scoring so the comparison I did manually in this article can be run as a CI check.</p><p>If you are building agents against your own APIs, I would encourage you to run the same experiment. Pick four realistic tasks. Try them against your current MCP server. Write down what breaks and why. You will find the same gaps.</p><p>The model is not the problem. The tool definitions are.</p><p><a href="https://github.com/adelkkhalil/probe-mcp">https://github.com/adelkkhalil/probe-mcp</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83124ffc5497" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shaping Software Business Policies in Dubai]]></title>
            <link>https://medium.com/@adelkhalil/shaping-software-business-policies-in-dubai-79597bc43d17?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/79597bc43d17</guid>
            <category><![CDATA[software-solutions]]></category>
            <category><![CDATA[dubai]]></category>
            <category><![CDATA[policy]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 07:57:55 GMT</pubDate>
            <atom:updated>2025-01-13T07:57:55.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*0_MP5hEIXZHPVTWwsK22_A.jpeg" /><figcaption>Dubai Chambers — Dubai, UAE</figcaption></figure><p>Over the past several months, I’ve had the privilege of participating in numerous discussions and roundtables with incredible individuals from diverse backgrounds and experiences. These are people who deeply care about how technology can significantly improve the quality of our lives.</p><p>Going into these meetings, I always ask myself: <em>What can drive meaningful, step-change improvements in how leaders and companies realize their full potential?</em> One area where I believe I can make a difference is by connecting them to the Dubai government. Whether it’s helping them access the support they need, removing roadblocks, or finding the right partners to take their ambitions further, I see this as a key opportunity to contribute.</p><p>Dubai is a global hub for technological advancement, driven by a strong commitment to innovation and forward-thinking strategies. It would be incredible if we could democratize access to policymakers in Dubai for companies of all sizes. After all, realizing Dubai’s bold vision is a partnership — one that requires collaboration and shared effort.</p><blockquote><strong>Digital Economy Contribution</strong>: The UAE aims to double the digital economy’s contribution to its GDP from 9.7% in April 2022 to 19.4% within ten years.</blockquote><blockquote><strong>ICT Market Growth</strong>: The UAE’s ICT market is projected to grow from USD 52.23 billion in 2025 to USD 85.24 billion by 2030, at a CAGR of 10.29%.</blockquote><blockquote><strong>Innovation Index Ranking</strong>: Dubai ranks first in the Arab world on the latest Innovation Index, highlighting its leading position in technological advancement.</blockquote><blockquote><strong>Data Center Ecosystem</strong>: Dubai hosts the largest data center ecosystem in the UAE, with 18 colocation data centers, 237 cloud service providers, and 18 network fabric providers.</blockquote><blockquote><strong>Artificial Intelligence Contribution</strong>: AI is forecasted to contribute USD 96 billion (14% of GDP) to the UAE’s economy by 2030.</blockquote><p>I am happy today to share the news of forming Dubai Chambers of Commerce — Software Business Group (DSBG).</p><p>As part of Dubai Chambers of Commerce, DSBG mission revolves around bringing ideas forward and connect leaders and companies to the right policy makers to propel innovation in Dubai’s tech sector.</p><p><strong>Mission &amp; Objectives</strong></p><p>The DSBG is committed to advancing the software sector in Dubai and the broader region through the following key initiatives:</p><ul><li><strong>Advocacy and Policy Shaping</strong>: Collaborating with local and federal governments to advocate for policies that support software companies, ensuring businesses have a voice in shaping the regulations that impact them.</li><li><strong>Networking and Collaboration</strong>: Providing members with access to exclusive events such as the Dubai Software Innovation Summit, workshops, and networking mixers, fostering connections among professionals, entrepreneurs, and decision-makers.</li><li><strong>Education and Knowledge Sharing</strong>: Offering training programs, workshops, certifications, and access to a comprehensive knowledge portal featuring case studies, white papers, and expert insights to help members stay ahead in a rapidly evolving industry.</li><li><strong>Support for Startups and SMEs</strong>: Delivering mentorship, investor connections, and business development opportunities to help young companies thrive in Dubai’s competitive landscape.</li></ul><p><strong>Membership Opportunities</strong></p><p>We have established several membership categories to accommodate individuals, businesses, and organizations of all sizes. If your tech business is incorporated in Dubai, you are welcome to join us.</p><p>As a member of the DSBG, you will benefit from:</p><ul><li><strong>Influence</strong>: Participate in drafting policy recommendations and engage in discussions with government bodies to shape the future of the tech sector.</li><li><strong>Connections</strong>: Gain access to a vast network of like-minded professionals and potential collaborators, fostering meaningful partnerships.</li><li><strong>Resources</strong>: Attend workshops, certification programs, and industry events to enhance your skills and stay ahead of the latest trends.</li><li><strong>Exposure</strong>: Promote your brand, showcase your work, and establish yourself as a thought leader within the tech community.</li></ul><p>—</p><p>I’m incredibly excited to help bring this opportunity to shape the future of the industry to everyone!</p><p>To learn more about the DSBG and inquire about membership, please visit <a href="https://dsbg.ae/">dsbg.ae</a></p><p>You can also join our community by connecting with us on WhatsApp</p><p><a href="https://chat.whatsapp.com/KOHBis4fWBS5vVPPB58leZ">DSBG - Members</a></p><p>Thank you,<br>Adel Khalil<br>DSBG, Chairman of the Board</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79597bc43d17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SLM & Narrow AI]]></title>
            <link>https://medium.com/@adelkhalil/slm-narrow-ai-de63e40366c6?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/de63e40366c6</guid>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 07:56:11 GMT</pubDate>
            <atom:updated>2024-06-23T07:58:50.425Z</atom:updated>
            <content:encoded><![CDATA[<p>Reading into Google leaked memo, Llama leak impact and Apple WWDC.</p><h4>In this article…</h4><p>I’ll explore how the current obsession with generalized AI and massive language models is likely a transient phase. The true revolution lies in the democratization of AI technology. This trend is quickly reducing the long-held advantages of big tech companies. By looking at recent changes, we’ll show that the future of AI isn’t about creating artificial general intelligence (whatever that means), but about improving our current tools with specific, focused AI features.</p><blockquote>“We aren’t positioned to win this arms race and neither is OpenAI.”</blockquote><p>Even tech giants are recognizing this shift. A leaked Google memo reveals a startling admission: “We aren’t positioned to win this arms race and neither is OpenAI.” The memo points out that while they’ve been focused on large models and major milestones, the open-source community has been “quietly eating our lunch,” solving problems considered “major open issues” with remarkable speed and efficiency.</p><h4>The Apple Approach</h4><p>The contrasting approaches of OpenAI and Apple illustrate two divergent paths in AI implementation. OpenAI (and many more), with its ChatGPT and recent product strategy signals (search, consumer), represents the generalized chatbot interface approach. They’ve focused on developing large, multi-purpose models, multi-modal that users interact with directly. This has certainly captured public imagination, creating a buzz around AI’s potential.</p><p>Apple, on the other hand, exemplifies the ‘baked-in’ features approach. They’ve developed comparable foundation models but have chosen to integrate AI capabilities into their existing ecosystem without a visible chatbot interface. Instead of raw model outputs, users interact with GUI elements that leverage AI behind the scenes. Features like email prioritization or document summarization in Apple’s products demonstrate this subtle yet powerful integration of AI.</p><p>Apple’s strategy aligns with the idea of AI as a technology rather than a product. It showcases how AI can enhance user experiences without becoming the center of attention.</p><h4>SLMs and Narrow</h4><p>While large language models have hogged the limelight, the real game-changers are likely to be specialized language models (SLMs) and narrow AI. These focused models excel at specific tasks, making them more efficient and practical for integration into consumer devices. They also cost a lot less to run.</p><p>The advantages of SLMs over LLMs are numerous. They require less computational power, making them suitable for edge devices. They can be fine-tuned more easily for specific applications, allowing for rapid iteration and improvement. Most importantly, they align with the vision of AI as a technology to be integrated rather than a standalone product.</p><p>The Google memo reinforces this point, noting that “Giant models are slowing us down” and suggesting that “In the long run, the best models are the ones which can be iterated upon quickly.” This aligns perfectly with the advantages of SLMs and narrow AI.</p><h4>Democratization of AI</h4><p>The release and subsequent leak of Meta’s LLaMA model marked a turning point in AI development. Suddenly, powerful AI models were in the hands of the open-source community, sparking a wave of innovation that’s challenging the dominance of big tech.</p><p>We’ve seen remarkable breakthroughs in model efficiency and deployment. running LLaMA on a MacBook CPU and on Raspberry Pi (5 tokens per sec) demonstrate that AI isn’t confined to massive data centers anymore. The Vicuna model, achieving near-parity with Google’s Bard for just $300 in training costs.</p><p>These developments are leveling the playing field. Smaller companies and individual developers now have the tools to innovate in AI, potentially outpacing larger, more resource-rich competitors.</p><p>The Google memo acknowledges this trend, stating, “Open-source models are faster, more customizable, more private, and pound-for-pound more capable.” It goes on to admit, “They are doing things with $100 and 13B params that we struggle with at $10M and 540B. And they are doing so in weeks, not months.”</p><h4>Conclusion</h4><p>It’s clear that we’re moving towards a future where AI is less of a standalone marvel and more of a behind-the-scenes powerhouse. The companies and developers who grasp this new paradigm — understanding AI as a technology to be integrated rather than a product to be sold — will lead the charge in the next few years.</p><p>The ongoing democratization of AI, driven by open-source initiatives and rapid community innovation, promises to accelerate this trend. We’re entering an era where the <strong>ability to creatively apply AI will matter more than the capacity to develop the largest models.</strong></p><p>AI won’t be the product — it’ll be the invisible force making every product better. As AI becomes the electricity.</p><p>As the Google memo concludes, “People will not pay for a restricted model when free, unrestricted alternatives are comparable in quality.” This sentiment perfectly encapsulates the shift towards AI as a commodity technology, seamlessly integrated into our digital experiences rather than standing alone as a product.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de63e40366c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[With LLMs, everything looks like a nail.]]></title>
            <link>https://medium.com/@adelkhalil/with-llms-everything-looks-like-a-nail-431f7e157293?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/431f7e157293</guid>
            <category><![CDATA[lda]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Mon, 03 Jun 2024 17:35:22 GMT</pubDate>
            <atom:updated>2024-06-03T17:35:22.423Z</atom:updated>
            <content:encoded><![CDATA[<h4>Topic Modeling with good old Machine Learning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d5UbglRv3UKcOPscl1-tPg.png" /><figcaption>When you have a hammer, everything looks like a nail.</figcaption></figure><p>I am on a journy to automate much of the stuff I do not like to do but have to, making notes (and later on mental models) of certain topics or a project I am working on with different people is extreamlly time consuming, inefficent and you can easily lose some context or an important update.</p><p>So it pushed it to the top of my list of things to find better way to do them.</p><p>I keep all of these notes in my Notion, and the new system would write those notes for me and <strong>most importantly in the right place</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhtppwLFlTsuRqJcuTEeZA.png" /></figure><h3>Topic Modeling</h3><p>Enought context, now, one key area is the ability of this system to determine exactly what a piece of information belongs to, when someone post a slack message or send an email with important update the system should be able to understand which project or topic this update is related to.</p><blockquote>A topic model is a type of statistical model for discovering the abstract “topics” that occur in a collection of documents.</blockquote><p>While its tempting to just use LLM to get this done quickly I want to take a “beleive it or not” different approach.</p><h3><strong>Why Not Use LLMs for Everything?</strong></h3><p>For my use case the processing will be in the background, nevertheless I wan to have a cheap way to do it, I have thousands of emails every month sometimes with attachments as well not to mention adding google drive files or slack conversations.</p><p>Generally,</p><p><strong>High computational cost</strong>: Running LLMs requires significant computational resources, while API rates continue to come down its still very expensive.</p><p><strong>Energy consumption</strong>: LLMs consume a lot of energy, which can be a concern for sustainability so if you don’t need all those weights for what you are trying to do maybe its not the best approach.</p><p><strong>Latency issues</strong>: For real-time applications, the response time of LLMs might be too slow.</p><p>I will also add for this specific use case three more drawbacks</p><p><strong>Simplicity</strong>: For straightforward tasks like basic text classification or topic modeling, LLMs can be overkill.</p><p><strong>Interpretability</strong>: Traditional methods often provide more interpretable results, LLMs are indeterministic, if you wnat to get json with topics and scores its not easy to force the model into a response format (newer more expensive models are better at this)</p><p><strong>Context Window</strong>: A bigger sample size a better modeling and LLMs are notorioues of small context windows (more relatively to this use case).</p><h3><strong>Topic Modeling with Latent Dirichlet Allocation (LDA)</strong></h3><p><a href="https://jmlr.org/papers/volume3/blei03a/blei03a.pdf">LDA</a> is very powerful, It assumes that each document is a mixture of topics and each topic is a mixture of words. and more importantly its also generitive :) so you still on living on the edge.</p><p>LDA can be more efficient and interpretable than LLMs for certain tasks, especially when dealing with large text corpus.</p><p>While Python is the AI language its tempting but let’s face it we will write lots of loops and I am more comfortable with C# so let’s give it a try.</p><h3>LDA impelmentation in ML.NET</h3><p>ML.NET have been around for sometime but the <a href="https://devblogs.microsoft.com/dotnet/announcing-ml-net-3-0/">latest release</a> brought some much needed improvments and <a href="https://github.com/dotnet/machinelearning/releases">the roadmap look even more exciting</a>.</p><p>To perform LDA on a corps of text (in this case emails) its only 4 steps.</p><p>1. <strong>Prepare the Data</strong>: Collect and preprocess the text data.</p><p>2. <strong>Vectorize the Text</strong>: Convert text data into numerical format.</p><p>3. <strong>Apply LDA</strong>: Use LDA to discover topics in the text data.</p><p>4. <strong>Analyze Results</strong>: Interpret the topics and analyze the results.</p><p>So let’s dig in</p><p>I prepared the data by downlading emails using Gmail APIs and store them in JSON on disk also wrote this simple type to hold Body text similar to this <a href="https://github.com/dotnet/machinelearning/blob/fc89745fd9d5d7dcca875570bd3b9ffc981f2184/docs/samples/Microsoft.ML.Samples/Dynamic/Transforms/Text/LatentDirichletAllocation.cs">example</a></p><pre>public class TextData<br>{<br>  public string Text { get; set; }<br>}</pre><p>Now making coffee while the extreamlly large in number of requests nugest download.</p><pre>dotnet add package Microsoft.ML<br>dotnet add package Microsoft.ML.Transforms</pre><p>Once you have prepared the data and added the required nuggets, time to start an ML Context</p><pre>Create a new ML context, for ML.NET operations.<br>var mlContext = new MLContext();<br><br>// Convert training data to IDataView.<br>var dataview = mlContext.Data.LoadFromEnumerable(documents); //List&lt;TestDate&gt;</pre><p>One we have the data we can build the pipeline, to perform text normalization (lowercase, remove stopwords…etc) then we vectorize the normalized text and finally apply LDA.</p><pre>// Create a text normalization transform<br>var preprocessPipeline = mlContext.Transforms.Text.NormalizeText(&quot;NormalizedText&quot;, &quot;Text&quot;)<br>  // Tokenize the normalized text into words<br>  .Append(mlContext.Transforms.Text.TokenizeIntoWords(&quot;Tokens&quot;, &quot;NormalizedText&quot;))<br>  // Remove default stop words from the tokens<br>  .Append(mlContext.Transforms.Text.RemoveDefaultStopWords(&quot;Tokens&quot;))<br>  // Map the tokens to keys<br>  .Append(mlContext.Transforms.Conversion.MapValueToKey(&quot;Tokens&quot;))<br>  // Produce n-grams from the tokens<br>  .Append(mlContext.Transforms.Text.ProduceNgrams(&quot;Tokens&quot;))<br>  // Apply Latent Dirichlet Allocation (LDA) to the tokens to extract features<br>  .Append(mlContext.Transforms.Text.LatentDirichletAllocation(&quot;Features&quot;, &quot;Tokens&quot;, numberOfTopics: 3));</pre><p>Here we fit the IDataView into the transformer and create a predectior</p><pre>// Fit the preprocessing pipeline to the data view to create a transformer<br>var preprocessTransformer = preprocessPipeline.Fit(dataview);<br><br>var predictionEngine = mlContext.Model.CreatePredictionEngine&lt;TextData, TransformedTextData&gt;(preprocessTransformer);        <br><br>// Convert the sample text into LDA features and print topics with scores.<br>foreach (var sample in documents)<br>{<br>   var prediction = predictionEngine.Predict(sample);<br>   PrintLdaFeatures(prediction);<br>}</pre><p>The predection engine will return scores only without the topics which is not very usefull.</p><p>breaking down the pipeline between preprocessing and LDA will not also work.</p><p>After unearthing this <a href="https://github.com/dotnet/machinelearning/pull/5260">PR on ML.NET repository</a>, looks like the best bet is to try to get an instance of <em>LatentDirichletAllocationTransformer </em>and call the newly/ish intorduced <a href="https://github.com/dotnet/machinelearning/blob/4bc753a404c0078b0181e5bd7b236f343c84f7b7/src/Microsoft.ML.Transforms/Text/LdaTransform.cs#L217"><em>GetLdaDetails</em></a><em> </em>method to extract topics</p><pre>// Get the LDA transformer from the preprocessing transformer<br>var ldaTransformer = preprocessTransformer.LastTransformer;<br>if (ldaTransformer != null)<br>{<br>                // Get the LDA model details and print the topics with their scores<br>     PrintTopicsWithScores(ldaTransformer, seed: 0);<br>}<br>else<br>{<br>     Console.WriteLine(&quot;LDA transformer not found in the preprocessing pipeline.&quot;);<br>}</pre><p>Once you have an instance of the transformer you can print topics with their scores easily</p><pre>private static void PrintTopicsWithScores(LatentDirichletAllocationTransformer ldaTransformer, int seed)<br>{<br>   var ldaDetails = ldaTransformer.GetLdaDetails(seed);<br>   var wordScoresPerTopic = ldaDetails.WordScoresPerTopic;<br><br>   Console.WriteLine(&quot;Topics with their corresponding scores:&quot;);<br><br>   for (int topicIndex = 0; topicIndex &lt; wordScoresPerTopic.Count; topicIndex++)<br>   {<br>        Console.WriteLine($&quot;Topic {topicIndex}:&quot;);<br>        var topicTerms = wordScoresPerTopic[topicIndex].OrderByDescending(term =&gt; term.Score).ToList();<br><br>            foreach (var wordScore in topicTerms)<br>            {<br>               Console.WriteLine($&quot;  {wordScore.Word}: {wordScore.Score:F4}&quot;);<br>            }<br>    }<br>  }</pre><p>Running the model and the predections will display the topcs with their coressponding score, notice that some of the emails are not cleaned properly which led to scoring of some css properties.</p><p>While <a href="https://github.com/AngleSharp/AngleSharp">AngelSharp</a> helped sanitizing html emails it looks like some html and css properties prevaild, while scored lower compared to other topics it may also mean that I need to write some custom code over <a href="https://www.ietf.org/rfc/rfc1866.txt">HTML RFC 1590</a> and <a href="https://datatracker.ietf.org/doc/html/rfc7993">CSS RFC 7993</a> if there is a better way please let me know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*PQfQ_L1ivgTvRfl_7TcDZA.png" /></figure><p>Now we have at least a starting point to cheaply extract topics across potentially millions of documents with fraction of what it would cost with LLMs.</p><p>Training data 500 email, test data 267 emails.</p><p>Hope this helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=431f7e157293" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vertical Slicing: The Single, Most Impactful Engineering Practice]]></title>
            <link>https://medium.com/@adelkhalil/vertical-slicing-the-single-most-impactful-engineering-practice-feb99187882f?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/feb99187882f</guid>
            <category><![CDATA[engineering-mangement]]></category>
            <category><![CDATA[incremental-development]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[vertical-slicing]]></category>
            <category><![CDATA[agile-development]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Tue, 02 Apr 2024 10:51:43 GMT</pubDate>
            <atom:updated>2024-04-02T10:51:43.111Z</atom:updated>
            <content:encoded><![CDATA[<h4>If you can adopte only one practice make it vertical slicing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*akLDXjtfla7Ykw1Y" /></figure><p>Slicing, splitting stories, or evolutionary design is not a new idea, one of the earliest references to evolutionary design principles can be found in the work of David Parnas, who introduced the concept of “software aging” <a href="https://www.researchgate.net/publication/3560773_Software_aging">in his 1994 paper </a>witht he same name In this paper, Parnas argued that software systems should be designed to accommodate change and evolve over time, as opposed to attempting to build a static, immutable system from the start.</p><p>With that in mind, and with thousands of years of collective software engineering experience we now know that we usually do not exactly what we want to build till we build it and then we truly understand what we want to build.</p><p>We should cultivate a mindset of “humble certainty,” recognizing that there are no absolutes. Even when we’re convinced of the value of a feature for our customers, we must remain open to the possibility that our assumptions could be challenged or proven incorrect.</p><blockquote>We should cultivate a mindset of “humble certainty,” recognizing that there are no absolutes.</blockquote><h3>What is vertical slicing?</h3><p>Vertical slicing is a software development approach that focuses on implementing a thin vertical slice of functionality across all layers of an application, rather than building the layers horizontally one at a time. In simpler terms, it means implementing a small end-to-end feature that cuts through the entire application stack, from the user interface to the database, before moving on to the next feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RO_SbPFvm4TSR1JpnH2kA.jpeg" /></figure><p>Imagine you’re building a simple web application that allows users to create, read, update, and delete blog posts. Instead of building the entire user interface first, then moving on to the backend logic, and finally integrating with the database, you would take a vertical slice approach.</p><ol><li><strong>User Interface (UI)</strong>: First, you would start by creating a basic user interface that allows users to view a list of blog posts. This might include a simple HTML page with some placeholder data.</li><li><strong>Backend Logic</strong>: Next, you would implement the necessary backend logic to fetch the list of blog posts from a data source, such as an in-memory list or a file.</li><li><strong>Data Storage</strong>: After that, you would integrate with a database or any other data storage solution to persist the blog posts and retrieve them when needed.</li><li><strong>End-to-End Integration</strong>: Finally, you would connect all the layers together, ensuring that the user interface can display the list of blog posts retrieved from the database through the backend logic.</li></ol><p>Simple enough, if you look at this from a purly engineering perspective, but take these learning and apply them to the entire chain of business and product management.</p><h4>Vertical Slicing is not an Engienering only practice</h4><p>Modern teams do not work in a vacum, for business and commercial teams, vertical slicing allows for early customer feedback and validation of the feature.</p><p>The minimum viable slice can be released quickly to gauge customer interest and gather insights for further development.</p><p>Let’s say you are building a review feature for e-commerce your product manager should prioritize the vertical slices based on business objectives and customer needs.</p><p>For example, if the primary goal is to increase customer engagement and trust, the initial focus could be on enabling customers to leave reviews and displaying them prominently.</p><p>If the objective is to improve product quality and seller accountability, vertical slices related to seller responses and moderation workflows might take precedence.</p><p>This way you align the entire organization from commercial to product, design and engineering to work on small slices that shorten the feedback loop for everyone involved.</p><h3>Why vertical slicing is the most impactful practice?</h3><p>This post title is not a clickbait, If you are not yet a believer, let’s take a look at the impact of vertical slicing on engineering metrics.</p><p>If you are adopting <a href="https://dora.dev/">DORA metrics</a> and familier with the four metrics then perhaps you already picked on how vertical slicing will be helpful here</p><ul><li>Deployment Frequency: This alignes with vertical slicing, the more and thinner slices the more frequencly you deploy the more you would invest in your pipeline, also thinner slices minimize deployment risks.</li><li>Lead Time for Changes: With thin vertical slices you reduces lead time for changes by breaking down features into smaller increments.</li><li>Mean Time to Resolve (MTTR): By virtue of deploying a thinner slice, troubleshooting becomes more faster and efficient.</li><li>Change Failure Rate (CFR): While it may look like counter-intuitive more releases definitly would equal more failures but with much reduced surface area of change isolated failure rate will drop even faster.</li></ul><p>and its not only DORA, every other metrics will benefit</p><p>Code Quality Metrics → More efficent code reviews, easier to spot issues</p><p>Code Churn → You wouldn’t have much to change to begin with</p><p>Technical Debt → The smaller the changes the easier to find time to pay for their debt, frequently.</p><p>and the list goes on…Time to Market (TTM), Feature Adoption Rate, ARPU.</p><blockquote>Vertical slicing enables you to improve your DORA metrics by fostering good habits and establishing reliable development infrastructure.</blockquote><h3>Practcing vertical slicing</h3><p>I have to admit, its very challenging and we’ve been working for the last few months and we are barely in touching distance from where we want to be, but here is how we are approaching this:</p><h4>Starts with user stories</h4><p>You see, the cardinal sin we’ve all been committing is treating user stories like rigid scripts instead of what they were intended to be</p><blockquote><strong>“User stories are promises for conversations.”</strong></blockquote><blockquote>Alistair Cockburn, one of the initiators of the Agile movement</blockquote><p>and this is exactly how we should treat it, not an SRS disguise in agile user story, you just need a ticket that says this feature that would help engagement let’s talk about it when the time comes.</p><p>and the reason is its all about learning, if we stuff as much details in the user story today, few weeks of learning thanks to incremental improvements will render those details outdated at best and at worse invalid.</p><blockquote>As an author of the Agile Manifesto</blockquote><blockquote>I want that stupid story format to go away</blockquote><blockquote>So that people can get to the essence of user stories</blockquote><blockquote><strong>- Ron Jeffries, Co-creator Agile Manifesto and XP</strong></blockquote><p>My favourite format is a simple one that help me capture the most important details</p><ul><li><strong>The WHAT- </strong>Tell the story in a sentence or two</li><li><strong>The WHO </strong>— users, stakeholders, call them out</li><li><strong>The WHERE- </strong>How does this fit with what we know, what we have?</li><li><strong>The WHY </strong>— What is the goal and for which stakeholder?</li><li><strong>The HOW (optional) — </strong>1–2 sentences on how you envision the user experince or the flow.</li></ul><p>Since we started this article talking about evolutionary design, let’s see how we should evolve from how we write user stories now to achive small incremental value using vertical slicing.</p><p>Say we’re working on a new feature for a video streaming app that allows users to download videos for offline viewing. Here’s how that journey might look:</p><p>The Flawed Template Start A classic anti-pattern is treating the user story template as the be-all and end-all. We’ve all been there:</p><p>“As a user, I want to be able to download videos so that I can watch them offline.”</p><p>Sure, it checks the syntax boxes, but it doesn’t spark any meaningful conversation. It’s a high-level idea stated plainly, without any real substance.</p><p>The Clunky Expansion Realizing we need more context, we might overcompensate with an everything-and-the-kitchen-sink type expansion:</p><p>“As a user who has paid for a premium subscription and has the latest version of the iOS/Android app, I want to be able to browse through my watchlist or continue watching where I left off, select videos to download over WiFi for offline viewing on my phone, with the ability to choose quality settings, see how much space the download will take, and get notifications when the download is complete or if there are any errors…”</p><p>Yikes. Now we’ve gone too far down the implementation details rat hole. We’ve accounted for every possible exception and scenario, leaving zero room for an actual conversation. It’s the dreaded remix of those bloated, indecipherable requirements doc days of old.</p><p>Time to course-correct — set the high-level context, but leave room to explore the nuances:</p><p>“For our premium subscribers, we need a way to download videos from their watchlists to their mobile devices for offline viewing. The key requirement is allowing them to browse and select which videos they want to download over WiFi, see how much space it will take up, and have a simple way to view/play those downloaded videos even when they don’t have an internet connection.”</p><p>There, that’s much better. We’ve clearly set the WHAT (offline mobile viewing), WHO (premium subscribers) and core WHY (viewing without internet). But we’ve left space to have a conversation around the details — the different viewing experiences, quality settings, download management,… you name it.</p><p>Now we slice and dice! With our strong narrative foundation, we can cut this puppy into vertically-sliced, value-laden increments:</p><p>Spike: Investigate offline viewing APIs and DRM implications for our existing streaming stack</p><p>Slice 1: Stub out a basic downloadable content viewer experience</p><p>Slice 2: Add browsing/selection of videos with WiFi-only download</p><p>Slice 3: Download management — queue, progress, notifications</p><p>Slice 4: Support downloading over mobile data for waiting period</p><p>Slice 5: Advanced downloading — quality, device management</p><p>Each slice can be developed and validated as a consumable end-to-end experience before moving to the next one. We’ve obeyed all the commandments — slicing vertically for fastest value delivery, spiking on risks early, stubbing for a MVP base, and only expanding complexity in subsequent slices.</p><p>So there you have it — from a deceptively simple yet flawed template, to an overstuffed nightmare, to finally landing on a playable story that combines clear high-level narrative with sliceable, demonstrable value. It’s the agile version of Goldilocks progressively finding the “just right” porridge.</p><p>The moral of the story? (Pun intended). Don’t let those user story templates constrain you. They’re a conversation prompt, not a prison. Instead, learn to channel your inner storytelling skills — set the context, spark an actual dialogue around the nuances, and deliver value is rapid, releasable, feedback-driven slices. It’s the stuff agile dreams are made of.</p><h4>When to slice?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYY5MiIyzHEXs34EN3OpXg.png" /></figure><p>As you approach a specific user story implementation, add more details. Capture learning that impacts future work and refine your approach with newfound knowledge.</p><h4>How to slice?</h4><p>Its a workshop, its not the product manager, not even with the engienering manager, its the team.</p><p>Ladies and gents, surprise, surprise <strong>This is backlog refinment.</strong></p><p>During the refinement workshop don’t be afraid of breaking down those stories even further, here is my go to set of questions — feel free to use recursively ;)</p><ol><li>“What is the smallest piece of functionality that we can deliver to achieve the desired outcome for this feature?”</li><li>“How can we break down this feature into smaller, more manageable tasks?”</li><li>“What is the simplest way to implement this feature, and how can we ensure it is maintainable over time?”</li><li>“How can we prioritize and sequence the slices to deliver value incrementally?”</li><li>”What metrics or feedback mechanisms can we put in place to validate the success of each slice?”</li><li>“How can we design each slice to be extensible and accommodate future enhancements or changes?”</li><li>“Can we identify any opportunities for code reuse or shared components across different slices?”</li><li>“What are the acceptance criteria or definition of done for each slice, and how can we ensure they are met?”</li></ol><p>Vertical slicing: Continuous value delivery, one slice at a time.</p><p>The API evolution approaches I covered earlier make great general guidelines for developing thin, incremental slices give it a read.</p><p><a href="https://blog.adelkhalil.com/apis-continuous-improvement-without-breaking-clients-163407e809e5">APIs Continuous Improvement without Breaking Clients</a></p><h3>Recap</h3><ul><li>Vertical slicing is the single most impactful engineering practice that involves implementing a thin vertical slice of functionality across all layers of an application.</li><li>It promotes an evolutionary design approach, allowing for continuous learning, feedback, and adaptation.</li><li>Vertical slicing benefits the entire organization, from business and commercial teams to product management, design, and engineering.</li><li>It aligns with DevOps practices and positively impacts metrics such as deployment frequency, lead time for changes, mean time to resolve issues, and change failure rate.</li><li>Effective vertical slicing starts with treating user stories as conversation starters rather than rigid scripts.</li><li>Teams should collaboratively refine and break down user stories into manageable, value-driven slices during backlog refinement workshops.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feb99187882f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APIs Continuous Improvement without Breaking Clients]]></title>
            <link>https://medium.com/@adelkhalil/apis-continuous-improvement-without-breaking-clients-163407e809e5?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/163407e809e5</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[breaking-changes]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Sat, 23 Mar 2024 13:08:25 GMT</pubDate>
            <atom:updated>2024-03-23T13:08:25.945Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1KipB6WKt9p-lDSulD5AVQ.jpeg" /></figure><p>A few weeks ago, we released a change that broke an older version of our mobile app. Despite its age, this version still had a few users.</p><p>This prompted me to hold a refresher with the team after reflecting on what went wrong. I wanted us to adhere to some principles and techniques that would allow us to move faster without accumulating a lot of debt, breaking clients, and at the same time, prevent a heavy release coordination and management process between different teams.</p><p>In this article, I will be outlining a few principles with examples on how to go about implementing some of them.</p><h3>API Design</h3><ul><li>Plan for Flexibility: Anticipate potential future changes and design for extensibility.</li><li>Prioritize Backward Compatibility: Consider how changes might impact existing clients and prioritize compatibility.</li><li>Utilize Versioning: Implement a clear versioning strategy (e.g., SemVer) to manage breaking changes.</li><li>Design for Optionality: Make new features or fields optional in early versions to allow clients time to adapt.</li><li>Consider Feature Toggles: Use feature toggles to enable/disable features without code changes,facilitating experimentation and gradual rollouts.</li><li>Thorough Documentation: Provide comprehensive API documentation with clear descriptions,examples, and potential breaking changes.</li></ul><p>In our case we didn’t want to opt-in for a complicated release coordination process we beleived that good pratcies can overcome most of the challenges we are facing, let’s walk through this example.</p><p>Suppose we have an API with a /posts endpoint for managing blog posts. Initially, the API has the following version (v1) with basic functionality:</p><pre>POST /api/v1/posts<br>{<br>  &quot;title&quot;: &quot;My First Blog Post&quot;,<br>  &quot;content&quot;: &quot;This is the content of my first blog post.&quot;<br>}</pre><p>Later, we decide to introduce a new feature, such as “tags,” in a new version (v2) of the API:</p><pre>POST /api/v2/posts <br>{<br>  &quot;title&quot;: &quot;My First Blog Post&quot;,<br>  &quot;content&quot;: &quot;This is the content of my first blog post.&quot;, <br>  &quot;tags&quot;: [&quot;introduction&quot;, &quot;design-principles&quot;] <br>}</pre><p>To maintain backward compatibility, you can provide the new features as optional parameters or fields in the new version of the API</p><p>While this is straight-forward enough, managing multiple endpoint versions can quickly become complex. Therefore, our approach is to only update the API version under specific conditions:</p><p>a) When introducing new features that require dropping backward compatibility.</p><p>b) When the existing version accumulates technical debt, making it cumbersome to maintain various feature flags and optional parameters for different client versions.</p><h3>Database Changes</h3><ul><li>Non-Destructive Data Migrations: Plan database schema changes with non-destructive migrations to preserve existing data.</li><li>Soft Deletes: Implement “soft deletes” instead of hard deletes for potential recovery or historical access.</li><li>Default Values for New Fields: Provide default values for new fields in schema changes to prevent errors in existing clients.</li><li>Database Versioning: Consider tools for database versioning and rollback capabilities for complex changes.</li></ul><p>Let’s take an example of how to apply changes with a non-destructive approach. Let’s say we have a Users table with an Age field and we want to change this to Birthdate for obvious sane reasons. This is how to horribly implement this, engaging your entire full stack in the change</p><pre>-- Destructive changes<br>-- Add a new non-nullable Birthdate column with default value<br>ALTER TABLE Users<br>ADD COLUMN Birthdate DATE NOT NULL DEFAULT &#39;1900-01-01&#39;;<br><br>-- Drop the Age column<br>ALTER TABLE Users<br>DROP COLUMN Age;<br><br>-- Require Birthdate column to be entered when editing user account<br>-- This constraint is implemented at the application level, not in the database schema</pre><p>A better approach, is to add a new nullable Birthdate column and create triggers to handle population of the Birthdate column and calculation of the Age column based on either the provided Birthdate or the calculated Age.</p><pre>-- Non-destructive changes<br>-- Add a new nullable Birthdate column<br>ALTER TABLE Users<br>ADD COLUMN Birthdate DATE NULL;<br><br>-- Update existing data to populate Birthdate column and calculate Age<br>UPDATE Users<br>SET Birthdate = STR_TO_DATE(CONCAT(YEAR(NOW()) - Age, &#39;-01-01&#39;))<br>WHERE Birthdate IS NULL;<br><br>-- Remove the Age column<br>ALTER TABLE Users<br>DROP COLUMN Age;</pre><p>This approach allows for gradual changes without requiring an outage and can be coordinated more easily with changes to the application.</p><p>For database verioning you can use something similar to Flyway or at the very least manage schema versions manually, here is a simified approach that you can use as a start.</p><p>Create a Versioning Table: Start by creating a table in your database to track the current version of the schema. This table will store the version number and any additional metadata you may need.</p><pre>CREATE TABLE IF NOT EXISTS schema_version (<br>    version INT NOT NULL<br>);</pre><p>Organize your SQL scripts into numbered files, each representing a version of the database schema. For example:</p><pre>001_initial_schema.sql<br>002_add_users_table.sql<br>003_add_indexes.sql</pre><p>Apply Scripts in Sequence: Write a script or a series of commands to apply these SQL scripts in the correct order. This script should also update the versioning table after each successful execution.</p><pre>-- Apply initial schema<br>SOURCE /path/to/001_initial_schema.sql;<br>-- Update schema version<br>UPDATE schema_version SET version = 1;<br><br>-- Apply next script<br>SOURCE /path/to/002_add_users_table.sql;<br>-- Update schema version<br>UPDATE schema_version SET version = 2;<br><br>-- Apply subsequent scripts...</pre><p>By following a similar approach, you can manage database versioning effectively. However, keep in mind that as your schema evolves and becomes more complex, using dedicated database migration tools like Flyway or Liquibase will definitly be worth it.</p><p>You can evolve this by adding automatic rollback, dependency management, and integration with CI/CD pipelines.</p><h3>API Versioning</h3><p>To support continuous improvement while ensuring the efficiency and performance of our API ecosystem, I want us to adopt a revised versioning and retirement strategy that implements a limited number of active versions.</p><p>This approach combines stable URLs, custom headers, Semantic Versioning (SemVer), and a controlled version lifetime to provide flexibility, backwards compatibility, and optimized resource allocation.</p><h3>SemVer</h3><p>Utilizes a three-part numbering system (MAJOR.MINOR.PATCH) to indicate the scope and impact of changes:</p><ul><li>MAJOR: Increments for breaking changes requiring client code updates.</li><li>MINOR: Increments for new features without breaking changes, maintaining compatibility.</li><li>PATCH: Increments for bug fixes with no functional changes, preserving compatibility.</li></ul><h3>Versioning Strategy with Version Limit</h3><ul><li>URL Stability: Existing API URLs will remain consistent across minor and patch versions within the active set.</li><li>Custom Header: The “x-service-api-version” header allows clients to specify the desired API version for each request.</li><li>Default Behavior: Requests without the header will automatically receive the base (latest stable) version within the active set.</li><li>SemVer Adherence: We’ll strictly follow SemVer principles to communicate changes clearly and ensure compatibility.</li><li>Limited Active Versions: We will maintain a pre-defined number (e.g., 3) of active versions at any given time.</li><li>Push-to-Retire Model: Introducing a new version will require retiring the oldest active version.</li></ul><h3>Retirement Strategy</h3><ul><li>Deprecation Notice: Prior to retirement, the oldest active version will be marked as deprecated with a set timeframe for its retirement (e.g. once we introduce version 3).</li><li>Deprecation Features: Deprecated features will be marked as such within the documentation and might eventually be removed from the retiring version.</li><li>Version Sunset: After the designated timeframe, the deprecated version will be retired and no longer accessible.</li></ul><h3>Pros and Cons</h3><p>Pros:</p><ul><li>Stable URLs: Clients don’t need to update URLs with minor and patch versions within the active set.</li><li>Flexible Access: Clients can choose specific active versions while others continue using the base.</li><li>Backwards Compatibility: Base version ensures compatibility for older clients.</li><li>Clear Communication: SemVer provides accurate information about changes.</li><li>Version Management: Limited active versions improve performance and reduce complexity.</li><li>Controlled Evolution: Push-to-retire model encourages focused development on newer versions.</li></ul><p>Cons:</p><ul><li>Header Requirement: Clients must actively specify versions for correct behavior.</li><li>Version Awareness: Clients need knowledge of available active versions for appropriate header usage.</li><li>Migration Requirements: Clients must eventually migrate to newer versions as older ones are retired.</li><li>Limited Feature Visibility: Deprecation may temporarily limit access to certain features.</li></ul><h3>Implementation Guidelines</h3><p>For Backend</p><ul><li>Utilize middleware to inspect the “x-service-api-version” header and route requests based on version attributes.</li><li>Apply version attributes (e.g., [ApiVersion(&quot;1.2&quot;)]) to controllers or actions to distinguish version compatibility.</li><li>Implement version-specific logic within controllers based on their version attributes.</li></ul><pre>//C#<br>public class VersionMiddleware<br>{<br>    private readonly RequestDelegate next;<br><br>    public VersionMiddleware(RequestDelegate next)<br>    {<br>            this.next = next;<br>    }<br><br>    public async Task Invoke(HttpContext context)<br>    {<br>            string version = context.Request.Headers[&quot;x-service-api-version&quot;];<br>            // Map version to controller/action based on attributes<br>            await next(context);<br>    }<br>}</pre><p>For Frontend (Angular/Flutter):</p><ul><li>Create a service or interceptor to set the “x-service-api-version” header globally for all API requests.</li><li>Allow overriding the global header for specific calls when needed.</li><li>Update versions on the client-side as notified by the backend deprecation notices.</li></ul><pre>//TypeScript<br>@Injectable({<br>  providedIn: &#39;root&#39;<br>})<br>export class ApiService {<br>  private apiUrl = &#39;https://api.example.com/&#39;;<br>  private versionHeader = &#39;1.0&#39;; // Global setting<br>  constructor(private http: HttpClient) {}<br>  getUsers() {<br>    return this.http.get&lt;User[]&gt;(this.apiUrl + &#39;users&#39;, {<br>      headers: new HttpHeaders({ &#39;x-service-api-version&#39;: this.versionHeader })<br>    });<br>  }<br>  getSpecificUser(userId: string, version: string) {<br>    // Override global header for this call<br>    return this.http.get&lt;User&gt;(this.apiUrl + `users/${userId}`, {<br>      headers: new HttpHeaders({ &#39;x-service-api-version&#39;: version })<br>    });<br>  }<br>}</pre><pre>//Dart<br>import &#39;package:http/http.dart&#39; as http;<br><br>class ApiService {<br>  final String baseUrl = &#39;https://api.example.com/&#39;;<br>  static const versionHeader = &#39;x-service-api-version&#39;;<br>  String? globalVersion = &#39;1.0&#39;; // Global setting<br><br>  Future&lt;List&lt;User&gt;&gt; getUsers() async {<br>    final response = await http.get(<br>      Uri.parse(&#39;$baseUrlusers&#39;), // Combine baseUrl and endpoint<br>      headers: {versionHeader: globalVersion}, // Use proper indentation<br>    );<br><br>    if (response.statusCode == 200) {<br>      List&lt;User&gt; users = (json.decode(response.body) as List&lt;dynamic&gt;)<br>          .map((userData) =&gt; User.fromJson(userData))<br>          .toList();<br>      return users;<br>    } else {<br>      throw Exception(&#39;Failed to load users&#39;);<br>    }<br>  }<br>}<br><br>class User {<br>  // Add User class attributes and constructor here<br>}</pre><h3>Version Limit Setting</h3><p>Finally, wanted to put a limit on the number of active versions we are maintaining, the way I can think about it is by balancing factors like API stability, client migration timeline, and desired development agility in our case we will start with maintaining 3 active major versions and adjust as we need.</p><p>Let me know your thoughts, any technique to improve API felixability and backward compatibility?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=163407e809e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Why does HTML think “chucknorris” is a color?” its actually about Gen AI]]></title>
            <link>https://medium.com/@adelkhalil/why-does-html-think-chucknorris-is-a-color-its-actually-about-gen-ai-9d9fbd0f81c4?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d9fbd0f81c4</guid>
            <category><![CDATA[gen-ai-tools]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[code-generation]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 08:43:28 GMT</pubDate>
            <atom:updated>2024-03-05T08:43:28.245Z</atom:updated>
            <content:encoded><![CDATA[<p>Ok I will tell you why, but let’s first talk about Gen AI.</p><p>Sometime ago Stack Overflow banned the answering questions using generative AI and I cannot help but remember back when Stack Overflow become popular the company I was working for banned it.</p><p>I use tools like CodeWhisper from Amazon and I can see how it saves time but it also more often than not just dump (there is a reason why the added this to Rider)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*5Z2egITSLvAu8dK5a5Xm1g.png" /></figure><p>While still I get ton of value from Gen AI code tools the more I use it the more I see how dangures it is without vetting every answer and just use it for guidance.</p><p>Don’t get me wrong I wish I can build entire projects with Gen AI and lots of new models are getting better and better but its not there yet and I am worried if it will be ever.</p><p>I think in the long run it will depend on how good Gen AI can get with limited training data you see, what tools like ChatGPT…etc does is just stealing other websites/companies/people data for training and a lot of businesses that are dependent on their content are tightening the grip to reduce/disallow this leak of training data you see this with Stack Overflow, Medium but also with how GitHub got heat (and a <a href="https://www.infoq.com/news/2022/11/lawsuit-github-copilot/">lawsuit</a>) when Copilot was first launched, training on open source code and then charge for it will not go well with the community.</p><p>If this continues without other sources of data potentially they will get worse.</p><p>I think at some point in time years ago there were this distinction between people who read books on subjects and people who follow tutorials and I think the same distinction will emerge between people reading articles and understanding subjects and people who just query xGPT.</p><p>While this is not a definit test by any means, compare these answers for the same question</p><p>“Why does HTML think “chucknorris” is a color?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*JUYrxLLAkwjHUrV2d22GMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*B7BI6vMhbjRFM9-v5rZzSQ.png" /></figure><p>So please continue to use Copilot, ChatGPT, CodeWhisper…etc but be aware its not ready just yet and to vet it you still need to read books.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d9fbd0f81c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exception Handling 101 & When to manually return HTTP Status Code?]]></title>
            <link>https://medium.com/@adelkhalil/exception-handling-101-when-to-manually-return-http-status-code-49f09a592591?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/49f09a592591</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[exception-handling]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 12:02:24 GMT</pubDate>
            <atom:updated>2024-03-01T12:02:24.115Z</atom:updated>
            <content:encoded><![CDATA[<p>Exception handling in APIs is like navigating a treacherous terrain. One wrong step, and your application could tumble into chaos. As developers, we often find ourselves grappling with questions like: Should I wrap exceptions? How do I strike a balance between robustness and readability? Fear not! In this opinionated guide, we’ll explore various techniques for handling exceptions in APIs, let’s agree on few things first.</p><h3>Return Meaningful HTTP Status Codes</h3><p><a href="https://en.wikipedia.org/wiki/Roy_Fielding#:~:text=He%20is%20an%20authority%20on,the%20Apache%20HTTP%20Server%20project.&amp;text=Fielding%20works%20as%20a%20Senior,Systems%20in%20San%20Jose%2C%20California.">Roy Fielding</a> (and here is his <a href="https://www.linkedin.com/in/royfielding/">LinkedIn</a> to prove he is an actual human), along with his squad of internet wizards, <a href="https://www.rfc-editor.org/rfc/rfc7231">cooked up this handy system</a> to make sure your web surfing experience stays smooth as silk and it goes like this:</p><p>1xx: Hold on</p><p>2xx: Here you go</p><p>3xx: Go away</p><p>4xx: You screwed up</p><p>5xx: I screwed up</p><p>Let’s make a pact to cherish the contributions of Roy and the wizards, committing to only use standard HTTP status codes in our work. Ok. Done? Good.</p><p>Now to the more important question, How?</p><h3>Navigating through the shadows, I found my path to illumination</h3><p>As an optimistic engineers in my early days, I certainly wrote something like this:</p><pre>try<br>{<br>    int quantity = int.Parse(request.Query[&quot;quantity&quot;]);<br>    // Process valid quantity<br>}<br>catch (FormatException)<br>{<br>    return BadRequest(&quot;Invalid quantity format&quot;);<br>}</pre><p>Even in my early days, I did a good thing here, guess what? I decided not to filter my catch with a god-filter (i.e. the generic Exception) I mean, why stick with the same old boring defaults, right? does FormatException fits..who cares to the next point.</p><p>While this works it doesn’t provide the user with a lot, its invalid is it stock levels, is it negative, how to fix that.</p><p>Into Custom Exceptions</p><pre>public class InvalidQuantityException : Exception<br>{<br>    public InvalidQuantityException(string message) : base(message) { }<br>}<br><br>try<br>{<br>    int quantity = int.Parse(request.Query[&quot;quantity&quot;]);<br>    if (quantity &lt;= 0)<br>    {<br>        throw new InvalidQuantityException(&quot;Quantity must be greater than zero.&quot;);<br>    }<br>    // Process valid quantity<br>}<br>catch (InvalidQuantityException ex)<br>{<br>    return BadRequest(ex.Message);<br>}</pre><p>A better solution indeed, at least now we can give a bit more clarity to the user/caller/client/postman on the reason why his request failed.</p><p>As my confidence grew, I ventured into <strong>exception filters</strong>. These are like middleware for exceptions, allowing me to intercept and handle them in a centralized manner. I created a custom filter that could log exceptions and return a user-friendly error message based on the exception type. This centralized approach kept my code cleaner and more maintainable.</p><p><em>100 XP points, Software Design Mastery Unlocked</em></p><p>Finally, I stumbled upon the <strong>opinionated approach</strong>. While catching everything can be tempting, I often found myself simply re-throwing exceptions without adding value. Here’s where my personal philosophy comes in:</p><blockquote><strong>Don’t wrap exceptions unless you’re adding context.</strong></blockquote><blockquote>Adel, few mins ago</blockquote><p>If an exception already provides enough information, let it bubble up and be handled by higher-level exception filters. This can reduce unnecessary nesting and improve code clarity.</p><p>While catching everything can be tempting, I often found myself simply re-throwing exceptions without adding much value. Here’s where my personal philosophy comes in: <strong>Don’t wrap exceptions unless you’re adding context.</strong> If an exception already provides enough information, let it bubble up and be handled by higher-level exception filters. This can reduce unnecessary nesting and improve code clarity.</p><p>However, there are exceptions (pun intended) to this rule. If you can <strong>enrich the error message</strong> with additional context specific to your API, then wrapping the exception becomes valuable. For example, instead of simply re-throwing a DatabaseException, you could wrap it with a ProductNotFoundException that includes the product ID the user was searching for.</p><h3>Should I manually return 5xx HTTP Status Code?</h3><p>I don’t recall a when was the last time I actually wrote code that would return 500, there are two reasons for a 500 HTTP Status Code to be warranted</p><ul><li><strong>Unforeseen Errors</strong>: For truly unexpected errors that defy categorization, a 500 might be the only option (Or do a better job of eliminating those cases).</li><li><strong>Limited Control</strong>: If the error originates from external dependencies beyond your control, providing a detailed message might not be feasible (almost 99.999999% of the time).</li></ul><p>If you remember we established that its a good thing that we follow the advice of</p><blockquote><strong>Don’t wrap exceptions unless you’re adding context.</strong></blockquote><blockquote>Adel, one hour ago</blockquote><p>So almost always we should a) never manually throw 5xx</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49f09a592591" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Accelerating Experience for Newly Minted Managers]]></title>
            <link>https://medium.com/talabat-tech/accelerating-experience-for-newly-minted-managers-b2bcf4676b8e?source=rss-8910b46d7cfe------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2bcf4676b8e</guid>
            <category><![CDATA[leadership-coaching]]></category>
            <category><![CDATA[leadership-skills]]></category>
            <category><![CDATA[organizational-culture]]></category>
            <category><![CDATA[people-management]]></category>
            <category><![CDATA[leadership-development]]></category>
            <dc:creator><![CDATA[Adel Khalil]]></dc:creator>
            <pubDate>Thu, 08 Oct 2020 09:15:23 GMT</pubDate>
            <atom:updated>2020-10-08T09:15:23.509Z</atom:updated>
            <content:encoded><![CDATA[<p>In an ideal world, when you start a new project, product line, or spin-out a successful feature into its own team, all you need is to hire a great manager, a few talented engineers, a designer…etc, and kick things off to great success.</p><p>Unfortunately, as it comes to no one’s surprise, we do not live in an ideal world. The best strategies any company can come up with will go unrealized if you don’t have the right team behind it.</p><p>In this article, we discuss identifying leadership characteristics and distinguishing them from individual contributors traits, and how to <strong>accelerate the process of acquiring experience</strong> for people moving into management.</p><p>Given <a href="http://talabat.com/">talabat</a> continuous growth and the <a href="https://www.linkedin.com/company/talabat-com/jobs?trk=nav_type_jobs">immense demand for talented engineers and inspiring leaders</a> we have to grow from within as well as getting amazing people onboard.</p><p><strong>Nature versus Nurture</strong></p><p>Both the “Great Man” and “Trait” theories suggest that the capacity of leadership is inherent and that those great leaders are born, not made.</p><p>Trait theories, in particular, often identify distinct personality or behavioral characteristics shared by leaders. But if specific traits are key features of leadership, how do we explain people who possess those qualities but are not leaders?</p><p>On the other hand, behavioral theorists believe that leaders are made, not born, through a series of learning, observation and coaching experiences. If this is the case, how can you teach charisma, influence, integrity and empathy?</p><p>You can argue that some inborn traits can predispose people to become great leaders, but your job is to identify those traits, complement, and amplify them.</p><p>No matter which camp you end up in, it’s important to identify what leadership characteristics are the most essential in your new leaders and how you can work closely with them, helping them to close gaps in their leadership skills to function efficiently.</p><p><strong>Identifying Potential Leaders from Individual Contributors</strong></p><p>You often hear stories along the lines of “this talented engineer… a superstar talent who got promoted into management and then things went downhill…”. It’s somewhat folklore in the industry.</p><p>It’s no surprise that this happens more often than anyone wishes, an individual contributor is a very different role than that of a people manager, but that doesn’t mean you roll the dice on your best engineer. It’s a dangerous move; in addition to failing to place a new manager, you also risk losing your best engineer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*1SCR1YE92VIThEddZUVs1Q.png" /></figure><p>Looking at different individual contributors’ traits can give you a signal about what kind of leader they could become. By correlating an IC’s traits to leadership characteristics, you not only get to minimize the risk but also gain an excellent insight into which qualities to complement and amplify.</p><p>Congratulations: you already started to build your plan!</p><p>The idea from the table below is that if they have one, then they have a higher chance of successfully growing the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*vQNve5KwzDnvhrF9A4B22w.png" /></figure><p>Once you build an understanding of your potential leaders’ traits you can make better placement and development decisions.</p><p><strong>Accelerating Experience by Coaching</strong></p><p>Once you have identified these gaps in your new managers, it’s time to work with them closely to improve their management skills, closing leadership gaps and developing their mindset in a way that equips them with the right mentality enabling them to deal efficiently with future situations and circumstances.</p><blockquote><em>Experience is (the process of getting) knowledge or skill from doing, seeing, or feeling things </em>— Cambridge Dictionary.</blockquote><p>People build experience at a different pace and different individuals can interpret the same situations differently; some may be keen observers while others need time, multiple occurrences, or a small nudge for these experiences to sink in.</p><p>How can we accelerate this for the keen observer and make it happen quicker for everyone else, helping them become more efficient in absorbing months’ worth of experience ideally in a shorter time span?</p><p><strong>Shadow Coaching</strong></p><p>Shadow coaching is not <em>exactly</em> the real-time observation of work practices and communication flow, however, it is very close to that concept.</p><p>In this process, you simply ask them to go about their day or week (the cadence is up to you), and then reflect on the decisions they made, opportunities they took, and risks they mitigated (or observed). This creates a framework for continual learning, reflecting over the previous period.</p><p>During extended discussion sessions about the various situations that a coachee encountered and how they approached them, you dig a little deeper on why they took these decisions, communicated in a certain way, or how they built their perspective on an issue.</p><p>You should follow interesting threads, ask questions to clarify, and try to navigate adjacent areas of the conversation. Oftentimes, the coachee does not know which part of their day is worth venturing into. It’s your role to dig into these less obvious areas.</p><p>American psychiatrist Dr. Peter R. Breggin says, <em>“A major characteristic of brain-damaged patients is the tendency to confabulate</em> — to hide and dissemble about their damage.”</p><p>But what does this mean; basically it is natural for people to subconsciously avoid surfacing some topics.</p><p>It is also very crucial that you don’t address the issues at their face value; you look at the reasoning behind them to figure out from your earlier understanding what traits of the coachee shaped and brought them to this thought process, understanding and judgment.</p><p>Your goal here is not to fix situations; these situations happened in the past. Your goal is to help the coachee build the ability to navigate them more successfully in the future by challenging their thought process.</p><p>For these sessions to be practical, you need to take steps to build stronger relationships and set up the most nurturing environment. We will explore some of these steps in the following sections.</p><p><strong>Build Common Understanding and Set Expectations</strong></p><p>Changing people’s mindset is a massive investment in time and energy for both sides. The coachee must have a clear understanding of the expectations along with the drive to go through the process.</p><p><strong>Establishing Trust</strong></p><p>There are multiple levels of trust; changing people’s mindset requires a high degree of flexibility that can only come with an even higher level of trust.</p><p>Don’t be mistaken — this trust doesn’t come automatically to you because you are their manager or mentor. You are hoping to change their mindset and how they see things certainly has an impact beyond their job.</p><p>To ensure the best outcomes, you need to validate that you have their trust. It is essential — after all, they are the ones narrating their communications, decisions, and feelings to you, and so they must have faith in your motivations and judgment.</p><p>Clearly explain why you are investing in them — there is something in this for you as well, and you should state it clearly. Having better managers and leaders within your team frees you to focus on other things which may be very high impact, and will improve the overall organization. In turn, this will help you grow yourself.</p><p><strong>Mutual Value Addition</strong></p><p>It may seem obvious that you are working with them to improve their management and leadership skills, but a shorter-term gain would create the needed urgency and high level of concentration and commitment required.</p><p>So start here: if the long-term goal is for them to be better managers, leaders, and people, then what is the short-term goal?</p><p>It could be a promotion, a new project, or simply helping them out of a position that they are currently struggling with.</p><p><strong>Setting Expectations</strong></p><p>Once you have defined the short-term, it becomes easy to put a timeline to show meaningful results.</p><p>Changing someone’s mindset takes time. It won’t be fair, nor realistic, to expect ground-breaking improvements or a completely different person in a few weeks; what you can aim for is a noticeable change in their growth and learning trajectory.</p><p>They start building a more comprehensive perspective on issues or begin approaching problems differently; whatever their development needs are, you should start seeing a noticeable improvement and you no longer have much to add or correct. Your coaching value should start to diminish over time.</p><p>Having a solid understanding of their development needs, one should be able to gather qualitative and quantitative data points around their improvements.</p><p><strong>Keep Reflecting</strong></p><p>Take notes during your sessions with the exact phrasing they use for interesting communications or decisions they made. Reflect later, and map your understanding to their characteristics. Was this a communication or a decision you expect from this person, are they screening or improving? Think about how you can help them see things more clearly.</p><p><strong>Don’t Compare with yourself</strong></p><p>A common mistake is to (unintentionally) compare the new manager to your best self. You will find yourself perplexed as to why they struggle to see what is crystal clear to you. Even if you try to compare to your younger self, you often recall an unrealistic version of yourself because you just can’t fathom that these basic concepts were once foreign to you — Time is tricky that way!</p><p>Your benchmark should always be what skills and characteristics required for the job they are trying to do and how much of that they are able to master.</p><p><strong>Work Behind The Scenes</strong></p><p>Your work doesn’t stop at having these frequent conversations; you must work proactively to create the right environment for them to succeed or fail fast, as changing mindsets can also be expensive.</p><p>People tend to use the tools they <em>know</em> rather than those that are better-suited if they are not comfortable with them. Work on denying them these options that limit their growth.</p><p>This is very important, so let me give you a couple of examples.</p><p><strong>The Introvert</strong></p><p>Suppose you are coaching someone to be better at communicating with stakeholders. Make sure there is a specific project that is reliant on performing quality communication themselves.</p><p>Be aware that they may find it easier to lean on someone else to do this part, such as a product manager or business analyst.</p><p>By assigning them to a side or a separate project with different stakeholders, you force them to hone their communication skills rather than get by relying on someone else. You create the environment for them to succeed.</p><p><strong>The All-Nighter</strong></p><p>Suppose another newly promoted manager tends not to delegate and works late hours to finish his team’s work because it’s the only way he knows how to get things done.</p><p>Make sure they are getting a broader scope that is virtually impossible for them to handle everything alone, again forcing them into figuring out how effectively delegate more to their team.</p><p><strong>Measure Growth Trajectory</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*GxFboAwd7jzNRDSf1LCe7Q.png" /></figure><p>As an experience, people grow at different paces and rhythms. Mindset change, accumulating experience and becoming a better manager is a gradual process that takes years — what you need to measure is a positive growth trajectory rather than absolute growth or meeting pre-defined hard goals.</p><p>Use qualitative data to measure improvements in the most important areas and pay attention to the speed and scale of these improvements, a positive steep curve is what you are looking for.</p><p>Happy coaching!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2bcf4676b8e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/talabat-tech/accelerating-experience-for-newly-minted-managers-b2bcf4676b8e">Accelerating Experience for Newly Minted Managers</a> was originally published in <a href="https://medium.com/talabat-tech">talabat Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>