<?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 Damien Hanoun on Medium]]></title>
        <description><![CDATA[Stories by Damien Hanoun on Medium]]></description>
        <link>https://medium.com/@d.hanoun?source=rss-8f387301288------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YPD97f1JxYJVskZVIspHfA.jpeg</url>
            <title>Stories by Damien Hanoun on Medium</title>
            <link>https://medium.com/@d.hanoun?source=rss-8f387301288------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 12:48:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@d.hanoun/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[Prospecting planning using Linear Programming in C#]]></title>
            <link>https://medium.com/@d.hanoun/prospecting-planning-using-linear-programming-in-c-9bc9ee8082ff?source=rss-8f387301288------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bc9ee8082ff</guid>
            <category><![CDATA[prospecting]]></category>
            <category><![CDATA[calendar]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[google-or-tools]]></category>
            <category><![CDATA[linear-programming]]></category>
            <dc:creator><![CDATA[Damien Hanoun]]></dc:creator>
            <pubDate>Thu, 27 Feb 2025 14:46:21 GMT</pubDate>
            <atom:updated>2025-03-14T12:33:34.760Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lAGlPyYy2x2TrJM5X6eHKw.png" /><figcaption>A linear programming representation</figcaption></figure><p>Recently, I worked on a project in which I had to think about handling vendor prospecting planning through a calendar.</p><p>I quickly reached a point where I began to see the intricacy of the rules, which, in the long run, seemed like they would be a nightmare to update – especially in the case of drastic changes. At that stage, it was just an initial attempt, but there was a strong likelihood that the code wouldn’t hold up when tested with real user data and would require significant changes. I was working alone on the project and didn’t want to spend too much time refactoring. Furthermore, I planned to handle more complex cases in the future, which would involve managing multiple levels of preferences, such as the importance of a meeting, the distance between a vendor and their clients, and more.</p><p>Even if I feared it would take me days or weeks without results, I tried <a href="https://developers.google.com/optimization/introduction/dotnet">Google ORTools</a> nuget packages to solve my problem using linear programming. In hours, I started to get results with a few lines of code, the ability to handle preferences (when the vendor would prefer to do his/her prospective or not), and the nonnecessity to write code when I don’t want to decide where to distribute the time left.</p><h3>The story</h3><p>You are a vendor who needs to prospect to reach your objective. You already filled in all the information that allows the system to compute how much time you need to spend calling prospects.</p><p>Then, you arrive at the screen, which we can see in the image, to define your weekly preference for prospecting :</p><ul><li>Grey: Don’t take into account</li><li>Orange: Don’t prefer</li><li>Green: Without preference</li><li>Blue: With strong preference</li></ul><p>When we continue, we see that the calendar&#39;s distribution is done almost instantly according to the preferences set just before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MoDCX13dt377CFYAfkldkQ.gif" /></figure><h3>Solving the problem</h3><p>Here are the steps I implemented to solve this problem:</p><ul><li>1 Slice preferences by part of 30 minutes (What we see in the first table)</li><li>2 Merge times for which preferences were the same (ex: if 9h30 - 10h and 10h - 10h30 are strongly preferred, it becomes 9h30 — 10h30) to optimize further computation</li><li>3 Apply these week preferences to the expected period (like the next three months)</li><li>4 Remove moments that are already planned in the calendar (other meetings in Outlook or so)</li><li>5 At the end of this sequence, we end with a list of periods with preferences we can use to solve our problem using linear programming as explained in the next part.</li><li>6 Once solved, we get periods with allocated time. We then merge the adjacent ones where the first one is fully allocated (ex: if 9h -10 h is filled with 1h and 10h -11h is filled by 30 minutes, it becomes a meeting from 9h to 10h30).</li></ul><h3>Using linear programming</h3><h4>What it is</h4><p>Linear programming is a mathematical method that allows finding an appropriate outcome given certain <strong>constraints</strong> (either <strong>soft </strong>or<strong> hard</strong>). Instead of solving the problem by ourselves step by step, we apply <strong>constraints</strong> to a <strong>model</strong> and ask a <strong>solver</strong> to try to solve it for us. “Try” because not all problems are solvable.</p><h4>Google ORTools introduction</h4><p><a href="https://developers.google.com/optimization/introduction/dotnet">Google ORTools</a> is what I used to do linear programming. It is available as a nugget package for C# but uses C++ behind the scenes. It is available in other languages and requires Microsoft Visual C++ Redistributable to be installed on Windows or the equivalent for Linux. I had to use a Linux container to use this package on my free Azure Web Application because there is no way to install Microsoft Visual Redistributable C++ on the Windows one.</p><p>To start using it, we need a solver. Some are free, like SCIP, GLPK, GLOP, or CP-SAT. Some require a commercial license, like Gurobi or CPLEX. I started using the <a href="https://developers.google.com/optimization/cp/cp_solver">CP-SAT</a>, which is recommended for solving Integer Linear Problems (ILP).</p><p>Some notions (considering each example is independent):</p><pre>// Creation of the model<br>var model = new CpModel();<br><br><br>// HARD CONSTRAINT<br>// Create a variable that must be between 0 and 10<br>var x = model.NewIntVar(0, 10, $&quot;x&quot;);<br><br>// Apply a hard constraint on the model where x must be equal to 2<br>// Note that x == 2 return a linear constraint, not a boolean<br>model.Add(x == 2);<br><br>// Apply a hard constraint on a list of variables<br>var apples = new List&lt;IntVar&gt;() { /*...*/ };<br>model.Add(LinearExpr.Sum(apples) &gt;= 10);<br><br><br>// SOFT CONSTRAINT<br>// Maximize a soft constraint<br>// If not possible, it will allow to do another way<br>var periods = new List&lt;IntVar&gt;() { /*...*/ };<br>var preferenceWeights = new List&lt;int&gt;() { /* same number of elements as periods */ };<br>var preferenceObjective = LinearExpr.WeightedSum(periods, preferenceWeights);<br>model.Maximize(preferenceObjective);<br><br>// We can maximize or minimize only once<br>// To allow multiple soft constraints, we use + to maximize and - to minimize<br>// In this case, if we minimize unpreferredMomentObjective (meaning the list contains positive integer)<br>// Another way to do it would be to set negative integer in it and use + instead of - here<br>// Better you try it to understand<br>model.Maximize(preferredMomentObjective - unpreferredMomentObjective);<br><br><br>// Create solver<br>var solver = new CpSolver();<br><br>// Solve the model<br>var status = solver.Solve(model);<br><br>// Checking for status<br>if (status is CpSolverStatus.Optimal or CpSolverStatus.Feasible)<br><br>// Get the answer<br>var xSolved = solver.Value(x);</pre><h4>The code with explanations</h4><p><em>The first image of this article represents what you will see below and could help you visualize it.</em></p><pre>public Result&lt;Dictionary&lt;Period, TimeSpan&gt;&gt; Resolve(<br>        List&lt;PeriodWithPreference&gt; availableProspectingPeriods,<br>        int numberOfProspectsCalls,<br>        int averageTimeToGetAProspectOnThePhoneInMinutes)<br>    {<br>        var totalTimeProspectingInMinutes = numberOfProspectsCalls * averageTimeToGetAProspectOnThePhoneInMinutes;<br><br>        var model = new CpModel();<br><br>        // We define and allocate variable that represent all available periods<br>        var prospectingAllocationTimes = new List&lt;IntVar&gt;();<br><br>        for (var i = 0; i &lt; availableProspectingPeriods.Count; i++)<br>        {<br>            // We create and constraint each prospecting time allocated to be between 0 and the period maximal duration<br>            var prospectingAllocationTime = model.NewIntVar(0, (int)availableProspectingPeriods[i].GetDuration().TotalMinutes, $&quot;time_{i}&quot;);<br>            prospectingAllocationTimes.Add(prospectingAllocationTime);<br>        }<br><br>        // We add a hard constraint that say that once all periods will have prospecting time allocated, it must be equal to the prospecting total time<br>        // Note that LinearExpr.Sum(periodsAllocatedTime) == totalTimeProspecting return a BoundedLinearExpression that will be evaluated during solving<br>        model.Add(LinearExpr.Sum(prospectingAllocationTimes) == totalTimeProspectingInMinutes);<br><br>        // We then add a second hard constraint to have meeting time that are dividable by the average time to get a prospect on the phone<br>        // so that it is easier to tell to the vendor how many prospects he should expect to call during a meeting<br>        // Applying this rule could make the problem be not solvable even if there is enough time in some scenario<br>        // Ex: 2 range of time available of 15 minutes, but it takes 30 min to get a prospect on phone<br>        for (var i = 0; i &lt; availableProspectingPeriods.Count; i++)<br>        {<br>            var prospectingAllocationTime = prospectingAllocationTimes[i];<br>            model.AddModuloEquality(0, prospectingAllocationTime, averageTimeToGetAProspectOnThePhoneInMinutes);<br>        }<br><br>        // We create a soft constraint that<br>        // Encourage assigning on time when there is a preference : +10<br>        // Discourage assigning on time when there is a non preference: -10<br>        var preferenceWeights = availableProspectingPeriods<br>            .Select(p =&gt; p.TimePreferenceKind switch { Preferred =&gt; 10, Unpreferred =&gt; -10, _ =&gt; 0 })<br>            .ToList();<br><br>        // We apply the soft constraint as weight to prospecting allocated times<br>        // which is a list of exactly the same size<br>        // The idea is that solver will use both list base on index<br>        var preferenceObjective = LinearExpr.WeightedSum(prospectingAllocationTimes, preferenceWeights);<br><br>        <br>        // From here, it becomes a little more tricky<br>        // We want to distribute prospecting through days and prevent vendor to do hours of prospecting at once<br>        // To do so, we create a variable for each day and link it to the sum of all prospecting time allocated in that day<br>        var availableProspectingPeriodsByDay = availableProspectingPeriods<br>            .GroupBy(p =&gt; p.Start.Date)<br>            .ToDictionary(g =&gt; g.Key, g =&gt; g.ToList());<br><br>        var dailyAllocations = new Dictionary&lt;DateTime, IntVar&gt;();<br>        foreach (var kvp in availableProspectingPeriodsByDay)<br>        {<br>            var day = kvp.Key;<br>            var dayPeriods = kvp.Value;<br><br>            dailyAllocations[day] = model.NewIntVar(0, totalTimeProspectingInMinutes, $&quot;dailyAllocation_{day:yyyyMMdd}&quot;);<br><br>            var dailySum = LinearExpr.Sum(dayPeriods.Select(<br>                p =&gt; prospectingAllocationTimes[availableProspectingPeriods.IndexOf(p)]<br>            ));<br>            model.Add(dailyAllocations[day] == dailySum);<br>        }<br><br>        // Then, defining a min and max day allocation will help later create the objective<br>        var maxDailyAllocation = model.NewIntVar(0, totalTimeProspectingInMinutes, &quot;maxDailyAllocation&quot;);<br>        var minDailyAllocation = model.NewIntVar(0, totalTimeProspectingInMinutes, &quot;minDailyAllocation&quot;);<br><br>        foreach (var dailyVar in dailyAllocations.Values)<br>        {<br>            model.Add(maxDailyAllocation &gt;= dailyVar);<br>            model.Add(minDailyAllocation &lt;= dailyVar);<br>        }<br><br>        // Finally, we define an objective that represent the gap between min and max allocation<br>        var dailyBalanceObjective = maxDailyAllocation - minDailyAllocation;<br><br>        // We finally tell the model that our objective is to maximize defined preferenceObjective<br>        // but minimize the daily difference in time so that time is well distributed through days<br>        model.Maximize(preferenceObjective - dailyBalanceObjective);<br><br>        var solver = new CpSolver();<br>        var status = solver.Solve(model);<br><br>        if (status is not CpSolverStatus.Optimal and not CpSolverStatus.Feasible)<br>        {<br>            return Result.Fail(&quot;Not enough available time to schedule all calls.&quot;);<br>        }<br><br>        var prospectingAllocatedTimes = new Dictionary&lt;Period, TimeSpan&gt;();<br><br>        for (var i = 0; i &lt; availableProspectingPeriods.Count; i++)<br>        {<br>            // We finally get the computed values from the solver which are the number of minutes allocated in each period<br>            var prospectingTimeInMinutes = solver.Value(prospectingAllocationTimes[i]);<br>            var prospectingPeriod = availableProspectingPeriods[i];<br>            prospectingAllocatedTimes[prospectingPeriod] = TimeSpan.FromMinutes(prospectingTimeInMinutes);<br>        }<br><br>        return Result.Ok(prospectingAllocatedTimes);<br>    }</pre><h4>A word about tests</h4><p>I often wondered what the result would be for complicated examples. I started using unit tests but needed more realistic examples to find edge cases, which I did with end-to-end manual tests. Doing integration tests would undoubtedly be a great idea for covering complex cases. The hard part with tests is that you can have different results for the same input (e.g., assigning 20 minutes between 9h and 10h with a split of 30-minute periods could end with many possible results).</p><h3>Conclusion</h3><p>It was a fun experiment, and I now trust that linear programming is a powerful ability that adds a little complexity to allow quick change when solving complex problems.</p><p>In its current state, the problem could have been solved without linear programming, albeit with significantly more code and the need to take more time to maintain it in case I would like to change the way to distribute time. However, I was planning to handle more complex cases in the future.</p><p>The drawback is that you can’t test each rule independently, as they are all handled simultaneously. If there is no optimal solution, the result may vary for the same input, requiring additional effort for testing. It is possible that testing can’t be done any other way than manually at some point of complexity. I also worry about how to write clean code with it because some mathematical formulas use tricks that are not easily understandable if you didn’t learn them. I haven’t yet found an easy way to create graphical representations in C# that are as powerful as those I can make with <a href="https://julialang.org/">Julia</a> (which I used to generate the first image of this article).</p><p>I guess, in the long run, this kind of problem-solving could benefit from being split into multiple smaller problems to keep it maintainable. Maybe using a language dedicated to solving mathematical problems (such as <a href="https://julialang.org/">Julia</a>) could help reduce the code size, isolate the mathematical part, and test the model independently of the rest of the code. Even if it looks very performant, benchmarking multiple models is a good idea to optimise performance and cost in the long run.</p><p>I keep in mind that I am a novice in the field, but what seems difficult to understand now will become second nature as I gain more knowledge about mathematical techniques for solving complex problems.</p><p>I hope you learned something and that it was clear. I am very interested in your feedback, especially if you have already used it. Feel free to <a href="https://www.linkedin.com/in/damien-hanoun-a492b072/">contact me</a> if you want to discuss it.</p><p>Thanks for reading.</p><p><em>Bonus: a repository with the (dirty) code I use to generate the schema with Julia: </em><a href="https://github.com/damienhanoun/prospecting-planning"><em>https://github.com/damienhanoun/prospecting-planning</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bc9ee8082ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Estimation in the software development process]]></title>
            <link>https://medium.com/@d.hanoun/estimation-in-the-development-process-c4a75325a8d9?source=rss-8f387301288------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4a75325a8d9</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[estimations]]></category>
            <dc:creator><![CDATA[Damien Hanoun]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 10:33:49 GMT</pubDate>
            <atom:updated>2024-09-12T15:29:08.780Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Estimation is one of those subjects that most people struggle with because they don’t understand critical points. Since gathering all the information to cover this subject efficiently could take time, I will concentrate my effort on aspects I think are the more important.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CGHBVCIPg9wW5IDQk88Bnw.png" /></figure><h3>Estimation needs a trustability index</h3><p>When making a weather forecast, they always have a trustability index. Because weather, as any element that needs to be guessed in the future, can’t be trustable at 100%. What would mean a guess with a very low level of trustability?</p><h3>What we know and what we don’t know</h3><p>Estimation evolves according to our understanding of the subject we are working on. It means we must focus on what we know and don’t know.</p><p>What we don’t know is generally where we want to look first to improve the trustability index. If team members don’t have all the knowledge, this can imply spending time learning new things.</p><h3>The forecast representation</h3><p>Since an estimate is not entirely trustworthy information, representing it as a date is confusing (not to say wrong) and makes us think that it is a clear and definitive answer.</p><p>I like tools like <a href="https://www.amazon.fr/NoEstimates-Measure-Project-Progress-Estimating-ebook/dp/B01FWMSBBK">NoEstimates</a> because they try to find a way to automate estimation calculation by replacing guesses with facts:</p><ul><li>Getting the average time passed on done work items every day.</li><li>Comparing it to the result of the last seven days, for example, to generate a range that represents the <strong>team stability of delivery.</strong></li><li>Use this stability range to forecast by assuming that the next work items are created with around the same size as the ones in the past. This gives a range of landing dates, which is very useful for having the capacity to <strong>adapt every day</strong> in the project.</li><li>Accepting that the unknown is unknown, and when we discover new things, it will add work items to the backlog, which will change the forecast range dates. This can look scary but if you don’t know, you don’t know, adding 20% or 100% time more will not change this fact. To get an idea, you can also calculate the range of added work items on previous projects so that you will replace guess by fact.</li></ul><p>NoEstimates only act on work item size, but <strong>the key point to improve the preciseness of a forecast is to reduce the variability of elements required to estimate </strong>like:</p><ul><li>Focus on what is unknown</li><li>Work on one work item at a time by developer</li><li>Let the team work together to share knowledge so that they take around the same time to treat any subject. Using peer/mob programming could help significantly on this point.</li><li>Having always the same number of developers (which is utopic)</li><li>…</li></ul><p>The resulting view gives interesting feedback that make in evidences team instability and helps the team to reason about why it takes more time to deliver at a specific point in time.</p><p>If you want a realistic forecast, it would look like this:</p><ul><li>Have a <strong>clear vision</strong> of what’s next for around a <strong>couple of weeks</strong> with a <strong>high level of estimation trustability</strong> (knowing that if it requires learning, trustability is not necessarily high): like having well-defined work items</li><li>Have a <strong>more abstract vision</strong> of what’s come after at <strong>some month level</strong> with a <strong>medium level of estimation’s trustability</strong>: like having work items with no details or a view at an higher level</li><li>Have an <strong>abstract vision</strong> of the future in the <strong>long term</strong> with estimation potentially with a <strong>low level of trustability</strong> : like just knowing that they is some projects to come later</li></ul><h3>Estimation is a tool for adaptation</h3><p>Estimation has no value in itself if it is to give us a guess about whether we want to go or continue in a direction. Spending too much time to guess is not a good strategy.</p><p>What we expect by having it is to give us the ability to adapt.</p><p>If we have a clear deadline, we need this estimation at any time to raise an alert and adapt to the situation sooner.</p><p>If we don’t, a quick general estimation could be enough.</p><p>Estimation is always done by someone, whether the calculation is done by the project manager, the team, or an automated system, whether it takes one second or one month.</p><h3>But</h3><p>I don’t know any tool that automatically fully handles all aspects of estimations.</p><p>Even if you do NoEstimates, you will be constrained to work a certain way so that the resulting estimation is at least somewhat viable. You will certainly need to take time to understand why your team is unstable at the start, which is a good exercise, but that’s not free (as taking time to estimate).</p><p>We should consider the value that the feature will add at least as much as the estimation itself. Combined, they represent the usefulness of doing it. If you look for the most valuable thing to implement next (using UX, Design Thinking, …), it should be enough to choose what to do next, even if it is combined with a low-trustable estimation.</p><p><em>Thanks for reading.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4a75325a8d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Benefits of TDD and Peer Programming]]></title>
            <link>https://medium.com/younited-tech-blog/benefits-of-tdd-and-peer-programming-ca471b435621?source=rss-8f387301288------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca471b435621</guid>
            <category><![CDATA[peer-programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[quality]]></category>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[Damien Hanoun]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 07:36:24 GMT</pubDate>
            <atom:updated>2025-08-25T12:20:00.800Z</atom:updated>
            <content:encoded><![CDATA[<h3>TDD and Peer Programming Benefits</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*xiexZXnkP4YCTAQeTngyGQ.png" /></figure><p>Some months ago, I took the lead in interviewing new talented developers for my team. I wanted to accept only developers with a foundation for producing quality software (clean code, TDD, peer programming, …) or those interested in doing so.</p><p>I have encountered candidates who did not initially understand the benefits of such techniques. After the interview, some of them told us they understood how these techniques could help them do better work for the first time.</p><p>Since my arguments helped them to understand the benefits of these techniques, this article is a good opportunity to share my vision of them.</p><h3>TDD benefits</h3><p>Developers often reduce TDD to writing unit tests first and the red-green-refactor approach. And that’s pretty much it, which is somewhat reductive.</p><p>I would feel more comfortable using Specification-Driven Design or Intent-Driven Design to demonstrate what matters, but it may be a little pretentious.</p><p>Here are the points I will use to talk about it:</p><ul><li>The to-do list: Seeing what you achieve and what is left is a powerful tool to stay motivated. It also encourages thinking step by step without knowing everything from the start. The list will generally evolve according to new problems during implementation. Kent Beck&#39;s <a href="https://www.amazon.fr/Test-Driven-Development-Kent-Beck/dp/0321146530/ref=asc_df_0321146530/?tag=googshopfr-21&amp;linkCode=df0&amp;hvadid=228957151636&amp;hvpos=&amp;hvnetw=g&amp;hvrand=1047245681324540612&amp;hvpone=&amp;hvptwo=&amp;hvqmt=&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=9056537&amp;hvtargid=pla-448095042394&amp;psc=1&amp;mcid=0da42118c881376297e13e5e40dd01df">Test-Driven Development</a> book represents it well. On my side, I keep only the following steps as a to-do list, and the previous steps are visible from my commits.</li><li>Contract first: There is a greater chance you would care about your class contract if the first thing you see and update is what you see from outside. When seeing the internal code of a method, it will make us tend to adapt the contract according to changes done inside, which has a greater chance of leading to poor design decisions and tests being more complex to maintain and understand.</li><li>More small tests for quicker feedback: Working incrementally with small intents allows us to have feedback sooner than waiting to finish an implementation before testing. If your test fails, whereas you expect it to pass, you lose only seconds or minutes to diagnose what’s wrong. I often face tests done after the implementation, which causes me to lose precious time refactoring tests and implementation and correcting logic errors that could have been done.</li><li>Double-check: In the finance world, there is a <a href="https://www.genio.ac/glossary/double-check-or-double-check/">double-check</a> system to prevent errors. Here, it is the same. Moreover, if I work alone, having the test and the implementation work the same way is reassuring.</li><li>Remove coverage percentage goals: Coverage is not an argument of quality. Quality will come from how you design your tests (structure and data), how much they help you detect unexpected change daily, and at what velocity.</li><li>Commit quality: When facing a pull request linked to a subject I don’t know, I look at commits to understand the developer&#39;s reasoning and give better feedback. As for me, you probably face commits like this: «Implementation», «Add unit test», «Correct errors», … These are not very helpful to follow the story of what has been done. TDD will help to commit by intent, resulting in a commit name that would look more like this: «Add trade-in option for the prospect in point of sales».</li><li>Handle each day with more confidence: It already happens to me to start working on a subject at 18h. Keeping my intents small, I had the time to do two commits and stop working at 18h30. Also, facing a vast subject that implies mental overload allows me to reduce it by evolving the solution step by step until I see a final solution I may not have seen from the start.</li><li>It is not only about unit tests: I will often start to define what I want with an end-to-end test or integration test, and make it fail first. Then, I will do a second level of TDD with unit tests. To validate integration between my pieces of code, I will sometimes relaunch end-to-end/integration tests to have feedback about my implementation (like checking that dependency injection works with my new classes) to finally come back at the end and check if my first test does what I expect.</li><li>Prevent over-engineering: By treating problems individually, we avoid overthinking the final solution and allow it to evolve only according to the issues we face.</li><li>Continuous simplification: Small, continuous refactorings make it easier for the system to grow smoothly over time.</li></ul><p>Even if it is a little off-topic, if you have executable acceptance specifications that execute fast enough to be used in your development workflow, you should consider reducing the number of unit tests to cases with risk.</p><p>Anyway, TDD is a tool that could help you make the right decisions, but remember that it does not make design decisions for you.</p><h3>Peer programming benefits</h3><p>When I talk about peer programming to developers, they often think it is just about having two developers behind a computer who work together on the same subject. And that’s pretty much it. Again, this vision is somewhat reductive.</p><p>Here are the points I will use to talk about it:</p><ul><li>Peers have different roles: The one with the keyboard is the session conductor in charge of updating the code, whereas the other is the observer who gives the orientation. This idea of not overlapping responsibilities mainly reduces friction and improves the workflow.</li><li>Peers often change their roles: You must change roles based on a timer or at each commit on a small amount of time basis.</li><li>Feedback, sharing, and learning: Coding with colleagues is an excellent knowledge-sharing strategy. You will share what you know by design, get a lot more feedback of better quality on a lot more aspects (like the habit you have in your IDE, the way you treat a problem, or the tools you like to use) than what you could get with pull requests, and learn a lot more quickly. It could reduce the need for presentations or documentation.</li><li>Continuous non-blocking code review: If you embrace the continuous integration philosophy, you certainly look to make ideas go faster to production without leaving quality aside. If everyone works with everyone in a team, methodologies, tools, and techniques that work best will be used by all team members and will increase trust. If you trust your colleagues, you could start thinking about removing the pull request system (which is a blocking system). On this point, I am strongly influenced by Dave Farley’s videos (like <a href="https://www.youtube.com/watch?v=WmVe1QrWxYU">I’ve Found Something BETTER Than Pull Requests…</a>), whom I could consider as my mentor. As he mentions, the idea of slowing down for safety is a mistake; we don’t improve quality by adding more bureaucracy to the process. Not to mention the time I spent explaining why I made some decisions in pull request comments before sharing it with the team.</li><li>Team capacity stabilisation: If you need to forecast (using <a href="https://www.amazon.fr/NoEstimates-Measure-Project-Progress-Estimating-ebook/dp/B01FWMSBBK">NoEstimates</a>, for example), one of your goals is to make your team predictive to reduce the forecast range. One way to achieve that is peer programming to improve knowledge-sharing and resilience to arrival, holidays, departure, or sick leave.</li><li>Improvement of quality: Two heads are better than one. Even if it ends with a slight improvement, we all know how small details can impact production or team productivity in the long run. I often hear the argument that it costs twice as much as a developer working alone, but we are comparing the quickness of delivery and quality. If, like me, you consider that quality is more critical and valuable for quickness in the long term, quickness at day level is irrelevant.</li><li>Shared energy expenditure and solving problems faster: Working with someone else will help you stay focused, especially if you are tired or the subject requires knowledge and energy. Mob programming could be a better strategy if it is a dangerous update. Listening and talking are other points that change our experience and could help us to envision our subject better and faster.</li><li>Peer as protector: If you work in your company’s building, the chances are high that someone will come to ask you something. Using your peer as protection against distractions can be helpful.</li></ul><p>When I think about it, the only concrete example I have of a team that constantly uses peer programming was at Expedia. It was six years ago during <a href="https://www.linkedin.com/posts/damien-hanoun-a492b072_soir%C3%A9e-meetup-sur-quelques-notions-agile-activity-6408063901711241216-Y0no?utm_source=share&amp;utm_medium=member_desktop">a meetup</a> where Julien Topçu and his team talked about how they handle projects using MVP, DDD, and agile methodologies like NoEstimates, eXtreme Programming, and Kanban—a fascinating way to organize.</p><h3>Conclusion</h3><p>If both allow quicker feedback and quality improvement, both also require practice to master and, in an ideal world, work with experienced people on these techniques. I never had this chance, which makes me think I still have much to learn.</p><p>I practice TDD every day and rarely face cases where using it would not make sense. I tend not to use it for test code helpers or proof of concept. I know the TCR (Test Commit Rollback) methodology will tend to be the successor of TDD, but I don’t feel comfortable using it yet.</p><p>For peer programming, I can’t use it as often as I want, and I have only used it a few times, but I have had some incredible experiences with it, even though I know I could be doing better. For the future, I am waiting for the <a href="https://www.jetbrains.com/help/idea/code-with-me.html">«Code with Me» tool of JetBrains</a> for Rider to experiment with doing peer programming with both developers coding simultaneously. I feel there is something to do with it.</p><p>Combining them feels very powerful, but I stay alert when using tools, techniques, or processes to prevent the “everyone does it” or “it is a good practice” effect. These arguments are invalid and prevent us from considering why we use them. If they don’t fit our context and we have strong arguments, we should not use them.</p><p>Think for yourself, experiment, seek to work with talented people, and keep what will make your life better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca471b435621" width="1" height="1" alt=""><hr><p><a href="https://medium.com/younited-tech-blog/benefits-of-tdd-and-peer-programming-ca471b435621">Benefits of TDD and Peer Programming</a> was originally published in <a href="https://medium.com/younited-tech-blog">YounitedTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My experience with WebStorm and Rider]]></title>
            <link>https://medium.com/younited-tech-blog/my-experience-with-webstorm-and-rider-90c9d308afde?source=rss-8f387301288------2</link>
            <guid isPermaLink="false">https://medium.com/p/90c9d308afde</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[rider]]></category>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[webstorm]]></category>
            <category><![CDATA[ide]]></category>
            <dc:creator><![CDATA[Damien Hanoun]]></dc:creator>
            <pubDate>Mon, 22 Nov 2021 10:35:20 GMT</pubDate>
            <atom:updated>2024-04-06T14:45:38.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTczjsfQiliG-hxyIK-I8A.jpeg" /></figure><p>Working with .Net Framework/.Net Core on the backend side and with angular on the frontend side, I was used to working with VSCode and Visual Studio like most of my company’s mates. Note that I had Resharper installed in Visual Studio, but I didn’t use it fully.</p><p>Some months ago, I watched <a href="https://www.youtube.com/watch?v=9BHnDmAM164">a video</a> about Rider, and I decided to try it.</p><p>I also saw on the internet that WebStorm looked to fit the front-end need. From the start, I decided to work only with those new IDEs to force me to learn quickly and save time navigating between my previous IDEs and those new ones.</p><p>To be transparent, most of my teammates are currently working on VSCode and Visual Studio.</p><p>In the following points, I want to share an overview of what changed for me compared to using my previous IDEs (based on <a href="https://drive.google.com/file/d/106JLU-xP7o7Mu2KqAsyKWyI7EtxYabMs/view?usp=drive_link"><strong>my keymap settings</strong></a>). I will also give you insights about useful shortcuts so you can experiment by yourself.</p><h3>What does it change?</h3><h4>1 Visual studio dependency</h4><p>When I installed Rider on my computer and wanted to launch some projects, I was stuck because projects require installing things that depend on Visual Studio installation. It’s been a long time, so I don’t remember the details, but I think it was related to the subject in <a href="https://youtrack.jetbrains.com/issue/RIDER-43005">this post</a>.</p><h4>2 KeyMap and Shortcuts</h4><p>First good surprise, I can configure both WebStorm and Rider to have the same keymap as I was used to before with Visual Studio (most of them). Shortcuts are mostly the same for all navigation in the UI and even for refactoring.</p><p>Since I work more on the backend than frontend, when I get back to VSCode, I often misremember shortcuts and fail to use them. And since I needed help remembering basic shortcuts, I never took the time to learn more.</p><p>It saves me a lot of time and allows me to learn more shortcuts.</p><h4>3 New shortcuts for navigation, selection, and edition</h4><p>That looks like a detail, but that’s what I am doing all the time, navigating, selecting, and editing. Actions I was previously doing with my mouse are now done with shortcuts.</p><p>Here are the most useful ones :</p><ul><li>Double click or wider selection is often replaceable by Ctrl + Alt+ horizontal arrow, which increases or decreases selection logically.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*O4QDdtR3cTHfR-Jnb0KGuQ.gif" /></figure><ul><li>Ctrl + Alt + Shift + horizontal arrow switch order of parameters, properties, ….</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*f7oJ4cPRTwmBXhmWp8H4cQ.gif" /></figure><ul><li>Alt + vertical arrow allows navigating between methods.</li><li>Ctrl + Alt + Shift + vertical arrow switch orders of method or lines of code.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*khHEm8gwCcxTDjVOBMc46Q.gif" /></figure><ul><li>Ctrl + Shift + J collapse your code which is on multiple lines to one line.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*7awffjbcw2wpz-Y-pFecHA.gif" /></figure><ul><li>Alt + 1 access/open/close to the solution view.</li><li>Ctrl + - allows me to collapse folders and projects in my solution when I focus on the solution view.</li><li>Alt + F1, Enter allow accessing the currently open file in the project tree. I use it often to find a class that is closed in the tree.</li><li>Shift + Alt + Page up allows going to the next error in the solution. Very useful when you modify some code that impacts a lot of different classes.</li><li>Shift + Enter add a new blank line below the current line.</li><li>Ctrl + Enter add a blank line over the current line.</li></ul><h4>4 Folder and Class creation</h4><p>The UI to create a class is more straightforward, using Ctrl + Shift + A:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*AG_115RUxc_rIBxvyFngWQ.gif" /></figure><h4>5 IDE suggestions</h4><p>When I launched Rider for the first time on a project, I was notified with suggestions like installing suitable plugins or launching a special command like yarn or npm install. It allows me to learn about a project even before looking at its structure and prevents some loss of time when someone in my team updates a project, and I didn’t know about it (a time I lost before having this functionality).</p><h4>6 Searchability and learning curve</h4><p>When you first open Rider, you can do some small exercises from the Tutorials Tabulation, which helps you learn some exciting functionalities.</p><p>If you know Shift +Shift, you will be able to find mostly whatever you want: a file, a class, an action, a command, …, allowing you to learn shortcuts at your own rhythm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*Fu5f5vC6jUF10VrgXkKxHg.gif" /></figure><p>The Ctrl + Shift + F and other common shortcuts are also available for global research with a more straightforward search interface than I was used to. Search is also in real-time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*4Xj0s7qI16GiiC3st8MdvA.gif" /></figure><p>Note that if you put your mouse pointer on the functionality to the right, it shows you the related shortcut. This leads me to learn and use them.</p><h4>7 Pannels filterability</h4><p>A thing that I love (discovered by mistake) is the possibility to filter some pannels like below :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*L4lDxpPyLLniAFEzXMw7og.gif" /></figure><p>It is also the case in settings like, for example, in the Style code view :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDa55kBZYcuykrhPlUs11Q.gif" /></figure><p>Or even in the solution explorer view :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*X8JAxqaz5uSGv44oG-eadA.gif" /></figure><h4>8 Behavior consistency during development through different projects</h4><p>Whether I am working on a frontend project or a backend project containing a frontend project, I can expect my IDE to work exactly the same way, using the same interface, plugins, and behaviors.</p><h4>9 NSubstituteComplete plugin</h4><p>In our projects, we use NSubstitute to create mock. The first time I opened a project that used it, Rider proposed installing a plugin that allows some autocomplete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hoiFOSIrTJLuezSAKCsGQ.gif" /></figure><p>It makes me earn a lot of time when doing unit tests knowing all the time I spend on it.</p><h4>10 Configuration panel</h4><p>The configuration panel helps me launch usual commands (IIS Express, Gulp, Nx, WallabyJs, …) from one place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*GfuTuR9SV9mQFmKNa6SvtA.gif" /></figure><p>Using Ctrl + Maj + Alt + R will open the configuration panel at the center of the screen.</p><p>You can then use arrows to navigate, press Shift to activate Debug mode, and then press Enter.</p><h4>11 Unit tests and coverage</h4><p>After asking my C# unit tests to be launched in real-time and to cover the code, I can access the Unit Tests Coverage view, which shows what is covered or not in detail. I use it sometimes before doing a “commit” to ensure that I don’t forget anything important.</p><p>On the frontend side, I still use <a href="https://wallabyjs.com/">WallabyJs</a>, which handles tests and coverage in real-time. The slight difference compared to VSCode is that the plugin allows me to access a test directly from the production code.</p><h4>12 Nuget packages view</h4><p>In Rider, do Alt + 7. When you update a package, the interface is not blocked.</p><h4>13 Changing project</h4><p>I configure Alt + P to open it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*Dm9TdRFa4UnJkESLe5-ytA.gif" /></figure><h4>14 Application Insight view</h4><p>A great view is the Application Insight view, which allows seeing logs sent to <a href="https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview">Application Insight</a>. The interface is more straightforward and doesn’t require me to do additional clicks to update logs after execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*lYxgzOaICPEi1hc60teijQ.gif" /></figure><h4>15 Warnings and errors</h4><p>The first thing that popped up to me when launching one of our projects is warnings because they are more highlighted in the build view.</p><p>The Roslyn analyzer is also activated by default. It allows highlighting problems like memory allocation when using a global variable in a closure. You can learn more with <a href="https://www.youtube.com/watch?v=K6MyJJSm1MI">this video</a>. This pushes me to optimize my code a little more than usual.</p><p>There is now an “Error in solution” view to access all warnings and errors. I plan to use it more soon to delete most alerts not shown during a build that you see only when going into each concern piece of code.</p><h4>16 Debugging in used libraries</h4><p>When doing C#, by default, when debugging in my application, I was surprised to be able to do it in a library code like a NuGet package. It sounds weird, but it helped me better understand what I was using or give more valuable feedback to the team responsible for the rest-client, which threw me an error.</p><h4>17 Expected behaviors</h4><p>WebStorm and Rider don’t apply unexpected rules to a project. This leads to finding problems because VSCode can have its own configuration (different between developers) that overrides the project rules, whereas we used <a href="https://prettier.io/">Prettier</a> (a non-opinionated code formatter).</p><h4>18 File system access from IDE</h4><p>Using Alt + &lt;- from Explorer, the file system view is accessible from the IDE, preventing me from going out of it when needed. Even in the file system view, you can see if projects are referenced or not in the solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*S0FoiQQTPKx4SHheo2G6iw.gif" /></figure><h4>19 Bookmarks</h4><p>Bookmarks can be added according to a number. That’s useful when you face information that is hard to understand and requires navigating to understand what the code is doing.</p><p>For example, Ctrl + Shift + 1 allows adding or removing one while Ctrl + 1 allows access to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*BUe0MI_jZGBMJSXmn5RdZQ.gif" /></figure><p>You can still use Ctrl + K, K to add or remove the same kind of bookmarks as Visual Studio (the ones without numbers) and use Ctrl + K, N to go to the next one if needed.</p><h4>20 Code navigation’s link categorization</h4><p>When we look at a class, a property, an interface, a virtual method, …, we now benefit from more precise links (overrides, extensions methods, …).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*5mu2M6-srIUSGSbY61DQGA.gif" /></figure><h4>21 Sonar pre-commit analysis</h4><p>Getting feedback at the commit level is satisfying and pushes me to correct more errors than if I wait to see the build result in the pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*xtO5wn7AddhX6cUZEEvYCg.png" /></figure><h4>22 Scratch files</h4><p>Being able to create test files or reusable files at the computer level without leaving the current project helps with efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*yuV7IfurFMbrxU22mlqynw.png" /></figure><h3>Summary</h3><p>I didn’t expect my experience to be that different.</p><p>All that I did every day has been impacted positively, preventing useless loss of energy, helping me learn more about projects I work on, and doing the same things as before a lot quicker (I earn seconds most of the time when I do an action in my code).</p><p>Even if, used individually, VSCode and Visual Studio are great, they have different interfaces, plugins, shortcuts, and behaviors. When working on both, it implies a loss of efficiency for me that WebStorm and Rider fulfill.</p><p>And since Rider is based on the same engine as WebStorm, I left WebStorm aside. From what I understand, the only difference is you can’t access front-side technologies project templates by default. But you can add them or use well-known commands to create your project.</p><p>I encourage you to try it if I convince you that it could be helpful in your context.</p><p>On my side, I will continue my journey with Rider hoping my experience will continue to be as great as it is now and even better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90c9d308afde" width="1" height="1" alt=""><hr><p><a href="https://medium.com/younited-tech-blog/my-experience-with-webstorm-and-rider-90c9d308afde">My experience with WebStorm and Rider</a> was originally published in <a href="https://medium.com/younited-tech-blog">YounitedTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>