<?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 Omri Lavi on Medium]]></title>
        <description><![CDATA[Stories by Omri Lavi on Medium]]></description>
        <link>https://medium.com/@omril321?source=rss-30a95298ea67------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3Ylj0MkW6cQ4fFspRXD1bg.png</url>
            <title>Stories by Omri Lavi on Medium</title>
            <link>https://medium.com/@omril321?source=rss-30a95298ea67------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:59:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omril321/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[Developing Self Compassion: An Answer to the Constant Burnout]]></title>
            <link>https://omril321.medium.com/developing-self-compassion-7c0225bb5f5b?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c0225bb5f5b</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[motivation]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Fri, 16 Jul 2021 12:21:24 GMT</pubDate>
            <atom:updated>2021-07-16T12:21:24.042Z</atom:updated>
            <content:encoded><![CDATA[<p>In the last few years, I developed an efficient routine to improve my abilities as a developer. I contributed to open source, read a lot, wrote blog posts and was active in social networks. Yet, I had a constant feeling that it’s not enough — that I’m not <em>good enough</em>. I thought I had to keep working hard, otherwise I’ll go downhill.</p><p>At some point I realized I was very stressed, and that I was concerned all the time, and that I couldn’t rest properly. I couldn’t accept positive feedbacks and found reasons why they are wrong. Generally speaking, I was very hard with myself. At some point I became aware of this situation and decided to make a process to change it. Now, a few months later, I feel much better with myself. I wanted to share my process, so that it will help others out there in similar situations.</p><p>Feel like you’re working hard and it’s still <em>not enough?</em> Are you unhappy with your job even though it’s pretty good? Are you generally stressed about <em>your value as a developer</em>? This post is for you. Take a few minutes to read through — you’ll get a new perspective.</p><h3>My Previous Routine</h3><p>In the past, I had a strict daily routine. It aggregated to the following weekly agenda:</p><ul><li>Reading a tech book — 1.5 hrs/week</li><li>Side projects, open source or writing — 10 hrs/week</li><li>Reading and keeping up to date — 3 hrs/week</li></ul><p>Usually, if I had spare time, I spent it on side projects or reading. I didn’t rest.</p><p>I learned a lot and created a lot of content. I was confident my work “pays off”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dg-CEFVxCtizENgbVoLbBA.jpeg" /><figcaption>Stressful free-time activities. (Image by <a href="https://unsplash.com/photos/1K9T5YiZ2WU">Tim Gouw</a>)</figcaption></figure><h3>When Cracks Start to Show</h3><p>With time, I noticed some things about myself:</p><ul><li>I was always stressed.</li><li>I couldn’t rest properly.</li><li>I was very sensitive to issues at work, and they influenced my mood.</li><li>Even though I got positive feedbacks, I wasn’t able to accept them. I found reasons why the feedbacks were wrong, and gave myself negative counter-feedbacks.</li><li>I had “tunnel vision” when encountering issues. I couldn’t see the “big picture”. I was too busy being concerned how I’ll be perceived.</li><li>I constantly swung between finding flaws in myself and in the environment (the company, the process, my coworkers).</li><li>I thought about work day and night. I enjoy thinking about technical challenges, but this was a different experience. It troubled me <em>where I was wrong</em>, and what will my coworkers/supervisor say.</li><li>I had a very strong imposter syndrome. I felt less professional than my surroundings and was afraid people will find out about it.</li></ul><p>For a long time I thought that <em>this is the price for having a good job</em>, and that I have to accept it. I thought that if I’ll learn and do more, I’ll feel better with myself, since I’ll be “more professional”. I remember telling myself “you can learn more, instead of resting in the evening — spend the time by reading some more”. So I pushed it a little more.</p><h3>The Awakening</h3><p>In 2020 Covid came along, and a personal disaster happened about at the same time. I started thinking about how I spend my time and what I sacrifice. I realized that the routine I’m having was taking its toll. It led me to some serious thinking about my goals and their prices.</p><p>I talked about this a lot with my wife, who is — luckily — a personal consultant. This led me to a decision to make a change. I adjusted my goals, determined to be happier.</p><p>Now, these are some big words. What does being happy even mean? Don’t worry, this post won’t get a spiritual twist 😜</p><p>“Happiness” a profoundly personal definition and will differ for each individual. For me, I wanted to have a balance between:</p><ul><li>A challenging and rewarding day job.</li><li>Time to spend with my family and friends.</li><li>The ability to maintain my hobbies.</li></ul><p>Or in other words: retaining a good job, without allowing it consuming all my energy, all the time.</p><p>I started a process to achieve my new goals.</p><h3>Becoming Aware</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7mabZCDrXsJSwHYk0VNCA.jpeg" /><figcaption>Monkey observing itself in the mirror. It’s time for reflections. (Image by <a href="https://unsplash.com/photos/84oiI1wT4zU">Andre Mouton</a>)</figcaption></figure><p>My process took part in two seemingly orthogonal parts. The first one is simple: I reduced the “extra” time I spend (side projects, reading, etc.) to an acceptable minimum. I still spend time, but considerably less. But, this isn’t enough by itself. I can’t “switch off” the part of my brain which constantly judged and said “it’s not enough”.</p><p>This was the second part, which required some more work. I observed at my thoughts and feelings about not being good enough. I noticed the following:</p><ul><li><strong>I thought I needed to know everything</strong>. I was afraid of encountering the unknown since it felt like a test. Each time someone else knew something I did not, I felt very bad. “I should have known this” was a common thought. On hindsight, I tried avoiding the unknown by trying to learn as much as possible.</li><li><strong>I was very concerned with how I’m perceived</strong>. This made me feel occasionally under test (even when I wasn’t). When struggling with a technical issue, the soon-to-come feedback troubled me more than the issue itself.</li><li><strong>I had unrealistic ideals</strong>. I know a few very successful individuals, and I take them as role-models. Yet, unconsciously I thought I can have all the positive aspects from my idols (writing blogs, contributing to open-source…), without having any of the negative aspects (the sacrifices).</li><li><strong>I understood that my ideals made me very judgmental about myself and my surroundings.</strong> When things didn’t go as I imagined I became upset. It could have been something in the workflow, or a coworker that didn’t see things as I do . The gap between my ideals and the reality made me believe (sometimes) I don’t fit.</li><li><strong>Almost all my feedbacks were positive</strong>. This part is important — my feelings about not being good enough were not based on any external feedback. Objectively, I was doing ok.</li></ul><p>After learning about my thoughts and feelings, I started making cognitive changes.</p><h3>Changing the Narrative</h3><p>To achieve my goals, I needed to cognitively change the way I think. This may sound abstract, and it’s easy to be cynical about it. However, it is feasible with a lot of hard work.</p><ul><li><strong>I accepted I CAN’T have it all</strong>. I’m no superman. I adjusted my ideals and “lowered the bar”.</li><li><strong>I remind myself where I’m doing OK</strong>. I don’t <em>have</em> to be overwhelmingly great, being OK is good enough. I allowed myself listening to external positive feedbacks.</li><li><strong>I decided to gain meaning from myself, and not my surroundings.</strong> If negative feedbacks show up, they shouldn’t affect my self-esteem. Having areas that need improvements don’t make me a bad developer.</li><li><strong>I accepted I can’t know everything</strong>. Learning is great. But, naturally, it is not possible to know everything. It is GUARANTEED I will bump into things I don’t know, and someone else will. No one can escape this scenario. This led me to an important understanding. <em>Professionalism is measured not only by what you know, but how you learn what you don’t know.</em></li><li><strong>I accepted that people have different values than me</strong>. Sometimes I have opinions of how things “should be”, that weren’t in line with my coworkers’ opinions. In times where I couldn’t convince my colleagues, I felt very bad. Instead, I now allow myself letting go of some of my ideas. “Chasing” them and trying to make them happen at all cost was frustrating.</li><li><strong>I accepted my judgmental nature</strong>. When a judgmental though came to my mind, I noticed it, and labeled it as such. I doubted it instead of accepting it as is. Eventually, I could separate cases where things are truly “bad” or rather they just don’t match my ideal (which is my problem). I moved from a passive point of view (“This is bad” or “I am bad”) to an active point of view (“Should this be improved? Can I improve it? What can I do?”).</li><li><strong>I decided to spend less time “learning” and “pushing myself forward”.</strong> Instead, I spent some time with non-work things. I learned to juggle. I improved my chess skills. I exercise more. I even play more PC games (an extreme luxury in the past).</li></ul><p>Now, I know what you’re thinking. “Huh, that’s a one way street for becoming a mediocre developer, or worse”. Is it so?</p><h3>Slowing Down ≠ Stopping</h3><p>Naturally, this change may slow my career progress. However, the pros beat the cons. I don’t feel stressed, and I’m more energetic. Non-work activities were more enjoyable. I’m more concentrated at work, and I solve problems quicker. When incidents come up at work, I’m much more calm and focused. Innovative ideas come to my mind more often, and I have time to implement them. I learn and create because I <em>want to</em>, not because I <em>have to</em>. Once you realize you don’t really chase anything — the meaning of speed matters less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxFjhLq05a5PPCIRTh2RTw.jpeg" /><figcaption>A walking person enjoying the view. It’s not a race, you won’t “win” by going faster. (Image by <a href="https://unsplash.com/photos/mNGaaLeWEp0">Emma Simpson</a>)</figcaption></figure><h3>Conclusion</h3><p>Being a developer is very demanding by itself. On top of that, each person in the dev community has something to say about what you should learn, and what you should do. FOMO is inevitable, and it’s easy to feel bad (or simply not good enough) with yourself.</p><p>I wanted to share my story, maybe it will help other devs with similar feelings. My main message to you is: Relax, breath. Remember to slow down sometimes. You’re doing alright 🤗</p><p>On a more personal note (if that’s even possible), it was very difficult to me for write on such a personal topic. I’d love to hear your thoughts about this — feel free to approach me at any way (comments, DM, emails — you name it)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c0225bb5f5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Better Error Messages in TypeScript 4.2 — Smarter Type Alias Preservation]]></title>
            <link>https://omril321.medium.com/better-error-messages-in-typescript-4-2-smarter-type-alias-preservation-7e9c9c074edc?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e9c9c074edc</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Sun, 28 Feb 2021 19:06:53 GMT</pubDate>
            <atom:updated>2021-02-28T19:06:53.269Z</atom:updated>
            <content:encoded><![CDATA[<h3>Better Error Messages in TypeScript 4.2 — Smarter Type Alias Preservation</h3><p><a href="https://dev.to/omril321/better-error-messages-in-typescript-4-2-smarter-type-alias-preservation-3j7">Originally posted on Dev.to</a></p><p>TypeScript 4.2 was <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/">recently released</a>, with many cool new features and improvements. It’s really impressive to see how TypeScript improves the developer experience one step at a time.<br>In this short post we will focus one feature, called Smarter Type Alias Preservation. I can say for myself that I really anticipate this feature. In a nutshell, it improves error messages related to union-types of union-types. I hope that in a few minutes you’ll understand better what it means, and why it is useful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*x-GjezTTNyG7k_9f.png" /><figcaption>Don’t get lost when unioning types. (Photo by <a href="https://www.thisiscolossal.com/2015/06/painstaking-new-arrangements-of-colorful-objects-and-food-by-emily-blincoe/">Emily Blincoe</a>)</figcaption></figure><h3>So What’s the Problem?</h3><p>Until TypeScript 4.2, when using a union type which contained at least one union type, the compiler “flattened” the types. In simpler terms — you couldn’t tell which types the union-type holds. Consider the following simplified <a href="https://www.typescriptlang.org/play?ts=4.1.5#code/C4TwDgpgBAMg9gOwOYBVwQIxQLwFgBQA5KJBoVAD4HHoBM5VRJEAzA9cwCztPoCsPGpABsg5gHYx6ABxTIATjmYADEoxlKHdBnqbepNnqGZuR5hgFntoq6Um3MshxkUBuAh-zNYiVHRzUAPrmgsF0ocyGjIRhkKbRsRCWCcw2Kej26ZBOWRCKRokYqgXmGrk6EdpRQebxNdrJ9aRpTZiZrRg5HW6eBABmAK4IAMbAAJaIUAC2IABiQ8NQABQAhgBcPshopJSbfpC0u0MAJhB9YwgQxwCUUADeBFBQAE4QwAPPCFAr7vgAvr18DN5iMloQAEYDKZTCDPQjXVxQAD0SKgAEFnkgoRAEMAoHA+lBvIQAESQ6GwknkMYAZygCDgeJWNJpYyQCBW4IANtBgHAoGAVs8VjDgLD8YTiSTzCTdtK6LKKFB5ZAWIrlVx1SqkuqAHT6qAsFjTOCvKD63VHBCnc6XY6EXVLWgsTh8a5AA">example</a>, where the type of the parameter a is a union of two long types and undefined:</p><pre>type LongType1 =<br>&#39;type1&#39; |<br>&#39;type2&#39; |<br>//...<br>&#39;type19&#39;;</pre><pre>type LongType2 =<br>&#39;_type1&#39; |<br>//...<br>&#39;_type19&#39;;</pre><pre>function myFunc (a: LongType1 | LongType2 | undefined) {<br>  return a;<br>}</pre><pre>myFunc(&#39;bummer&#39;); // Argument of type &#39;&quot;bummer&quot;&#39; is not assignable to parameter of type &#39;&quot;type1&quot; | &quot;type2&quot; | &quot;type3&quot; | &quot;type4&quot; | &quot;type5&quot; | ... 33 more ... | undefined&#39;.(2345)</pre><p>It’s very difficult to understand this error: Where are these string literals coming from? Which type should I be looking at? What’s the rest of the 33 more valid values? This can cause a lot of confusion and frustration.</p><h3>What’s New?</h3><p>TypeScript 4.2 is going to make your lives easier in this aspect. <strong>Smarter Type Alias Preservation makes TypeScript “remember” which union-types are being used while displaying the error messages</strong>. Instead of flattening the union-types, their alias will be preserved and shown. See the <a href="https://www.typescriptlang.org/play?ts=4.2.0-beta#code/C4TwDgpgBAMg9gOwOYBVwQIxQLwFgBQA5KJBoVAD4HHoBM5VRJEAzA9cwCztPoCsPGpABsg5gHYx6ABxTIATjmYADEoxlKHdBnqbepNnqGZuR5hgFntoq6Um3MshxkUBuAh-zNYiVHRzUAPrmgsF0ocyGjIRhkKbRsRCWCcw2Kej26ZBOWRCKRokYqgXmGrk6EdpRQebxNdrJ9aRpTZiZrRg5HW6eBABmAK4IAMbAAJaIUAC2IABiQ8NQABQAhgBcPshopJSbfpC0u0MAJhB9YwgQxwCUUADeBFBQAE4QwAPPCFAr7vgAvr18DN5iMloQAEYDKZTCDPQjXVxAA">same code from the previous example, compiled with TypeScript 4.2</a>.</p><pre>type LongType1 =<br>&#39;type1&#39; |<br>&#39;type2&#39; |<br>//...<br>&#39;type19&#39;;</pre><pre>type LongType2 =<br>&#39;_type1&#39; |<br>//...<br>&#39;_type19&#39;;</pre><pre>function myFunc (a: LongType1 | LongType2 | undefined) {<br>  return a;<br>}</pre><pre>myFunc(&#39;bummer&#39;); //Argument of type &#39;&quot;bummer&quot;&#39; is not assignable to parameter of type &#39;LongType1 | LongType2 | undefined&#39;.(2345)</pre><p>As you can see, TypeScript “remembers” that &quot;type1&quot; | &quot;type2&quot; | ... | &quot;type19&quot; is actually LongType1, and that &quot;_type1&quot; | &quot;_type2&quot; | ... | &quot;_type19&quot; is LongType2. TypeScript indeed got smarter with type alias preservation! The error is much more intuitive, so now you can shift your frustration towards something else.</p><p>As <a href="https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/#smarter-type-alias-preservation">Daniel Rosenwasser mentioned in the announcement</a>, these improvements were made possible by two pull requests, by Anders Hejlsberg (<a href="https://github.com/microsoft/TypeScript/pull/42149">PR1</a> , <a href="https://github.com/microsoft/TypeScript/pull/42284">PR2</a>). I will not get into the implementation details here. However, I encourage you to skim through the changes in src/compiler/checker.ts, or the pull requests&#39; descriptions.</p><h3>Wrap Up</h3><p>TypeScript 4.2 will bring many exciting new features. One of which is the Smarter Type Alias Preservation, which will make certain type-errors much more informative. I hope that now you have a better grasp of this feature’s meaning. Union-types have never been better!</p><p>🕵️‍♂️ <em>Psst… </em>If you enjoyed this<em>, </em>follow me on Twitter (<a href="https://twitter.com/omril321">@omril321</a>) — I tweet regularly about cool things I learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e9c9c074edc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Metric — Solving the Pain of Measuring a Project Migration]]></title>
            <link>https://omril321.medium.com/git-metric-solving-the-pain-of-measuring-a-project-migration-ec3b504e90b2?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec3b504e90b2</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Sun, 14 Feb 2021 16:27:41 GMT</pubDate>
            <atom:updated>2021-02-14T16:27:41.006Z</atom:updated>
            <content:encoded><![CDATA[<h3>Git Metric — Solving the Pain of Measuring a Project Migration</h3><p>This post was originally published in <a href="https://dev.to/omril321/git-metric-solving-the-pain-of-measuring-a-project-migration-413j">dev.to</a></p><h3>The Pain of Measuring a Project Migration</h3><p>In the past few years I’ve had the chance to participate in ongoing project migrations like AngularJS to React, or JavaScript to TypeScript. Such migrations are usually incremental and take time.<br>In most cases, it’s hard to analyze what’s the status of the migration:</p><ul><li>Are we keeping a certain velocity, or are we slowing down?</li><li>Do we obey defined rules, like stop adding AngularJS files when migrating to React?</li><li>Which developer contributed the most to the migration?</li></ul><h3>Enter Git Metric</h3><p>In an attempt to help with such questions, I’ve recently published a small utility called <a href="https://github.com/omril321/git-metric">Git Metric</a>. I believe it can help tracking the progress of most project migrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*plszm8v6CcaCseK39ZM_Mg.png" /><figcaption>Git Metric <a href="https://github.com/omril321/git-metric/tree/main/example">usage example</a></figcaption></figure><p>If you are in the middle of a project migration, Git Metric can be useful for you.<br>With Git Metric you can quickly analyze git repository’s history within minutes. Simply define the metrics you want to track (like specific file extensions, or a certain keywords in specific files) — and get a complete and holistic view of your project. You can find more details <a href="https://github.com/omril321/git-metric">here</a>.</p><p>I’d love to hear your thoughts about it 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec3b504e90b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing Your First Custom Stylelint Rule]]></title>
            <link>https://medium.com/swlh/writing-your-first-custom-stylelint-rule-a9620bb2fb73?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9620bb2fb73</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Wed, 16 Sep 2020 18:48:57 GMT</pubDate>
            <atom:updated>2021-02-16T06:16:40.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>Custom Stylelint Rules — Writing Your First one</h3><p>At <a href="https://www.testim.io/">Testim.io</a> we care about code quality and UX. For this reason, we use various tools that make development easier and more accurate. Among others, we use <a href="https://stylelint.io/">Stylelint</a> to lint our SCSS and CSS files. One of the powerful features of stylelint is the ability to add rules of your own, which will fit your project’s needs. While stylelint provides an API for adding custom rules, it can be a bit confusing when doing so for the first time.</p><p>In this blog post, we will go through the steps for adding a new custom stylelint rule to your project:</p><ol><li>Declaring and creating the plugin</li><li>Adding a rule to the plugin</li><li>Implementing the linting function along with auto-fix support</li><li>Integrating the plugin with your project’s Stylelint configuration</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yB27eJbIJ7GpVSn1" /><figcaption>It’s time to level up your style (photo by <a href="https://unsplash.com/photos/WdJkXFQ4VHY">Ben Rosett on Unsplash</a>)</figcaption></figure><h3>Background story</h3><p>In our application’s codebase, we store commonly used colors in variables. This makes color theme changes very quick and easy. While developing a visual component, we use Invision’s mockups as a reference. Invision isn’t aware of the color variables we use. Thus, Copying styles from Invision involves searching for the colors’ variables (e.g. replace #ff6363 with $color-red1).</p><p>This seems like an easy thing to do: use “find anywhere” and look for this color. Yet, the process becomes cumbersome — especially if we include many colors. Additionally, in some cases of legacy code, the variable ($color-red1) was not used. Hence, we can find the same color (#ff6363) scattered in the codebase. In such cases, the developer has to find the correct declaration in all search results.</p><p>In order to solve this inconvenience, we wrote a custom stylelint rule. It suggests the correct variable name, and even auto-fixes the errors. How convenient!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U5VmfYOi0o-Tv3Jl" /><figcaption>Our custom rule in action</figcaption></figure><p>In the following paragraphs, we will describe the steps for adding a custom rule of your own. As an abbreviated example, we’ll write a rule which will replace the expression blue with the hex value #0000FF.</p><h3>Writing the Plugin — First Steps</h3><p>Let’s start with creating a file that will contain the rule itself — in our case, it’s no-color-blue.js.</p><p>Next, you’ll need to define your rule. This way stylelint will know what to run when the rule appears in the configurations:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fea1e49b3fed4ccd611efb08fa0b3d54/href">https://medium.com/media/fea1e49b3fed4ccd611efb08fa0b3d54/href</a></iframe><p>Your file will need to export three things: the rule name, the messages that it shows, and the rule itself.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d5583a748c57506010a11b636763bc2/href">https://medium.com/media/1d5583a748c57506010a11b636763bc2/href</a></iframe><p>If it still doesn’t make much sense to you, that’s ok! In the next sections we’ll explain each part.</p><h3>Creating a Plugin</h3><p>We use stylelint.createPlugin to create and register a stylelint rule. It receives two arguments: the rule name, and the ruleFunction itself.<br>stylelint calls ruleFunction if the rule is used in the linting process. The function receives the configured options, along with the linting context object. <br>The lint function (that ruleFunction returns) will run on each file that is being linted. This is the actual core of the rule which will report the output for the linting process.<br>Let’s take a deeper look at ruleFunction and lint.</p><h3>Adding a Rule to the Plugin</h3><p>As mentioned before, stylelint calls ruleFunction for each single linting “process”. Stylelint’s rule support <a href="https://github.com/testimio/testimio/pull/280">options</a>. These can be used to customize the rule’s behavior from the stylelint’s configuration. For example, most rules support the <a href="https://github.com/testimio/testimio/pull/280">severity option</a>. When using your rule, the ruleFunction will be called with the matching options (primary and secondary).</p><p>Furthermore, stylelint provides a handy validateOptions function. Use it to automatically report errors if the user passed invalid options. Stylelint will add the errors to the linting result (called here postcssResult). The <a href="https://stylelint.io/developer-guide/plugins#stylelintutilsvalidateoptions">documentation</a> isn’t too extensive, but the <a href="https://github.com/stylelint/stylelint/blob/master/lib/utils/validateOptions.js#L16">source code</a> has some good comments.<br>The third argument of ruleFunction is the context object. It is mainly used for supporting <a href="https://stylelint.io/developer-guide/rules#add-autofix">auto-fix</a> (more on that later).</p><p>The following snippet should make things clearer:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/afefccf68ed2df9b42ec677733ea5ba6/href">https://medium.com/media/afefccf68ed2df9b42ec677733ea5ba6/href</a></iframe><p>We’re done with setting up the rule. Now, let’s write the lint function which holds the core logic of the rule.</p><h3>Performing the Linting</h3><p>After creating your rule, stylelint will run PostCSS on each linted file. Next, in the linting phase, stylelint will call the custom rule’s lint function. The lint function is at the core of your rule. It receives two arguments:</p><ul><li>postcssRoot — the parsed AST. It <a href="https://api.postcss.org/Root.html">“represents a CSS file and contains all its parsed nodes”</a>.</li><li>postcssResult — the <a href="https://api.postcss.org/LazyResult.html">LazyResult</a> which will accumulate the output of your rule’s linting.</li></ul><p>Usually, the lint function will:</p><ol><li>“Walk” through the AST (the parsed CSS nodes). Use one of the <a href="https://api.postcss.org/Root.html#walk">root.walk methods</a> for this task.</li><li>Detect invalid nodes.</li><li>Report these nodes (or fix them, depending on the “fix” flag).</li></ol><p>Let’s examine the complete example of our rule. Reminder — the rule forbids the color name blue and expects it to be replaced with the hex RGB color #0000FF.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7563d37139a550ef75357a69ec8bcaf/href">https://medium.com/media/c7563d37139a550ef75357a69ec8bcaf/href</a></iframe><p>That’s it! All that’s left is adding the rule to stylelint’s config.</p><h3>Custom Rule Integration</h3><p>Edit your project’s <a href="https://stylelint.io/user-guide/configure">stylelint configuration</a> (e.g. .stylelintrc.json). Under the <a href="https://stylelint.io/user-guide/configure#plugins">“plugins” configuration value</a>, add a path to your plugin’s file. All that’s left is activating your rule, so stylelint will actually run it. Do this by adding your rule to the <a href="https://stylelint.io/user-guide/configure#rules">“rules” configuration value</a>.<br>A minimal .stylelintrc file will look like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78840e6cae0ac28d4407570b51c78789/href">https://medium.com/media/78840e6cae0ac28d4407570b51c78789/href</a></iframe><p>Please note that for enabling a rule, stylelint requires passing options to it. Even if the rule has no options (like our no-color-blue example), it is still required to pass a true option to it. Without it, stylelint will ignore the rule.</p><p>That’s it! You and your team can now enjoy your custom linting errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XW9nBICBtmJmEDR6" /></figure><h3>Summary</h3><p>Stylelint is a very useful linting tool. It has many advantages when collaborating on common SCSS and CSS files. It comes with a vast variety of existing rules. Yet, they can’t always answer all your needs. At some point, you’ll need a linting rule that is yet to exist. It might be the project’s structure, your team’s conventions, or anything else. In these cases, custom rules will be very helpful.</p><p>I hope that after reading this post, you will be able to quickly create and integrate your own stylelint rules. This way, you will keep a higher level of code quality while respecting your project’s requirements.</p><h3>Further reading</h3><ul><li><a href="https://stylelint.io/developer-guide/plugins">Stylelint’s plugins documentation</a></li><li><a href="https://github.com/stylelint/awesome-stylelint">Awesome Stylelint — A list of awesome stylelint configs, plugins, etc.</a> [EDIT] — This post is now in Awesome List!</li><li><a href="https://stylelint.io/developer-guide/rules#commonly-overlooked-edge-cases">Stylelint’s guidelines for creating robust rules</a></li><li><a href="http://api.postcss.org/Root.html">PostCSS AST API</a></li></ul><p>🕵️‍♂️ <em>Psst… </em>If you enjoyed this<em>, </em>follow me on Twitter (<a href="https://twitter.com/omril321">@omril321</a>) — I tweet regularly about cool things I learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9620bb2fb73" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/writing-your-first-custom-stylelint-rule-a9620bb2fb73">Writing Your First Custom Stylelint Rule</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write functional tests faster using 
Testim’s Playwright Recorder Playground]]></title>
            <link>https://omril321.medium.com/write-functional-tests-faster-using-testims-playwright-recorder-playground-19493bb3f2fa?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/19493bb3f2fa</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Wed, 18 Mar 2020 17:21:50 GMT</pubDate>
            <atom:updated>2020-03-18T17:21:50.247Z</atom:updated>
            <content:encoded><![CDATA[<h3>Write functional tests faster using <br>Testim’s Playwright Recorder Playground</h3><p>I’ve started working at <a href="https://www.testim.io/">Testim</a> recently. We have an amazing tool which gives you the power to create stable end-to-end tests quickly.</p><p>Testim has just launched an awesome new (free) tool that will help you write functional tests faster. The Playground enables you to record tests and then copy the code that can run on your Playwright testing framework.</p><p>Check it out on <a href="https://www.producthunt.com/posts/testim-s-playwright-recorder-playground?utm_content=122053958&amp;utm_medium=social&amp;utm_source=twitter&amp;hss_channel=tw-3283815349">Product Hunt</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19493bb3f2fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Considerations for Your Next Utility Function Refactor — Static vs Dependency Injected]]></title>
            <link>https://medium.com/innovid/3-considerations-for-your-next-utility-function-refactor-static-vs-dependency-injected-e966d385bd27?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/e966d385bd27</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 17:00:22 GMT</pubDate>
            <atom:updated>2019-11-27T17:03:35.747Z</atom:updated>
            <content:encoded><![CDATA[<h3>3 Considerations for Your Next Utility Function Refactor — Static vs. Dependency Injected</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QXTA-1khLYzcQRAj" /><figcaption>Photo by <a href="https://unsplash.com/@jesseramirezla">Jesse Ramirez</a> on <a href="https://unsplash.com/photos/YiSD-1eJ_1g">Unsplash</a></figcaption></figure><p>The following scenario should be familiar to most developers: You look for a utility function in an existing project. Quickly you find it and realize it is private, so you can’t use it in your class. Assuming you won’t copy-paste the function, a refactor is required. Extracting the function to a new designated class seems like the best solution.</p><p>One question remains — how will you extract the function?</p><p>The first option is a static function in a new class. The second option, assuming you use any dependency injection framework (e.g. <a href="https://github.com/google/guice/wiki/Motivation">Guice</a>), is an injectable instance of a new, non-static class. In this post, we will explore the considerations of choosing between the two options.</p><p><strong>NOTE</strong>: This article mainly refers to cases where the function is used as-is, without introducing any new abstractions.</p><h3>TL;DR</h3><p>Before choosing a solution, we should ask ourselves the following questions:</p><ol><li>Does the function have injectable dependencies (by the DI framework)?</li><li>Will you need to modify the function’s behaviour in unit tests (e.g. by mocking)?</li><li>Is it an impure function?</li></ol><p>If the answer to any of the questions is yes, dependency injection (DI) is probably a better choice. Otherwise, we should replace with a static function.</p><h4>Static Function by Default</h4><p>By default, a static function would be a better solution.</p><p>Why?</p><ol><li><strong>Code readability</strong>: A static reference to a function is usually easier to understand than an injected dependency.</li><li><strong>Code impact</strong>: Extracting an existing utility function to a new static function requires no further actions. Yet, using DI requires updating the constructor, adding new class field, and updating the existing tests.</li><li><strong>Testability and performance</strong>: It usually doesn’t matter if the function is static or injected.</li></ol><p>There are some scenarios, however, where DI is preferred.</p><h4>1. Impure function</h4><p>Impure functions have <a href="https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29">side-effects</a>. They can potentially raise issues like unsafe concurrency or race conditions.</p><p>Consider the following simple example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e4b9492d527ceca22fd7044fae5b287/href">https://medium.com/media/3e4b9492d527ceca22fd7044fae5b287/href</a></iframe><p>You would like to refactor getNextNum, since you found out that multiple classes have implemented it in the same way. Perhaps lazy developers have copied the code without bothering to refactor it properly. You, however, are not a lazy developer. You want to refactor this function to reduce code duplication.</p><p>Quickly, you implement the following solution:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de0ffad665d250164c90b3672ce30ba5/href">https://medium.com/media/de0ffad665d250164c90b3672ce30ba5/href</a></iframe><p>It takes a few seconds, but you realize that this implementation is not good enough.</p><p>The main problem is that NumIncrementor.num is now a shared resource. All classes that use NumIncrementor are now affecting one another. A second problem — NumIncrementor.logIncrement is not thread-safe. Calling it from multiple threads may cause unpredictable behaviour.</p><p>You realize that updating NumIncrementor to have non-static fields and using a new instance of NumIncrementor with each consumer would be the best approach.</p><p>For the example above, using <a href="https://github.com/google/guice/wiki/Motivation">Google’s Guice</a> can help us. By default, Guice creates a <a href="https://github.com/google/guice/wiki/Scopes">new instance for injected classes</a> (unless annotated with the @Singleton annotation). This is exactly the behaviour we want.</p><p>Let’s see how to configure Guice to inject a new instance of the utility class, instead of using a static class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9ea72fa1d58f32509c98b0a8ce7d1e4/href">https://medium.com/media/b9ea72fa1d58f32509c98b0a8ce7d1e4/href</a></iframe><p>Each consumer instance will receive a new instance of the utility class when created. This way, NumIncrementor.num will no longer be shared with multiple dependants and threads.</p><p>All of the problems that were mentioned earlier will be solved, without a great impact on the code or the application.</p><p>Naturally, configurations for dependency injections are specific for each application and usage. The example above shows that in some cases, static references create issues that can be solved by using a properly configured DI.</p><p>It is important to mention that in some cases it is better to update code to be thread-safe. For example, by receiving a parameter instead of referencing to an object, or using thread-safe objects. However, this means <em>changing</em> the code behaviour, which we try to avoid in this post.</p><p><strong>Bottom line:</strong> Look for resource-sensitive operations or impure functions. Check for problems like thread-safety and shared resources. When encountering such cases, consider using a properly configured DI for solving these problems.</p><h4>2. Modifying the Behaviour of the Extracted Function in Unit Tests</h4><p>Sometimes when writing unit tests, it’s useful to replace some of the tested unit’s dependencies with new behaviour. For example, when a dependency has many edge cases or has unwanted side-effects for tests. Using the original implementation in unit tests can lead to complex, difficult, and sometimes even incorrect tests.</p><p>Replacing the implementation of dependencies in unit tests has many advantages — isolation, shorter test duration, and easy elimination of side effects are just some of the profits. It can be done by one of two main approaches: mocking or abstracted interfaces.</p><p><a href="https://dzone.com/articles/the-concept-mocking">Mocking</a> is a useful testing concept. It allows you to replace the implementation of a certain object. Some find mocking a <a href="https://stackoverflow.com/questions/38181/when-should-i-mock">controversial topic</a>, and advocate for <a href="https://sendgrid.com/blog/when-writing-unit-tests-dont-use-mocks/">using interfaces instead</a>.</p><p>Either way, both approaches are extremely helpful in unit tests and go <a href="https://dzone.com/articles/the-concept-mocking">hand-in-hand with DI</a>.</p><p>Contrary to DI, replacing a static class function for unit tests <a href="https://automationrhapsody.com/mock-static-methods-junit-powermock-example/">is difficult</a>. It requires non-conventional tools. That’s why, when extracting a function that should be replaced in tests, prefer DI over static functions.</p><p><strong>Bottom line</strong>: We will use DI when replacing the implementation of the extracted function improves your unit tests.</p><h4>3. Injectable Parameters</h4><p>Sometimes, a utility function uses dependencies applied to fields of the containing class. When extracting it to be static, the function loses access to those dependencies.</p><p>We can solve that by passing more arguments to the function, but that makes it less reusable and pollutes the consuming classes.</p><p>A preferred solution is extracting the function to a class which can be injected with DI. That way, the extracted function can access the same dependencies directly from the DI.</p><p>Consider the following example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9157b17ff71026d93185154cafc5c3a2/href">https://medium.com/media/9157b17ff71026d93185154cafc5c3a2/href</a></iframe><p>SomeClass holds a utility function, decryptToJson, which should be extracted to a new class, and depends on two parameters (input, beginIndex) in addition to two internal class fields which were injected by Guice (decryptor, jsonParser).</p><p>By extracting decryptToJson to a static function, we will no longer be able to use Guice for accessing dependencies inside the function. We will have to pass all the dependencies to the static function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4564c15e077bc9eb29c3f8bc77ae5f87/href">https://medium.com/media/4564c15e077bc9eb29c3f8bc77ae5f87/href</a></iframe><p>This forces the consuming classes to contain fields which are specific to the utility function decryptToJson. In our case, the fields are decryptor and jsonParser.</p><p>The utility function, on the other hand, now requires more parameters — four instead of the original two, which makes the code cumbersome and less readable, especially in complex cases with more parameters.</p><p>In cases such as the one above, using the DI framework to inject an instance of the extracted class will simplify the code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a647c5a260f1c450de3b305d239539a/href">https://medium.com/media/7a647c5a260f1c450de3b305d239539a/href</a></iframe><p>Each dependency is now injected where it should be. The utility function no longer demands specific services as parameters. It only provides functionality for the consumers.</p><p>Notice how the code becomes more readable and less complex. It is important to note that testability and performance remain unharmed.</p><p><strong>Bottom line</strong>: We will use DI when the extracted function requires parameters that can be injected through DI. This is preferable to passing the dependencies as parameters to a static function.</p><h3>Conclusion</h3><p>In this article, we’ve reviewed most of the things we should be paying attention to when refactoring an existing utility function.</p><p>Naturally, there is no single answer for all cases. Some scenarios require further considerations, however, you may refer to this post as a guideline — a rule-of-thumb — in case you are unsure of the best solution for refactoring your utility function.</p><p>Whatever you do, don’t copy-paste your function!</p><h4>Further Reading</h4><ul><li><a href="https://softwareengineering.stackexchange.com/questions/360525/dependency-injection-vs-static-methods">Software Engineering — Dependency Injection vs Static Methods</a></li><li><a href="https://stackoverflow.com/questions/2758879/when-should-i-use-dependency-injection-and-when-utility-methods">Stack Overflow — When should I use Dependency Injection and when utility methods?</a></li><li>DI Frameworks for example: <a href="https://github.com/google/guice/wiki/Motivation">Google’s Guice</a>, <a href="http://www.springframework.net/doc-latest/reference/html/index.html">Spring.NET</a></li></ul><p>This post is part of <a href="https://medium.com/@innovid">Innovid’s technical blog</a>.</p><p>Innovid is the only independent omni-channel advertising and analytics platform built for television.</p><p><a href="https://grnh.se/d7999c042">Come work with us at Innovid!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e966d385bd27" width="1" height="1" alt=""><hr><p><a href="https://medium.com/innovid/3-considerations-for-your-next-utility-function-refactor-static-vs-dependency-injected-e966d385bd27">3 Considerations for Your Next Utility Function Refactor — Static vs Dependency Injected</a> was originally published in <a href="https://medium.com/innovid">Innovid</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Top 9 Hand-picked Talks from CSSConfBP and JSConfBP ’19 (+ Some Bonuses!)]]></title>
            <link>https://medium.com/innovid/my-top-9-hand-picked-talks-from-cssconfbp-jsconfbp-19-some-bonuses-702fdf33bbf7?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/702fdf33bbf7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Tue, 26 Nov 2019 15:29:58 GMT</pubDate>
            <atom:updated>2021-11-23T07:22:21.520Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Top 9 Hand-picked Talks from CSSConfBP and JSConfBP ’19 (+Some Bonuses!)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_e0SBFKicMh2tgb5" /></figure><p>This September (2019), I attended <a href="https://cssconfbp.rocks/">CSSConf</a> and <a href="https://2019.jsconfbp.com/">JSConf</a> in Budapest. Both conferences were single-tracked, with a total of 39 amazing talks. It was an incredible experience, and I learned many new things. Below, I’ve listed my top 9 favourite talks, in <em>chronological order</em> as they were presented in the conferences, together with explanations and recommendations.</p><p>Videos of the conferences in their entirety can be found here: <a href="https://www.youtube.com/watch?v=P21O_6OqpR0">CSSConf</a>, <a href="https://www.youtube.com/watch?v=F2YynQIFhYQ">JSConf day 1</a>, <a href="https://www.youtube.com/watch?v=7vwTrvkQF5k">JSConf day 2</a>.</p><p>So here goes!</p><h3>1. CSS Games and Drawings in the Real World: Useful or Just Fun?</h3><p>By <a href="https://twitter.com/giuliacardieri">Giulia Cardieri</a> | 📝 <a href="https://www.slideshare.net/GiuliadeAndradeCardi/css-games-and-drawings-in-the-real-world-useful-or-just-fun-cssconf-budapest-2019/1">Slides</a> | 📼 <a href="https://www.youtube.com/watch?v=6o6lgcdrDdU">Video</a></p><p>Giulia spoke about creating drawings and games using only CSS and HTML. She mentioned how even though people tend to dismiss those types of projects as useless, she learns so much by just playing around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TvwdUGtbhcEkOVtu" /><figcaption>A memory game built with HTML and CSS. No JavaScript involved!</figcaption></figure><p><strong>Why I liked it: </strong>It was really cool to see what you can do only with CSS + HTML. When I tell people about this talk, they do not believe that a memory game can be built without using JavaScript! It was inspiring to see how much you can learn from “useless” things. Giulia has totally altered my preconceptions of the power of CSS + HTML.</p><p><strong>Recommended for: </strong>Frontend developers looking for inspiration and perspectives on CSS and HTML.</p><h3>2. The Weird — Yet Practical — World of Paint Worklets</h3><p>By <a href="https://twitter.com/malchata">Jeremy Wagner</a> | 📝 <a href="https://speaking.jeremy.codes/JCDeR3/the-weird-yet-practical-world-of-paint-worklets">Slides</a> | 📼 <a href="https://www.youtube.com/watch?v=VccJldua8tc">Video</a></p><p>Jeremy talked about <a href="https://www.chromium.org/teams/animations/paint-worklet">Paint Worklets</a> (AKA <a href="https://drafts.css-houdini.org/css-paint-api/">CSS Paint API</a> — part of <a href="https://wiki.mozilla.org/CSS/Houdini">Houdini</a>), and the capabilities they contain.</p><p>The talk touched on a variety of subjects, including:</p><ul><li>Considerations for randomly generated background images</li><li>Customized paint worklets using JavaScript or custom CSS properties</li><li>Shape calculations using trigonometry</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zALAj-8IaqY1KUYl" /><figcaption><a href="https://paintlets.herokuapp.com/">parallelowow</a> — one of the randomly generated patterns that Jeremy showcased</figcaption></figure><p><strong>Why I liked it: </strong>Jeremy presented this cutting-edge technology with an engaging approach. The API lets you explore your creative side by customizing your websites in exciting new ways. The talk inspired me to play around with paint worklets.</p><p><strong>Recommended for: </strong>Frontend developers looking for inspiration, or learning the latest browser APIs.</p><h3>3. CSS Architecture for Modern Web Applications</h3><p>By <a href="https://twitter.com/MikeRiethmuller">Mike Riethmuller</a> | 📝❌ Slides not published yet :( | 📼 <a href="https://youtu.be/ZWPMzJfJHnc">Video</a></p><p>Mike showed various approaches for modelling components with multiple states, and explained his favorite approach. The talk also included important considerations for structuring an application’s component hierarchy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L6NKK1KFSZAA_J6M" /><figcaption>A part of Mike’s approach for modelling a component with multiple states</figcaption></figure><p><strong>Why I liked it: </strong>The talk was delightful on both the presentation level and technical level. Mike’s separation of component types (container, layout and UI) was insightful.</p><p><strong>Recommended for: </strong>Frontend developers seeking to optimize project structures using new coding paradigms.</p><h3>4. Building Better Products Faster: DevUx is the new DevOps</h3><p>By <a href="https://twitter.com/YuLingEC">Yu Ling Cheng</a> &amp; <a href="https://twitter.com/wang_france">France Wang</a>|📝❌ Slides not published yet :( | 📼 <a href="https://youtu.be/GeZxuhnRhSY">Video</a></p><p>Yu Ling &amp; France talked about <a href="https://devux.tech/">the DevUX culture</a>, which aims to improve the collaboration between developers and designers. They specified four levels of DevUX, and advised how to “level up”.</p><p>Although I couldn’t find the original slides, the <a href="https://devux.tech/toolbox">toolbox section on devux.tech</a> holds a lot of the talk’s content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QbrZ0JWQiMs4pvjd" /><figcaption>Yu Ling &amp; France’s four levels of DevUX functionality</figcaption></figure><p><strong>Why I liked it: </strong>France and Yu Ling Slack-inspired presentation was definitely a personal favorite for me! They presented the subject in an engaging way. I think anybody from the industry can relate to at least one of the problematic scenarios described. I’m excited to start implementing some of the useful tips from this talk.</p><p><strong>Recommended for: </strong>Frontend devs and designers MUST see this talk.</p><h3>5. Accessibility vs latest Web APIs. Can’t we just get along?</h3><p>By <a href="https://twitter.com/palmaswell">Mauricio Palma</a> | 📝❌ Slides not published yet :( | 📼 <a href="https://www.youtube.com/watch?v=OkovPZ1mVBI">Video</a></p><p>Mauricio gave examples of the importance of accessibility. He demonstrates how we unintentionally exclude people from using the web. He presented a live demo of a voice-activated application and used it to operate Spotify in different languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ek0dBrW1p-5j9LJ5" /><figcaption>Mauricio’s live demo of a multi-language, voice-activated web app</figcaption></figure><p><strong>Why I liked it: </strong>The talk was interesting and inspiring, and had a really cool live demo. Mauricio managed to point out the importance of UX with personal stories. He gave useful tips that can help developers to make UX an achievable goal.</p><p><strong>Recommended for: </strong>Any frontend developer will enjoy this talk. Some designers and PMs may find it interesting as well, if they can get past the technical parts.</p><h3>6. Javascript Performance in Extreme Conditions: Building WebApps for the Refugee Aid Movement</h3><p>By Taylor Fairbank | 📝❌ Slides not published yet :( | 📼 <a href="https://youtu.be/3VW2Q9kZ_MA">Video</a></p><p>Taylor works at the <a href="https://distributeaid.org/">Distribute Aid</a> movement, which aims to help refugees around Europe. He is the main developer of the application which is used by the movement’s volunteers. The application is aimed at use under extreme conditions, like old devices and lack of signal. In his talk, Taylor told us about the challenges he had while optimizing this app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CebbKtsOmG9bX0cG" /><figcaption>Taylor describes the extreme environment in which the application is used</figcaption></figure><p><strong>Why I liked it: </strong>Taylor’s fantastic talk reminded me about the power that we have as programmers. The applications he builds help many volunteers in the most functional way possible. It’s not just a matter of “conversion rate” or “customer satisfaction”. His work can actually save or dramatically improve people’s lives.</p><p><strong>Recommended for: </strong>Frontend developers will learn a lot from this talk. Backend developers may be interested in the minimization strategies for caching and communication that are explained in the talk. PMs can also glean insights on improving their products’ ability to target audiences with bad infrastructure (like 3rd world countries, remote places or travelers).</p><h3>7. Making things fast in world of build tools</h3><p>By <a href="https://twitter.com/DasSurma">Surma</a> &amp; <a href="https://twitter.com/jaffathecake">Jake Archibald</a> | 📝❌ Slides not published yet :( | 📼 <a href="https://youtu.be/fWc3Zu6A3Ws">Video</a></p><p>Surma and Jake talked about the optimization process they have made with <a href="https://proxx.app/">Proxx</a> — a minesweeper game developed by <a href="https://github.com/GoogleChromeLabs">Google Chrome Labs</a>. They wanted to make the game accessible to developing countries, or those with poor infrastructure. In their talk, they demonstrated how they used <a href="https://rollupjs.org/guide/en/#plugins">Rollup plugins</a> to achieve that goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wvimkBbOHrGK19kE" /><figcaption>A performance analysis, explained by Surma and Jake</figcaption></figure><p><strong>Why I liked it: </strong>First of all, this talk was <em>hilarious</em>. Surma and Jake managed to share a lot of content with a fun and easy approach. The way that each problem was introduced, analyzed and tackled was incredible. I loved the creative usage of Rollup plugins for solving real-world problems. Surma and Jake showed that many problems can be solved with a bit of creativity and humour.</p><p><strong>Recommended for: </strong>I would recommend this talk to frontend developers who are looking to improve client side performance, or really to any developer looking for a good laugh!</p><h3>8. Web Norms of the World: An exploration of the internet beyond the West</h3><p>By <a href="https://twitter.com/kkitay">Kat Kitay</a> | 📝 <a href="https://drive.google.com/file/d/19amE6-tCiwDuwjsqjSplyPlNlKO0-Rf8/view">Slides</a> | 📼 <a href="https://www.youtube.com/watch?v=OnOCq8GaG4Q">Video</a></p><p>In her talk, Kat explained how different cultures use the web differently. The concept which led this talk is “Well-localized software will win”. Kat illustrated the importance of localization, along with many examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4-rRh3TmyH0qRgYe" /><figcaption>Kat explains why most Korean web apps’ texts are actually images</figcaption></figure><p><strong>Why I liked it: </strong>Like most people, I am used to experiencing the web in a certain way. Designing an application to be accessible in different cultures is not a trivial task. As Kat put it in her talk, it is difficult (and essential) building applications in a localized form.</p><p>The practical test cases Kat gave were eye-opening. For example, people from certain countries are less likely to take unnecessary risks. Users from such countries will expect a step-by-step guide on websites they use. The talk made me think about how cultural differences affect the web. Kat really put the “world-wide” in world-wide-web.</p><p><strong>Recommended for: </strong>Anyone with potential users outside their country. PMs, devs and designers will enjoy this talk.</p><h3>9. StrangerDanger: Finding Security Vulnerabilities Before They Find You!</h3><p>By <a href="https://twitter.com/liran_tal">Liran Tal</a> | 📝❌ Slides not published yet :( | 📼 <a href="https://www.youtube.com/watch?v=3H8pF6yoSgU">Video</a></p><p>Liran explained the security risks that open-source introduces, and how to reduce them. In his talk, Liran showcased <a href="https://snyk.io/">Snyk</a> — an open-source security platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KXnk4LIhOmjJI-Os" /><figcaption>Liran strikes fear into my heart</figcaption></figure><p><strong>Why I liked it: </strong>Liran addressed problems that we all know, yet neglect. He talked about fundamental security issues that exist in the open-source world and how they will never be solved entirely. Additionally, Liran had a cool demo where he “hacked” a popular library on-stage.</p><p><strong>Recommended for: </strong>Any developer that uses open-source in any way.</p><h3>Summary: Why I loved CSSConf + JSConf</h3><p>If I had to pick one reason why I loved the two conferences, it would be the wonderful blend of technology and community. Almost every talk was extremely interesting and highly polished. I learned tons of new coding techniques and best practices that I can’t wait to put to use!</p><p>Another attractive aspect is the wide variety of the attendees’ fields of expertise. CSSConf had not only frontend developers, but many designers as well. JSConf had a nice mix of frontend and backend devs. It was interesting to hear about the same subjects from different perspectives.</p><p>The after-party activities organized by the conference — karaoke, digital party games and VR games — were a really nice touch as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DyWqTVV-v7X0pJq8" /><figcaption>JSConf after-party. Free beer is always a great way to meet new people from the industry.</figcaption></figure><p>I met and made friends with amazing people from around the world.</p><p>All in all, the conferences truly exceeded my expectations. I hope to attend the next <a href="http://2020.jsconfbp.com/">JSConfBP in 2020</a>.</p><h3>Bonus</h3><ul><li>An artist named <a href="https://malweene.com/">Malwine</a> drew each talk. The results are <a href="https://twitter.com/search?q=(from%3A%40Malweene)%20(%23jsconfbp%20OR%20%23cssconfbp)%20(%23sketchnotes)&amp;src=typed_query">awesome</a>!</li><li>Twilio built a fun <a href="http://twil.io/tq3-de">retro RPG game</a> which involves JS programming.</li><li><a href="https://twitter.com/bebraw">Juho Vepsäläinen</a> shared <a href="https://www.icloud.com/sharedalbum/#B0pGrq0zwG3F0Sy">his photos from CSSConf + JSConf</a>.</li></ul><p>This post is part of <a href="https://medium.com/@innovid">Innovid’s technical blog</a>.</p><p>Innovid is the only independent omni-channel advertising and analytics platform built for television.</p><p><a href="https://grnh.se/d7999c042">Come work with us at Innovid!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=702fdf33bbf7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/innovid/my-top-9-hand-picked-talks-from-cssconfbp-jsconfbp-19-some-bonuses-702fdf33bbf7">My Top 9 Hand-picked Talks from CSSConfBP and JSConfBP ’19 (+ Some Bonuses!)</a> was originally published in <a href="https://medium.com/innovid">Innovid</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Link Previews — More than Meets the Eye]]></title>
            <link>https://medium.com/better-programming/link-previews-more-than-meets-the-eye-aa13c77c6d69?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa13c77c6d69</guid>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Mon, 09 Sep 2019 21:07:10 GMT</pubDate>
            <atom:updated>2021-02-16T06:17:45.040Z</atom:updated>
            <content:encoded><![CDATA[<h3>Link Previews — More than Meets the Eye</h3><h4>Ever wondered how is this preview generated?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f6Vz4GodmmZIUtP6" /><figcaption>Photo by <a href="https://unsplash.com/@pawelskor?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Paul Skorupskas</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>High chances are you got to this post through some link sharing.</p><p>High chances are the link had some preview: the post header, a short summary, and an image as well.</p><p>Even higher chances that it’s not the first time you have seen such preview.</p><p>Ever wondered what generates these previews, or how can you start using them? I hope I’ll answer some of your questions in the post.</p><h3>Link Previews? What’s That?</h3><p>For those of you who are still wondering what previews I’m referring to, here are some examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_nEiMYvfSGN2FtcA" /><figcaption>Link preview generated by <a href="https://www.whatsapp.com/">WhatsApp</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dlCTg8qeF_1XHoTW" /><figcaption>Link preview generated by <a href="https://slack.com/">Slack</a></figcaption></figure><p>These previews help us every day by giving us a glimpse of the relevant website.</p><p>Usually, the preview contains a header, a description, a preview image, an icon, and an optional app name.</p><p>How do WhatsApp and Slack know which part of the content is the description? If there are many images on the page, which is the primary one?<br>Where is this data stored for each page?</p><h3>Meta Tags</h3><p>Meta tags describe the content of the page. They go inside the &lt;head&gt; element.</p><p>Meta tags can define a wide range of attributes. These are some:</p><ul><li>Declaring the application name and icon</li><li>Specifying the description</li><li>Configuring the viewport</li><li>Setting a document refresh each 10 seconds</li><li>Declaring the charset</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UxP_ck2o9_m-AZRF" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Brett Jordan</a> on <a href="https://unsplash.com/search/photos/tag?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>A web service could use meta tags to generate a link preview, by getting the <br>link’s HTML, right?</p><p>Surprisingly, using pure HTML meta tags only support basic features. For example, meta tags alone cannot specify a preview image.</p><p>So where do they come from?</p><h3>The Open Graph Protocol</h3><p><a href="https://ogp.me/">The Open Graph protocol </a>is used to describe a website with rich objects, like images, audio files, and more. To do that, OGP (shorthand for Open Graph protocol) uses &lt;meta&gt; tags. OGP was built by Facebook specifically for social networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*sIsjIgPSPxyLrEvG" /></figure><p>Using OGP is very simple.</p><p>See the following example from the official site. It describes the movie “The Rock” on IMDB’s website:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K6uFAQWWzyC_Mlkj" /></figure><p>Even without reading the protocol’s documentation, most developers can understand the markup.</p><p>By looking at the &lt;meta&gt; tags, we can see that the website’s title is The Rock, which refers to a movie. We also have an image link and a URL, which leads to the same website.</p><p>It’s no coincidence that OGP is so simple — it was one of the designers’ goals from <a href="https://www.scribd.com/doc/30715288/The-Open-Graph-Protocol-Design-Decisions">the very beginning</a>:</p><p>Developer simplicity is a key goal of the Open Graph protocol, which has informed many of the technical design decisions.</p><p>There are many advanced features for Open Graph protocol. You can find more about them in <a href="http://ogp.me/">the official documentation</a>.</p><h3>Should I Use the Open Graph Protocol? Why?</h3><p>Although OGP was designed specifically for Facebook, many <a href="https://stackoverflow.com/questions/10397510/do-services-other-than-facebook-use-open-graph">other web services support it</a>. <a href="https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api#controlling-how-share-content-is-displayed">Linkedin</a>, <a href="https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started#opengraph">Twitter</a>, and <a href="https://developers.pinterest.com/docs/rich-pins/overview/?">Pinterest</a> are only some of the social networks that support OGP.</p><p>Additionally, many messaging tools embed link previews to messages. It is also important to mention that OGP can <a href="https://www.yakaferci.io/open-graph/">affect your SEO</a>.</p><p>Generally speaking, any public web app owner should care about link previews. It makes the web app more accessible by giving the user a hint about the content. <br>OGP is easy to use and has many benefits. If you can, use it.</p><p>The main exception is content that requires any kind of authentication.</p><p>Link preview generators usually perform anonymous requests to get the link’s data. If the page requires authentication, the generated link will be broken. <br>We all shared at least one link previewed as a “please log in” page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*k-z6xkxpVzhUXfwm" /><figcaption>Link preview for a private page on Medium, as seen on Whatsapp</figcaption></figure><p>If you want to start using OGP but aren’t sure how, I recommend reading <a href="https://www.quicksprout.com/open-graph-tags/">this excellent short article</a>.</p><h3>Other Solutions</h3><p>There are ways other than OGP for generating link previews. <a href="https://oembed.com/">oEmbed</a> is one of the most popular ones. It gives the user a JSON describing a resource, instead of having to parse the resource’s meta tags.</p><p>An oEmbed JSON is very simple and contains info like image, title, and other useful data.</p><p>The catch here is that each supported website must have a provider on oEmbed, which requires <a href="https://oembed.com/#section2">a bit of work</a>.</p><p>This means that while oEmbed could be simpler to use, the initial setup is much more complicated compared to OGP.</p><p>In case you were wondering, if you got to this post by clicking a link preview, it was not through oEmbed.</p><p>Medium is not listed as an <a href="https://oembed.com/providers.json">oEmbed provider</a>, and it still has great support for link previews.</p><h3>Conclusion</h3><p>Instant messaging, search engines, and social networks are part of our lives.<br>We use link previews every day without noticing. These are powerful tools that greatly affect a website’s social traffic.</p><p>I had no clue that this subject was so deep when I started reading about it. This post only covers a small part of things you can learn. Curious readers can find a Further Reading section below.</p><p>I hope that if you were wondering like me about link previews, you now have fewer mysteries in life to unfold.</p><h3>Further Reading</h3><ul><li>A Developer’s Guide to the Open Graph Protocol — <a href="https://thetrevorharmon.com/blog/a-developers-guide-to-the-open-graph-protocol">https://thetrevorharmon.com/blog/a-developers-guide-to-the-open-graph-protocol</a></li><li>Open Graph Checker — <a href="https://opengraphcheck.com/">https://opengraphcheck.com/</a></li><li>Open Graph Protocol Explained with Examples — <a href="https://www.optimizesmart.com/how-to-use-open-graph-protocol/">https://www.optimizesmart.com/how-to-use-open-graph-protocol/</a></li><li>How Slack Generates Link Previews — <a href="https://medium.com/slack-developer-blog/everything-you-ever-wanted-to-know-about-unfurling-but-were-afraid-to-ask-or-how-to-make-your-e64b4bb9254">https://medium.com/slack-developer-blog/everything-you-ever-wanted-to-know-about-unfurling-but-were-afraid-to-ask-or-how-to-make-your-e64b4bb9254</a></li></ul><p>🕵️‍♂️ <em>Psst… </em>If you enjoyed this<em>, </em>follow me on Twitter (<a href="https://twitter.com/omril321">@omril321</a>) — I tweet regularly about cool things I learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa13c77c6d69" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/link-previews-more-than-meets-the-eye-aa13c77c6d69">Link Previews — More than Meets the Eye</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cleaner TypeScript With the Non-Null Assertion Operator]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/cleaner-typescript-with-the-non-null-assertion-operator-300789388376?source=rss-30a95298ea67------2"><img src="https://cdn-images-1.medium.com/max/1200/1*tPnsbYsfRrcPaDtsMX3ARQ.jpeg" width="1200"></a></p><p class="medium-feed-snippet">Reduce your cognitive load and make your code less verbose</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/cleaner-typescript-with-the-non-null-assertion-operator-300789388376?source=rss-30a95298ea67------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/cleaner-typescript-with-the-non-null-assertion-operator-300789388376?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/300789388376</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 06:18:40 GMT</pubDate>
            <atom:updated>2021-02-16T06:16:52.156Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[7 Things You Should Know Before Starting with Side Projects]]></title>
            <link>https://omril321.medium.com/7-things-you-should-know-before-starting-with-side-projects-42dc1ddc1c37?source=rss-30a95298ea67------2</link>
            <guid isPermaLink="false">https://medium.com/p/42dc1ddc1c37</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Omri Lavi]]></dc:creator>
            <pubDate>Sun, 24 Feb 2019 06:16:53 GMT</pubDate>
            <atom:updated>2021-02-16T06:18:30.121Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I discontinued my work on a <a href="https://github.com/omril321/mind_mapper_react">side project</a> I’ve started 18 months ago.<br>Doesn’t sound like a big success story, right? I thought so too.</p><p>But looking back, I realize that I learned a lot of things, techniques and tools that will help me next time I’ll start a side project. In this post, I&#39;ve gathered some of the methods and conclusions from the past year and a half.</p><p>If you want to start working on a side project, or willing to become more efficient — this post can help you.</p><p>If you’re the TL;DR type, you can find a summarized list at the end of the post.</p><h4>1. Finding a Subject</h4><p>I hear a lot of people saying they want to start working on a side project, but don’t have “good-enough idea”.<br>Instead of struggling with finding the perfect subject, <a href="https://github.com/joereynolds/what-to-code">try</a> <a href="http://andrewcombs13.com/projectIdeas/">googling</a> <a href="https://medium.com/@JohanneA/5-project-ideas-for-programmers-who-dont-know-what-to-work-on-next-51fdb191cbde">for</a> <a href="https://www.codementor.io/npostolovski/40-side-project-ideas-for-software-engineers-g8xckyxef">ideas</a>. Your project doesn’t HAVE to be original. It just has to… be.</p><p>It is possible that you, like me, are afraid of starting a long project without being certain you will finish it. Countless of doubtful questions come up with each mildly interesting idea:<br>What if I won’t like the subject?<br>What if with time, a marvelous idea will come, and I will want to switch projects?<br>What if…? what if…?</p><p>The answer is simple.</p><p>You don’t have to wait for a good idea. You don’t even have to wait for an average idea. Just start working on your best current idea.</p><blockquote>“Better to do something imperfectly than to do nothing perfectly.”</blockquote><blockquote>— Robert H. Schuller</blockquote><p>If you’re sitting with me in the Perfectionist-Anonymous circle, and afraid of committing to the wrong project, I recommend reading the “Have Milestone” section below to fade some of your concerns.</p><h4>2. Focus the right things</h4><p>Starting a side project gives an amazing feeling. Unlike the work we get paid for, on side projects we can do all the things we’ve dreamed about. The sky’s the limit.<br>This makes focusing on the wrong things a very easy mistake to make.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uC8hsBkGMnZrqy68" /><figcaption>Having wings and flying are two different things. Working hard on a side project won’t necessarily get you to your goal.</figcaption></figure><p>When I started the project, I was determined to write high-quality code. I quickly added code coverage, linting and cool webpack plugins.<br>I thought I’m keeping my code in high quality. In reality, this decision made me waste time on irrelevant subjects. Keeping the code coverage high, meddling with linting issues, making some webpack plugins work… these dwarf next to having a working project.</p><p>Some may argue that code quality is important, no matter what.<br>I agree, but moving to your goal is even more important. For example, if you write a minimal POC, code coverage is less important. Obviously, you can still write tests — but you don’t HAVE to.</p><p>The point is remembering what’s important and what’s not. Be aware for when you are wasting time on things that do not contribute to the project’s goal.</p><p>Here are a few tips that can help you staying focused:</p><ul><li>Make a short list of goals for the project. For example: “making a library that does X”, or “learning how to work with framework Y”, or “improving my testing skills”.</li><li>Avoid spending more than roughly 30 minutes on something that does not contribute to a goal.</li><li>Have two backlog lists. The first is for features you would like to add to the project. The second is a “technical debt” list, like missing tests, poor-quality code, and so on. This will reduce the fear of forgetting a good idea.</li><li>When you finish for the day, write a note to yourself that says what should you start with in the following session. This will save you precious time remembering what you wanted to do.</li></ul><h4>3. Beware of premature optimization</h4><p>Thinking about more things I’ve done wrong, I understand I was too quick with optimization. “Premature optimization is the source of all evil!”, I know.</p><p>In the beginning, my project had a complex algorithm that took ~23 mins to run each time. I felt like I HAD to optimize — It was impossible using the application. It was worthwhile spending 2 weeks of optimization just to go down from 23 mins to 2 mins, right?</p><p>Wrong.</p><p>The result of the premature optimization was a highly-optimized and highly-complicated algorithm. It made future development much harder.<br>Having a working, slow application, is much better than having no application at all. Especially in the context of side projects.</p><p>If a certain code block is slowing you down, and you don’t want to optimize it yet, find a way to work around it. For example, use fake data combined with Storybook, or use a fake implementation.</p><p>Optimizing after having a working project, is better than optimizing too early. Improving an application after building it gives you a holistic view. This way, you make each decision while completely understanding all side-effects. Premature optimization has side effects you don’t know yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6ht9ccoPSRX8SudN" /><figcaption>Optimizing too early can leave you with a beautiful code in an abandoned project. (photo by <a href="https://unsplash.com/@jerrykavan">Jaromír Kavan</a>)</figcaption></figure><h4>4. Find your source of ambition</h4><p>Committing for a side project is difficult. Considering the stressful modern-life routine, self-motivation is the hardest thing about side projects.<br>Habits are super important here, but losing momentum is inevitable. Be aware of that.<br>This is why having “ambition boosters” are important.</p><p>For me, talking with friends about my side projects gives me the boost I need. When someone responds with “wow, that sounds really cool, I’d use that” — I wanna stop whatever I do now, and continue working on my side project. Like, right now.</p><p>Find your fuel. It can be talking with your spouse or friends about the project, or reading about inspiring people, or maybe meditating. Public commitment has a psychological effect that can be leveraged as well. Hell, hang a <a href="https://www.amazon.com/Chuck-Norris-18X24-Poster-BHG547011/dp/B01K5ZU6TO">Chuck Norris poster</a> above your bed if you need to. Do whatever fits you.</p><p>The important thing is keeping up the good work. Even in difficult times when you think of quitting, remind yourself why you do this.</p><blockquote>“Who you are tomorrow begins with what you do today.”</blockquote><blockquote>— Tim Fargo</blockquote><h4>5. Avoid Burnout with a Daily Routine</h4><p>It sounds like an oxymoron, right? Let me tell you a short story.</p><blockquote>“You’ll work on the side project 4 hours a week, no excuses!”</blockquote><blockquote>— Me, 18 months ago</blockquote><p>4 hours a week sounds legit. The challenge is spanning them correctly.<br>At first, I had 2–3 sessions of work each week, 1.5–2 hours each time. It was great — I felt energized.</p><p>Then I had to skip one week’s work. I felt so bad about it, that I worked at that weekend for 5 hours straight.<br>Afterwards I felt burnt-out, and frustrated for the situation. A vicious circle has started. I avoided the side project on work-days, on the expense of coding marathons on weekends.</p><p>I quickly grew tired.<br>I realized something has to change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NMF1d7yJV8C1LldR" /><figcaption>(Photo by <a href="https://www.pexels.com/@victorfreitas">Victor Freitas</a>)</figcaption></figure><h4>Wait, you were talking about AVOIDING burnout…?</h4><p>I’m getting to it.</p><p>After googling for ideas, I was lucky enough to stumble upon Ulisses Almeida’s great article about <a href="http://blog.plataformatec.com.br/2018/07/long-projects-in-your-free-time/">Long projects in your free time</a>.<br>In the article, Almeida inspects some important aspects of long projects. One of the things that affected me the most was the following paragraph:</p><blockquote>(…) When you miss a week, it’s easier to lose motivation because it’s harder to recover from that. If you work a little bit on your project every day, it helps you to keep progressing. One day that you miss, won’t be a huge impact on your routine.</blockquote><p>This article has changed my perspective completely about how I should work on side projects.</p><p>I’ve changed my commitment. By committing to a daily routine of 30 mins per day, skipping a single work session wasn’t too bad. I knew that the next day I’ll be working on the project.<br>Switching to a daily routine has been great for me, and I full-heartedly recommend it. A “daily routine” might sound startling at first, but it is achievable, and it will quickly pay-off.</p><p>By the way, if you’re looking for a way to track and build your daily routines, try <a href="https://play.google.com/store/apps/details?id=org.isoron.uhabits">Loop — Habit Tracker</a>. It is an awesome app that helps you developing good habits.</p><h4>6. Have milestones</h4><p>After 9 months working on the side project, I’ve started working on a <a href="https://github.com/omril321/angularjs-directive-renderer">testing library</a>.<br>I was in the middle of working on the original side project. Uncommitted changes, TODOs scattered all over the place… a bit of a mess.<br>Although I am usually a tidy person, I left the project this way since I didn’t want to “waste time”. I thought I’ll get back to it in two weeks or so.<br>In the end, I’ve spent about 4 months working on the testing library.</p><p>Afterwards, I found it difficult coming back to the original side project.<br>It felt like visiting a very old friend. Things got awkward, I forgot some details. I wasn’t sure how to “break the ice” and progressing to a positive direction. It took a while getting over it.</p><p>If I had left the project in a proper manner, without “half-baked” features, coming back to it would have been much simpler.</p><p>For that reason, I suggest setting small milestones for your longer projects. These can be used both as goals and “exit points”.<br>When reaching these milestones you have two choices.<br>If you enjoy the project, you can continue expanding it and adding more features.<br>But in the inevitable case where you stop enjoying the project, it’s best leaving it in a good condition, and not in the middle of the work. That’s where having milestones are really handy.</p><p>Having smaller milestones lets you having “exit points” from the project, while still being able to have some working product in your hands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qjwk82uT1dDMhnU-" /><figcaption>Mountaineers having bases at predetermined locations before continuing the climb.</figcaption></figure><h4>7. Retrospect, and retrospect often</h4><p>I’m sure that I’ve raised a few eyebrows right now. Side projects should be fun — why ruining it with a tedious task as a retrospective?</p><p>Because time is your most valuable resource.</p><p>When working on longer projects, working efficiently is crucial. Stopping every once in a while to think about your work, can raise awareness of your progress.</p><p>Start with a frequent retrospective to increase efficiency on an early stage. When you feel you have found your way, reduce the frequency.<br>Make it short and summarized. The goal finding way to improve your work. Ask things like:</p><ul><li>Did I meet my goals for spending the time on the project? If not, how can I improve it? For example, work on the side project when commuting (if possible), leave work 30 minutes earlier on certain days, or waste less time on social media.</li><li>Am I working efficiently? For example, am I wasting time on testing POC code? Am I investing too much time on linting or code coverage? Think of your work in the last period — how can it be improved?</li><li>Am I meeting my goals? Do you feel like you are on the right track? Or are you working on “auto-pilot”, without knowing your destination?</li></ul><h4>Conclusion</h4><p>I have made many mistakes while working on side projects. Also, I didn’t understand the importance of working efficiently. I wish I knew 18 months ago the things I mentioned here. I hope this post will help someone with her or his side project.</p><p>Do you have good tips for side projects? Please let me know by commenting below! <br>Did you find anything interesting in this post? Claps will be much appreciated.</p><h4>TL;DR — Tips for side projects</h4><ul><li>Any project is better than no project. Find a subject and commit to it.</li><li>Commit to a daily routine.</li><li>Find what drives you. Use it as a source of ambition.</li><li>Write milestones as goals and “exit points”.</li><li>Focus the right things. Do not spend time on longer tasks if they aren’t necessary.</li><li>Premature optimization is a greater pitfalls than “real-life” projects.</li><li>Retrospect. Start with a frequent retrospective.</li></ul><p>🕵️‍♂️ <em>Psst… </em>If you enjoyed this<em>, </em>follow me on Twitter (<a href="https://twitter.com/omril321">@omril321</a>) — I tweet regularly about cool things I learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42dc1ddc1c37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>