<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Thomas Scharke</title>
    <description>The latest articles on DEV Community by Thomas Scharke (@tscharke).</description>
    <link>https://dev.to/tscharke</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F243331%2F0732829d-6d57-4a88-b29e-0bf38c90528e.png</url>
      <title>DEV Community: Thomas Scharke</title>
      <link>https://dev.to/tscharke</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tscharke"/>
    <language>en</language>
    <item>
      <title>JetBrains' AI Assistant</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Thu, 30 Nov 2023 16:17:55 +0000</pubDate>
      <link>https://dev.to/tscharke/jetbrains-ai-assistant-2cdb</link>
      <guid>https://dev.to/tscharke/jetbrains-ai-assistant-2cdb</guid>
      <description>&lt;p&gt;Since a few days, I have had the pleasure of working (and playing 😉) with &lt;a href="https://www.jetbrains.com" rel="noopener noreferrer"&gt;JetBrains'&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI Assistant&lt;/strong&gt; 💫&lt;/p&gt;

&lt;p&gt;And I'd like to share my initial impressions and experiences with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Participation
&lt;/h2&gt;

&lt;p&gt;Firstly, JetBrains' AI Assistant is currently in the &lt;strong&gt;Beta&lt;/strong&gt; phase. To use the AI Assistant, you need a JetBrains account and must sign up for the waiting list.&lt;/p&gt;

&lt;p&gt;I was fortunate 🍀 and got approved, so now I can participate in the &lt;strong&gt;Beta Phase&lt;/strong&gt; of the &lt;strong&gt;AI Assistant&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To understand the registration process, how the AI Assistant looks within an IntelliJ product, its functionalities, and how it's applied within the product, you can read JetBrains' detailed and excellent &lt;a href="https://www.jetbrains.com/help/idea/ai-assistant.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;I mainly use the AI Assistant in my editor and thus &lt;strong&gt;directly on the code&lt;/strong&gt;. This works through the so-called &lt;em&gt;Context Actions&lt;/em&gt;. That means, with a keyboard shortcut at the corresponding code location, I can use these &lt;em&gt;Context&lt;br&gt;
Actions&lt;/em&gt;. These include the (new) point &lt;strong&gt;AI Actions&lt;/strong&gt; with the following sub-points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Write documentation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Explain Code&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Suggest refactoring&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Find problems in code&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;New chat using selection&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd like to delve into the two &lt;em&gt;AI Actions&lt;/em&gt;: &lt;code&gt;Write documentation&lt;/code&gt; and &lt;code&gt;Find problems in code&lt;/code&gt; and share &lt;strong&gt;my impressions with you&lt;/strong&gt; as I've extensively used these features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Note
&lt;/h3&gt;

&lt;p&gt;There is also the option to access &lt;em&gt;Context Actions&lt;/em&gt; through a light bulb 💡 using a trackpad/mouse. However, while programming, I prefer not to switch my input method. Therefore, I exclusively use keyboard shortcuts 😉.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI Actions
&lt;/h2&gt;

&lt;p&gt;Within &lt;em&gt;Context Actions&lt;/em&gt;, I can select &lt;strong&gt;AI Actions&lt;/strong&gt; and choose the Sub-AI Action &lt;code&gt;Write documentation&lt;/code&gt;, which I'll now discuss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write documentation
&lt;/h2&gt;

&lt;p&gt;Let's start with a spoiler, and I'll keep it short - &lt;strong&gt;I'm excited!&lt;/strong&gt; 🥳&lt;/p&gt;

&lt;p&gt;Please note that I'm in the context of my code, and the AI Assistant unfolds its strength here. If I use this &lt;em&gt;AI Action&lt;/em&gt; on variables, functions and &lt;a href="https://react.dev/learn/your-first-component" rel="noopener noreferrer"&gt;Functional-Components&lt;/a&gt; (&lt;a href="https://react.dev" rel="noopener noreferrer"&gt;React&lt;/a&gt;), the AI Assistant generates a comment or a complete and valid &lt;a href="https://jsdoc.app" rel="noopener noreferrer"&gt;JSDoc&lt;/a&gt; "inline" - that is, above or at the variable, function, or Functional-Component. This includes descriptions of arguments/parameters, return values, and correct typing.&lt;/p&gt;

&lt;p&gt;It's fascinating and saves me a lot of typing. 😎&lt;/p&gt;

&lt;p&gt;I won't hide that it's helpful if variables, functions, etc., already have good and descriptive names. Also, using &lt;a href="https://www.typescriptlang.org" rel="noopener noreferrer"&gt;TypeScript&lt;/a&gt; helps for more concrete typing.&lt;/p&gt;

&lt;h3&gt;
  
  
  What do I appreciate about it?
&lt;/h3&gt;

&lt;p&gt;That with this &lt;em&gt;AI Action&lt;/em&gt;, the AI Assistant truly lives up to its name by enriching the code with comments and complete JSDoc. The initial results are already fitting. The AI Assistant remains prosaic, technical and almost beautifully concise about what it is/what it does. I can always adjust and change comments and JSDocs myself. Occasionally, I've done that to loosen up the sobriety a bit 😉—but that's my personal style.&lt;/p&gt;

&lt;h4&gt;
  
  
  Caveat
&lt;/h4&gt;

&lt;p&gt;When "generating" documentation for Functional-Components, I've experienced a few times that I triggered the &lt;em&gt;AI Action&lt;/em&gt;, but nothing happened 🤷‍ I'll attribute that to the Beta phase. 😃&lt;/p&gt;

&lt;p&gt;It also happened that I had a different expectation 🤔. For example, I built a Functional-Component that only returns JSX and contains a kind of instruction in text form within &lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt;'s. Then I used this &lt;em&gt;AI Action&lt;/em&gt; and hoped that the AI Assistant would provide me with fancy documentation. I had no idea how and what to write myself, but "Hey - that's what I have the AI Assistant for." 🤣 And what was the result? Of course, a valid JSDoc—no question. But the AI Assistant took the name of the Functional-Component only and summarised (once again) what I had written within the &lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt;'s 😮.&lt;/p&gt;

&lt;p&gt;Mhhh… that wasn't what I expected. 😢&lt;/p&gt;

&lt;h5&gt;
  
  
  Conclusion
&lt;/h5&gt;

&lt;p&gt;Yet I'm excited. Because I had no idea why and how I wanted to enrich the Functional-Component with documentation. And I also had no idea how I would describe it myself. I was probably waiting a bit for a &lt;em&gt;miracle&lt;/em&gt; 💫? 🤔🤣&lt;/p&gt;

&lt;p&gt;But the AI Assistant neutrally described and summarised what it finds—no more and no less.&lt;/p&gt;

&lt;p&gt;Honestly, I couldn't have done it better myself. 🤣&lt;/p&gt;

&lt;p&gt;And let me be honest: If I want to enrich something "nonsensical" with documentation, then it remains &lt;strong&gt;nonsensical&lt;/strong&gt;. Regardless of whether I do it as a human or use the AI Assistant 🤣&lt;/p&gt;

&lt;p&gt;Another &lt;em&gt;AI Action&lt;/em&gt; that I use very frequently and is also within &lt;em&gt;Context Actions&lt;/em&gt; is: &lt;code&gt;Find problems in code&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find problems in code
&lt;/h3&gt;

&lt;p&gt;As the name suggests, the goal here is to find &lt;strong&gt;potential problems in the code&lt;/strong&gt; by the AI Assistant or to let the AI Assistant &lt;strong&gt;detect them&lt;/strong&gt;. And I think the latter describes it best. Because the AI Assistant actually acts like a peer, examining the code and sharing its "findings" with you.&lt;/p&gt;

&lt;p&gt;Unlike the &lt;em&gt;AI Action&lt;/em&gt; &lt;code&gt;Write documentation&lt;/code&gt;, the analysis and "exchange" don't take place in the editor and thus on/in the code. Nor is any code changed or added. Instead, this &lt;em&gt;AI Action&lt;/em&gt; switches to another IDE window, which is open in addition to the code editor.&lt;/p&gt;

&lt;p&gt;It's important to note that this &lt;em&gt;AI Action&lt;/em&gt; takes the complete code (from which the &lt;em&gt;AI Action&lt;/em&gt; was triggered) copy-and-paste and simultaneously instructs the AI Assistant to look for potential problems in the code.&lt;/p&gt;

&lt;p&gt;In other words: I could do this manually by starting a new conversation with the AI Assistant, manually copying and pasting the code, and simultaneously asking it to &lt;code&gt;find potential problems in the code&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I find it successful that syntax highlighting is retained, and the AI Assistant also recognises the corresponding language and displays it to me.&lt;/p&gt;

&lt;p&gt;And then it starts… 🎉&lt;/p&gt;

&lt;h4&gt;
  
  
  Here we go…
&lt;/h4&gt;

&lt;p&gt;The code is analysed by the AI Assistant, and it immediately shares its "findings." It analyzes the code from top to bottom, describing the &lt;strong&gt;possible problems&lt;/strong&gt; line by line (if any are found).&lt;/p&gt;

&lt;p&gt;It describes, in text form, the identified reasons for the potential problem and also presents a solution as a code snippet.&lt;/p&gt;

&lt;p&gt;Here, too, the AI Assistant remains prosaic, technical, and above all &lt;strong&gt;transparent&lt;/strong&gt;. Through its description, I can understand its "thought processes" (can you call it that in an AI? 🤔). I always feel left in the clear and interpret its description as suggestions or ideas.&lt;/p&gt;

&lt;p&gt;At no point did it feel like the AI Assistant was imposing anything on me or even wanting to be "right" 👍.&lt;/p&gt;

&lt;h4&gt;
  
  
  Exchange with the AI Assistant
&lt;/h4&gt;

&lt;p&gt;Once its analysis is complete, the AI Assistant waits for me with a so-called &lt;em&gt;User Prompt&lt;/em&gt;. In this, I can now engage in the "exchange" 😎&lt;/p&gt;

&lt;p&gt;Since the potential problems are numbered, I can easily refer to the mentioned problems within the &lt;em&gt;User Prompt&lt;/em&gt; without adding or duplicating long texts or code.&lt;/p&gt;

&lt;p&gt;I shaped my "exchange" with the AI Assistant as if I were sitting across from a human peer. That is, I asked questions and had detailed explanations of analyses.&lt;/p&gt;

&lt;h4&gt;
  
  
  Transparency
&lt;/h4&gt;

&lt;p&gt;It became clear to me that the AI Assistant really only "sees" the code I entered into the &lt;em&gt;AI Action&lt;/em&gt;. Or rather, it only "sees" the code with which the conversation was started. That is, the AI Assistant does not use an &lt;a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree" rel="noopener noreferrer"&gt;AST&lt;/a&gt; and cannot analyse functions from other modules or other referenced modules (in the code).&lt;/p&gt;

&lt;p&gt;If the AI Assistant comes across, for example, a function call that is not present in the code, its analysis and statement about it remain transparent. It mentions this and points out that no analysis of this function can be made because it has no insight. 😎&lt;/p&gt;

&lt;p&gt;I'm torn here: In some situations, it would be nice if the AI Assistant could look "deeper" and thus analyse all referenced modules as well. And yet, I'm excited that this doesn't happen! 👏&lt;/p&gt;

&lt;p&gt;Because that's exactly what makes it feel so transparent to me; &lt;strong&gt;the AI Assistant analyses what I show - nothing more.&lt;br&gt;
😎&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  And now?
&lt;/h4&gt;

&lt;p&gt;The "exchange" with the AI Assistant takes place exclusively through the &lt;em&gt;User Prompt&lt;/em&gt; and thus in text form. I can enter free text and also write or copy-and-paste &lt;code&gt;Code&lt;/code&gt;. Similar to &lt;em&gt;User Prompts&lt;/em&gt; of other AIs, I can embed the code in backticks (&lt;code&gt;`&lt;/code&gt;). The &lt;em&gt;User Prompt&lt;/em&gt; of the AI Assistant even recognises when I write or copy-and-paste code, embeds it automatically, and formats it at the same time.&lt;/p&gt;

&lt;p&gt;As a user, I also have the two "quick functions" available for the code snippets from the analysis…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Copy to Clipboard&lt;/code&gt; and&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Insert Snippet at Caret&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I've already expressed my personal conclusion, and I stick to it&lt;/p&gt;

&lt;p&gt;🥳🥳🥳 &lt;strong&gt;I AM EXCITED&lt;/strong&gt; 🥳🥳🥳&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;AI Assistant&lt;/strong&gt; integrates wonderfully into the IDE. I have the freedom to choose whether I want to use it or not at any time. And when using it, JetBrains remains true to itself by embedding it in the &lt;em&gt;Context Actions&lt;/em&gt;, making the use seamless, setting the context, and allowing me to act via the familiar keyboard shortcuts.&lt;/p&gt;

&lt;p&gt;I currently enjoy engaging in the "exchange" with the AI Assistant. I'm happy to update my article from time to time to share my experiences with you.&lt;/p&gt;

&lt;p&gt;I'm also interested, in your opinion…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have you already used the JetBrains &lt;strong&gt;AI Assistant&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;What are your experiences with it?&lt;/li&gt;
&lt;li&gt;Do you have comparisons with other AI systems?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wishes for JetBrains
&lt;/h2&gt;

&lt;p&gt;Despite all my enthusiasm, there are wishes I would like to convey to JetBrains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It would be nice to be able to &lt;strong&gt;interrupt or "stop" the responses&lt;/strong&gt; of the AI Assistant. Because it often happens that &lt;code&gt;send&lt;/code&gt; is pressed too quickly in the &lt;em&gt;User Prompt&lt;/em&gt;, even though information or code is not yet fully entered 🤷‍

&lt;ul&gt;
&lt;li&gt;It also happens that I would like to interrupt the AI Assistant if, after its initial runs, it becomes clear to me that I'm going in the "wrong" direction or that what I've written has already inspired me - so I don't need any further "output" from the AI Assistant.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;For the code snippets, I wish for an additional functionality that precisely takes the snippet to my &lt;strong&gt;real code location&lt;/strong&gt; where the AI Assistant found the potential problem. So an &lt;code&gt;Integrate Snippet&lt;/code&gt;.&lt;/li&gt;

&lt;/ul&gt;

&lt;h1&gt;
  
  
  Credits
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Photo by &lt;a href="https://unsplash.com/de/@swimstaralex" rel="noopener noreferrer"&gt;Alexander Sinn&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>typescript</category>
      <category>jetbrains</category>
    </item>
    <item>
      <title>Nullish coalescing operator - explained</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Mon, 29 Mar 2021 12:40:08 +0000</pubDate>
      <link>https://dev.to/tscharke/nullish-coalescing-operator-explained-54ao</link>
      <guid>https://dev.to/tscharke/nullish-coalescing-operator-explained-54ao</guid>
      <description>&lt;p&gt;The &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; is a new and additional JavaScript operator that has been available since June 2020 with ECMAScript 2020 (ES2020) of the programming language.&lt;/p&gt;

&lt;p&gt;In addition to the well-known &lt;em&gt;binary&lt;/em&gt; logical operators &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; (AND) and &lt;code&gt;||&lt;/code&gt; (OR), it is the third operator &lt;strong&gt;non-binary&lt;/strong&gt; and has the notation &lt;code&gt;??&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's always used when I want to explicitly check whether the value of a variable is available to use or, if the value is not available, to continue working with another value.&lt;/p&gt;

&lt;p&gt;Here is the "classic" for me: Once with an &lt;code&gt;if&lt;/code&gt; block, then in a "simplified" notation with the OR operator and last but not least in the notation with the new &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Long version&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Shorthand with OR-Operator&lt;/span&gt;
&lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// With Nullish-Operator&lt;/span&gt;
&lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first simplification, with the OR operator, works in most cases, but &lt;strong&gt;does not&lt;/strong&gt; cover the case of working with boolean values.&lt;/p&gt;

&lt;p&gt;But let's go through it step by step and see why the variants with the OR-operator work and then switch to the usually "better" &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  OR-Operator
&lt;/h2&gt;

&lt;p&gt;The binary logical operator (&lt;em&gt;Binary Logical Operator&lt;/em&gt;) &lt;code&gt;||&lt;/code&gt; (OR) is defined as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{expression left side} &lt;strong&gt;||&lt;/strong&gt; {expression right side}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I.e. if the expression on the left side delivers the value &lt;code&gt;false&lt;/code&gt; the expression on the right side is interpreted, otherwise the expression on the left side is interpreted.&lt;/p&gt;

&lt;p&gt;For our "simplification" from above...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It means that if the variable &lt;code&gt;firstValue&lt;/code&gt; returns the value &lt;code&gt;true&lt;/code&gt;, this value is returned (and in this case assigned to the variable &lt;code&gt;secondValue&lt;/code&gt;). However, if the variable &lt;code&gt;firstValue&lt;/code&gt; returns &lt;code&gt;false&lt;/code&gt;, the value of the right side is assigned to the variable &lt;code&gt;secondValue&lt;/code&gt; - in my case the value &lt;code&gt;DEFAULT_VALUE&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step by step
&lt;/h2&gt;

&lt;p&gt;Let's go through my example above step by step and see what I mean by...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The first simplification, with the OR operator, works in most cases, but &lt;strong&gt;does not&lt;/strong&gt; cover the case of working with boolean values.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and how the &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; helps us here.&lt;/p&gt;

&lt;p&gt;To do this, I put my example into a function and then execute it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do somthing greate&lt;/span&gt;
    &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false ✅&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🥳 Everything works fine and the code also works with boolean values. 🥳&lt;/p&gt;

&lt;p&gt;Reflexively, I feel like "simplifying" this code and using the possibilities of JavaScript for myself. Because I can determine that a value exists with an &lt;code&gt;if (firstValue)&lt;/code&gt;, which leads to this version of my code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ❌ 😮&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;😮 Oops...When I pass a &lt;code&gt;false&lt;/code&gt; to the function I get back the value &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; and not the value &lt;code&gt;false&lt;/code&gt; as expected 🤔&lt;/p&gt;

&lt;p&gt;I go one step further and "simplify" my code again; and this time I use the OR operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Executes the right operand ("DEFAULT_VALUE")&lt;/span&gt;
  &lt;span class="c1"&gt;// only if the left operand (firstValue) is falsy&lt;/span&gt;

  &lt;span class="c1"&gt;// This one-liner is also called short-circuiting operator 😃&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ❌ 😮&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I find the last "simplification" of my code even better. It takes away the &lt;code&gt;if&lt;/code&gt; block and makes the code easier to read.&lt;/p&gt;

&lt;p&gt;But both "simplifications" lead to the same unexpected result when I call the function with the value &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What have I broken? 🤔&lt;/p&gt;

&lt;p&gt;I haven't &lt;em&gt;broken&lt;/em&gt; anything. I merely used, in both simplifications, the functionality of JavaScript that assumes that a value must be false (&lt;code&gt;false&lt;/code&gt;) - that is, &lt;em&gt;falsy&lt;/em&gt;. In the concrete case, with my &lt;code&gt;if&lt;/code&gt; block and the OR operator, I check whether the value &lt;code&gt;firstValue&lt;/code&gt; is false and then use the value &lt;code&gt;DEFAULT_VALUE&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  When is a value "falsy"
&lt;/h3&gt;

&lt;p&gt;In JavaScript, a value is (&lt;code&gt;false&lt;/code&gt;) or &lt;em&gt;falsy&lt;/em&gt; if it is &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And since this is the way it is in JavaScript, I have also changed the &lt;em&gt;behaviour of my implementation&lt;/em&gt; with my "simplification" of the code 🤷.&lt;/p&gt;

&lt;p&gt;Call the last two code examples with &lt;code&gt;0&lt;/code&gt; (Zero):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Again, I want the value &lt;code&gt;0&lt;/code&gt; (Zero) to be returned, but I get - logically - the value &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; 🤷&lt;/p&gt;

&lt;p&gt;Let's get back to the actual implementation with the following expression in the &lt;code&gt;if&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From this derives my requirement that I want to check whether a value is &lt;strong&gt;nullish&lt;/strong&gt; and &lt;strong&gt;not&lt;/strong&gt; whether a value is &lt;em&gt;falsy&lt;/em&gt;, as I have (unwittingly) done through my "simplifications".&lt;/p&gt;

&lt;h3&gt;
  
  
  What does &lt;em&gt;nullish&lt;/em&gt; mean
&lt;/h3&gt;

&lt;p&gt;With &lt;em&gt;nullish&lt;/em&gt; it's meant that an expression must have the values &lt;code&gt;null&lt;/code&gt; or &lt;code&gt;undefined&lt;/code&gt;, only then it is &lt;strong&gt;nullish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And exactly this is and was what I wanted to have with my first implementation and have implemented.&lt;/p&gt;

&lt;p&gt;Can I not now "simplify" my introductory example? Do I have to manually query all &lt;em&gt;nullish&lt;/em&gt; values in JavaScript myself?&lt;/p&gt;

&lt;p&gt;😱😱😱 &lt;strong&gt;N O O O O&lt;/strong&gt; 😱😱😱&lt;/p&gt;

&lt;h2&gt;
  
  
  The new one - Nullish coalescing operator (&lt;code&gt;??&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;This is where &lt;em&gt;the new one&lt;/em&gt; comes into play - the third logical operator in JavaScript.&lt;/p&gt;

&lt;p&gt;Ladies and gentlemen the &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; 🚀🚀🚀, which is written in JavaScript as &lt;code&gt;??&lt;/code&gt; and is defined as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{expression left side} &lt;strong&gt;??&lt;/strong&gt; {expression right side}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This operator behaves similarly to the OR operator, but with the crucial difference...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;It checks if the expression on the left side is "nullish".&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And not, as with the OR operator, whether the expression is &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A few &lt;em&gt;examples&lt;/em&gt; of the &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: 1 ✅&lt;/span&gt;
&lt;span class="mi"&gt;42&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: 42 ✅&lt;/span&gt;
&lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: DEFAULT VALUE ✅&lt;/span&gt;
&lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: DEFAULT VALUE ✅&lt;/span&gt;
&lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: true ✅&lt;/span&gt;
&lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: false ✅&lt;/span&gt;
&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: 0 ✅&lt;/span&gt;
&lt;span class="dl"&gt;""&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: "" ❓&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And with this knowledge, I can also "simplify" my code example again - like this...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Executes the right operand ("DEFAULT_VALUE")&lt;/span&gt;
  &lt;span class="c1"&gt;// only if the left operand (firstValue) is nullish&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "" ❓&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  I have one more...
&lt;/h2&gt;

&lt;p&gt;In my examples with the &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; you will have noticed that calling my "simplified" functions with an empty string (&lt;code&gt;""&lt;/code&gt;) does not result in &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; being returned.&lt;/p&gt;

&lt;p&gt;This is not relevant to the way my example works, but I don't want to hide from you why this happens.&lt;/p&gt;

&lt;p&gt;The answer is obvious: The &lt;em&gt;nullish coalescing operator&lt;/em&gt; (&lt;code&gt;??&lt;/code&gt;) checks whether a value is &lt;em&gt;nullish&lt;/em&gt;, i.e. whether it's &lt;code&gt;null&lt;/code&gt; or &lt;code&gt;undefined&lt;/code&gt;. And an empty string (&lt;code&gt;""&lt;/code&gt;) is an empty string in JavaScript and thus neither &lt;code&gt;null&lt;/code&gt; nor &lt;code&gt;undefined&lt;/code&gt; - but &lt;em&gt;falsy&lt;/em&gt; 🤣&lt;/p&gt;

&lt;h2&gt;
  
  
  Another example
&lt;/h2&gt;

&lt;p&gt;Let's go one step further and work with boolean values like &lt;code&gt;true&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt; this time. Let's say, in the context of a configuration that should give a sign of life exactly when we are online and assumes that we are (always) online (by default):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// We use the OR operator&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're online&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We use the default-state&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're offline ⚠️&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// true ❌ 😮&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point in the text I have now reckoned with the &lt;code&gt;false&lt;/code&gt; return value of the last call to the function, but it is not what I wanted.&lt;/p&gt;

&lt;p&gt;I want the return value of the function to give me &lt;code&gt;false&lt;/code&gt; when we're offline, i.e. when we set the key &lt;code&gt;online&lt;/code&gt; in the passed object to &lt;code&gt;false&lt;/code&gt; (&lt;code&gt;{ online: false }&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  The known problem
&lt;/h3&gt;

&lt;p&gt;From what I've learned, this wrong result of my function call makes sense. Because &lt;code&gt;online || true&lt;/code&gt; has the following values with the last call: &lt;code&gt;false || true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And if the left side of the OR operator returns &lt;code&gt;false&lt;/code&gt; the value of the expression on the right side is used (the value of the left side is &lt;em&gt;falsy&lt;/em&gt;) - in our case &lt;code&gt;true&lt;/code&gt; 🤷.&lt;/p&gt;

&lt;p&gt;The code works exactly as written, but not as expected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Possible solutions
&lt;/h3&gt;

&lt;p&gt;For my function that expects a configuration object, I could work with &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" rel="noopener noreferrer"&gt;Destructuring&lt;/a&gt; and define a default value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or, instead of a configuration object, I use a &lt;code&gt;boolean&lt;/code&gt; and check it with the &lt;em&gt;strict inequality operator&lt;/em&gt; (&lt;code&gt;!==&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in this article the &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; is the star 🤩 and for my configuration function also a solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// We use the Nullish coalescing operator&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're online&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We use the default-state&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're offline&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// false ✅&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Note
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;a href="https://bit.ly/tscharke-nullish-coalescing-operator" rel="noopener noreferrer"&gt;first version of this article&lt;/a&gt; I wrote in my native language because there is a very active &lt;a href="https://discord.gg/7U3U4epQmc" rel="noopener noreferrer"&gt;German JavaScript Community&lt;/a&gt; of which I am a part and which I would like to give something back to 🙇&lt;/li&gt;
&lt;li&gt;Or to say it with the hashtag of my trainer buddy &lt;a href="https://twitter.com/webdave_de" rel="noopener noreferrer"&gt;WebDave&lt;/a&gt;: &lt;a href="https://twitter.com/hashtag/communityrocks" rel="noopener noreferrer"&gt;#CommunityRocks&lt;/a&gt; and in this case &lt;a href="https://twitter.com/hashtag/GermanJavaScriptCommunityRocksToo" rel="noopener noreferrer"&gt;#GermanJavaScriptCommunityRocksToo&lt;/a&gt; 😉🚀😎&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>operator</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Nullish coalescing operator - Erklärt 🇩🇪 (german only)</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Mon, 29 Mar 2021 10:31:34 +0000</pubDate>
      <link>https://dev.to/tscharke/nullish-coalescing-operator-erklart-german-only-2m6d</link>
      <guid>https://dev.to/tscharke/nullish-coalescing-operator-erklart-german-only-2m6d</guid>
      <description>&lt;p&gt;Der &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; ist ein neuer und zusätzlicher JavaScript-Operator, der seit Juni 2020 mit ECMAScript 2020 (ES2020) der Programmiersprache zur Verfügung steht.&lt;/p&gt;

&lt;p&gt;Er ist neben den (vielleicht) bekannten &lt;em&gt;binären&lt;/em&gt; logischen Operatoren (&lt;em&gt;Binary Logical Operators&lt;/em&gt;) &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; (UND) und &lt;code&gt;||&lt;/code&gt; (ODER) der dritte &lt;strong&gt;nicht binäre&lt;/strong&gt; Operator und hat die Schreibweise &lt;code&gt;??&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Zum Einsatz kommt er immer dann, wenn ich explizit prüfen möchte ob der Wert einer Variable vorliegt um diesen zu nutzen oder, wenn der Wert nicht vorliegt, mit einem anderen Wert weiter zu arbeiten.&lt;/p&gt;

&lt;p&gt;Hier für mich der "Klassiker": Einmal mit einem &lt;code&gt;if&lt;/code&gt;-Block, dann in einer "vereinfachten" Schreibweise mit dem ODER-Operator und zu guter letzt in der Schreibweise mit dem neuen &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Long version&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Shorthand with OR-Operator&lt;/span&gt;
&lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// With Nullish-Operator&lt;/span&gt;
&lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Die erste Vereinfachung, mit dem ODER-Operator, funktioniert in den meisten Fällen, deckt jedoch &lt;strong&gt;nicht&lt;/strong&gt; den Fall ab mit bool‘schen Werten zu arbeiten.&lt;/p&gt;

&lt;p&gt;Doch gehen wir es Schritt für Schritt durch und schauen erstmal warum die Varianten mit dem ODER-Operator funktioniert um dann auf den meist "besseren" &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; auszuweichen.&lt;/p&gt;

&lt;h2&gt;
  
  
  ODER-Operator
&lt;/h2&gt;

&lt;p&gt;Der binäre logische Operator (&lt;em&gt;Binary Logical Operator&lt;/em&gt;) &lt;code&gt;||&lt;/code&gt; (ODER) ist wie folgt definiert:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{Ausdruck linke Seite} &lt;strong&gt;||&lt;/strong&gt; {Ausdruck rechte Seite}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;D.h. liefert der Ausdruck auf der linken Seite den Wert &lt;code&gt;false&lt;/code&gt; wird der Ausdruck auf der rechten Seite interpretiert, ansonsten wird der Ausdruck der linken Seite interpretiert.&lt;/p&gt;

&lt;p&gt;Für unsere "Vereinfachung" von oben…&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;bedeutet es, dass wenn die Variable &lt;code&gt;firstValue&lt;/code&gt; den Wert &lt;code&gt;true&lt;/code&gt; liefert, wird dieser Wert zurückgegeben (und in diesem Fall der Variablen &lt;code&gt;secondValue&lt;/code&gt; zugewiesen). Liefert die Variable &lt;code&gt;firstValue&lt;/code&gt; allerdings &lt;code&gt;false&lt;/code&gt; wird der Wert der rechten Seite der Variable &lt;code&gt;secondValue&lt;/code&gt; zugewiesen - in meinem Fall also der Wert &lt;code&gt;DEFAULT_VALUE&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Schritt für Schritt
&lt;/h2&gt;

&lt;p&gt;Gehen wir mein obiges Beispiel Schritt für Schritt durch und schauen was ich meine mit…&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Die erste Vereinfachung, mit dem ODER-Operator, funktioniert in den meisten Fällen, deckt jedoch &lt;strong&gt;nicht&lt;/strong&gt; den Fall ab mit bool‘schen Werten zu arbeiten.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;und wie uns der &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; hier hilft.&lt;/p&gt;

&lt;p&gt;Dazu packe ich mein Beispiel in eine Funktion und führe diese anschließend aus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Do somthing greate&lt;/span&gt;
    &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false ✅&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🥳 Alles wunderbar und der Code funktioniert auch mit bool'schen Werten. 🥳&lt;/p&gt;

&lt;p&gt;Reflexartig setzt bei mir das Gefühl ein diesen Code zu "vereinfachen" und die Möglichkeiten von JavaScript für mich zu nutzen. Denn dass ein Wert vorhanden ist kann ich mit einem &lt;code&gt;if (firstValue)&lt;/code&gt; ermitteln, was zu dieser Version meines Codes führt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ❌ 😮&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;😮 Upps…Wenn ich ein &lt;code&gt;false&lt;/code&gt; an die Funktion übergebe erhalte ich den Wert &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; zurück und nicht wie erwartet den Wert &lt;code&gt;false&lt;/code&gt; 🤔&lt;/p&gt;

&lt;p&gt;Ich gehe noch einen Schritt weiter und "vereinfachen" meinen Code noch einmal; und dieses mal nutze ich den ODER-Operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Executes the right operand ("DEFAULT_VALUE")&lt;/span&gt;
  &lt;span class="c1"&gt;// only if the left operand (firstValue) is falsy&lt;/span&gt;

  &lt;span class="c1"&gt;// Dieser Einzeiler wird auch short-circuiting operator genannt 😃&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ❌ 😮&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Die letzte "Vereinfachung" meines Codes finde ich noch besser. Diese nimmt mir den &lt;code&gt;if&lt;/code&gt;-Block und macht den Code einfacher zu lesen und übersichtlicher.&lt;/p&gt;

&lt;p&gt;Doch beide "Vereinfachung" führen zu dem selben unerwarteten Ergebnis, wenn ich die Funktion mit dem Wert &lt;code&gt;false&lt;/code&gt; aufrufe.&lt;/p&gt;

&lt;p&gt;Was habe ich kaputt gemacht? 🤔&lt;/p&gt;

&lt;p&gt;Ich habe nichts wirklich &lt;em&gt;kaputt gemacht&lt;/em&gt;. Ich habe lediglich, in beiden Vereinfachungen, Funktionalität von JavaScript genutzt die davon ausgeht dass ein Wert falsch (&lt;code&gt;false&lt;/code&gt;) sein muss - also &lt;em&gt;falsy&lt;/em&gt; ist. Im konkret Fall, mit meinem &lt;code&gt;if&lt;/code&gt;-Block und dem ODER-Operator, prüfe ich ob der Wert &lt;code&gt;firstValue&lt;/code&gt; falsch ist um dann den Wert &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; zu nutzen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wann ist ein Wert "falsy"
&lt;/h3&gt;

&lt;p&gt;In JavaScript ist ein Wert genau dann falsch (&lt;code&gt;false&lt;/code&gt;) oder &lt;em&gt;falsy&lt;/em&gt; wenn dieser &lt;code&gt;null&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; oder &lt;code&gt;false&lt;/code&gt; ist.&lt;/p&gt;

&lt;p&gt;Und da dieses in JavaScript nunmal so ist, habe ich mit meiner "Vereinfachung" des Codes auch gleich das &lt;em&gt;Verhalten meiner Implementierung&lt;/em&gt; verändert 🤷‍&lt;/p&gt;

&lt;p&gt;Rufe doch die letzten beiden Codebeispiele mal mit &lt;code&gt;0&lt;/code&gt; (Zero) auf:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Auch hier möchte ich dass mir der Wert &lt;code&gt;0&lt;/code&gt; (Zero) zurückgegeben wird, doch ich erhalte - logischerweise - den Wert &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; 🤷‍&lt;/p&gt;

&lt;p&gt;Doch kommen wir zurück zur eigentlich Implementierung mit folgendem Ausdruck im &lt;code&gt;if&lt;/code&gt;-Block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Daraus leitet sich meine Anforderung ab dass ich prüfen möchte ob ein Wert &lt;strong&gt;nullish&lt;/strong&gt; ist und &lt;strong&gt;nicht&lt;/strong&gt; ob ein Wert &lt;em&gt;falsy&lt;/em&gt; ist, wie ich es durch meine "Vereinfachungen" (unwissentlich) gemacht habe.&lt;/p&gt;

&lt;h3&gt;
  
  
  Was heisst &lt;em&gt;nullish&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Mit &lt;em&gt;nullish&lt;/em&gt; ist gemeint dass ein Ausdruck die Werte &lt;code&gt;null&lt;/code&gt; oder &lt;code&gt;undefined&lt;/code&gt; haben muss, nur dann ist er &lt;strong&gt;nullish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Und genau dieses ist und war es, was ich mit meiner ersten Implementierung haben wollte und umgesetzt habe.&lt;/p&gt;

&lt;p&gt;Kann ich jetzt meine einleitendes Beipiels nicht "vereinfachen"? Muss ich, von Hand, alle &lt;em&gt;nullish&lt;/em&gt;-Werte in JavaScript selber abfragen?&lt;/p&gt;

&lt;p&gt;😱😱😱 &lt;strong&gt;N E I N&lt;/strong&gt; 😱😱😱&lt;/p&gt;

&lt;h2&gt;
  
  
  Der Neue - Nullish coalescing operator (&lt;code&gt;??&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Hier kommt &lt;em&gt;der Neue&lt;/em&gt; ins Spiel - der dritten logische Operatoren in JavaScript.&lt;/p&gt;

&lt;p&gt;Meine Damen und Herren der &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; 🚀🚀🚀, der in JavaScript als &lt;code&gt;??&lt;/code&gt; geschrieben wird und wie folgt definiert ist:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{Ausdruck linke Seite} &lt;strong&gt;??&lt;/strong&gt; {Ausdruck rechte Seite}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Dieser Operator verhält sich ähnlich wie der ODER-Operator, doch mit dem entscheidenden Unterschied…&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Es wird geprüft ob der Ausdruck auf der linken Seite "nullish" ist.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Und nicht wie beim ODER-Operator, ob der Ausdruck &lt;code&gt;false&lt;/code&gt; ist.&lt;/p&gt;

&lt;p&gt;Ein paar &lt;em&gt;Beispiele&lt;/em&gt; zum &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: 1 ✅&lt;/span&gt;
&lt;span class="mi"&gt;42&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: 42 ✅&lt;/span&gt;
&lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: DEFAULT VALUE ✅&lt;/span&gt;
&lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: DEFAULT VALUE ✅&lt;/span&gt;
&lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: true ✅&lt;/span&gt;
&lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: false ✅&lt;/span&gt;
&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: 0 ✅&lt;/span&gt;
&lt;span class="dl"&gt;""&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Result is: "" ❓&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Und mit diesem Wissen kann ich mein Codebeispiel auch wieder "vereinfachen" - und zwar so…&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Executes the right operand ("DEFAULT_VALUE")&lt;/span&gt;
  &lt;span class="c1"&gt;// only if the left operand (firstValue) is nullish&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;firstValue&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;DEFAULT_VALUE&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;secondValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 1 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 42 ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="cm"&gt;/* No value means `undefined` as value */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// DEFAULT_VALUE ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false ✅&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazing&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "" ❓&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Einen habe ich noch…
&lt;/h2&gt;

&lt;p&gt;Bei meinen Beispielen mit dem &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; wird Euch aufgefallen sein, dass der Aufruf meiner "vereinfachten" Funktionen mit einem leeren String (&lt;code&gt;""&lt;/code&gt;) nicht dazu führt das mir &lt;code&gt;DEFAULT_VALUE&lt;/code&gt; zurückgegeben wird.&lt;/p&gt;

&lt;p&gt;Das ist für die Funktionsweise meines Beispiels nicht relevant, doch ich möchte Euch nicht verschweigen warum es dazu kommt.&lt;/p&gt;

&lt;p&gt;Die Antwort liegt eigentlich klar vor uns: Der &lt;em&gt;Nullish coalescing operator&lt;/em&gt; (&lt;code&gt;??&lt;/code&gt;) prüft ob ein Wert &lt;em&gt;nullish&lt;/em&gt; ist, also &lt;code&gt;null&lt;/code&gt; oder &lt;code&gt;undefined&lt;/code&gt; ist. Und ein leerer String (&lt;code&gt;""&lt;/code&gt;) ist in JavaScript ein leerer String und damit weder &lt;code&gt;null&lt;/code&gt; noch &lt;code&gt;undefined&lt;/code&gt; - aber &lt;em&gt;falsy&lt;/em&gt; 🤣&lt;/p&gt;

&lt;h2&gt;
  
  
  Ein weiteres Beispiel
&lt;/h2&gt;

&lt;p&gt;Gehen wir noch einen Schritt weiter und wollen dieses mal tatsächlich mit bool‘schen Werten wie &lt;code&gt;true&lt;/code&gt; und &lt;code&gt;false&lt;/code&gt; arbeiten. Sagen wir, im Rahmen einer Konfiguration die genau dann einen Lebenszeichen von sich geben soll wenn wir online sind und voraussetzt dass wir (immer) online sind (per default):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// We use the OR operator&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're online&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We use the default-state&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're offline ⚠️&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// true ❌ 😮&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An dieser Stelle des Textes habe ich jetzt mit dem "falschen" Rückgabewert des letzten Aufrufes der Funktion gerechnet, doch es ist nicht das was ich wollte.&lt;/p&gt;

&lt;p&gt;Ich möchte das der Rückgabewert der Funktion mir &lt;code&gt;false&lt;/code&gt; liefert, wenn wir offline sind, also wenn wir im übergebenem Objekt den key &lt;code&gt;online&lt;/code&gt; auf &lt;code&gt;false&lt;/code&gt; setzen (&lt;code&gt;{ online: false }&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  Das bekannte Problem
&lt;/h3&gt;

&lt;p&gt;Mit dem gelernten macht dieses falsche Ergebnis meines Funktionsaufrufes Sinn. Denn &lt;code&gt;online || true&lt;/code&gt; hat mit dem letzten Aufruf folgende Werte: &lt;code&gt;false || true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Und wenn die linke Seite des ODER-Operators &lt;code&gt;false&lt;/code&gt; liefert wird der Wert des Ausdrucks auf der rechten Seite genutzt (der Wert der linken Seite ist &lt;em&gt;falsy&lt;/em&gt;) - in unserem Fall &lt;code&gt;true&lt;/code&gt; 🤷‍.&lt;/p&gt;

&lt;p&gt;Der Code funktioniert genau wie geschrieben, doch nicht wie erwartet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mögliche Lösungen
&lt;/h3&gt;

&lt;p&gt;Für meine Funktion, die ein Konfigurationsobjekt erwartet, könnte ich mit &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" rel="noopener noreferrer"&gt;Destructuring&lt;/a&gt; arbeiten und einen Defaultwert definieren:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Oder ich nutze, statt eines Konfigurationsobjekts, ein &lt;code&gt;boolean&lt;/code&gt; und prüfe diese mit dem &lt;em&gt;strict inequality operator&lt;/em&gt; (&lt;code&gt;!==&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Doch in diesem Artikel ist der &lt;strong&gt;Nullish coalescing operator&lt;/strong&gt; der Star 🤩 und für meine Konfigurationsfunktion auch eine Lösung:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// We use the Nullish coalescing operator&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;online&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;sendKeepAlive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're online&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We use the default-state&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt; &lt;span class="c1"&gt;// true ✅&lt;/span&gt;

&lt;span class="c1"&gt;// We say explicit that we're offline&lt;/span&gt;
&lt;span class="nf"&gt;doSomethingAmazingWithAConfiguration&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;online&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; &lt;span class="c1"&gt;// false ✅&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Anmerkung
&lt;/h2&gt;

&lt;p&gt;Diesen Artikel habe ich bewusst in meiner Muttersprache (&lt;em&gt;Deutsch&lt;/em&gt;) verfasst, da es eine sehr aktive deutsche JavaScript-Community (u.a. &lt;a href="https://discord.gg/7U3U4epQmc" rel="noopener noreferrer"&gt;hier&lt;/a&gt;) gibt von der ich ein Teil bin und der ich hiermit etwas zurück geben möchte 🙇‍♂️&lt;/p&gt;

&lt;p&gt;Oder um es mit mit dem Hashtag meines Trainer-Buddies &lt;a href="https://twitter.com/webdave_de" rel="noopener noreferrer"&gt;WebDave&lt;/a&gt; zu sagen: &lt;a href="https://twitter.com/hashtag/communityrocks" rel="noopener noreferrer"&gt;#CommunityRocks&lt;/a&gt; und in diesem Fall &lt;a href="https://twitter.com/hashtag/GermanJavaScriptCommunityRocksToo" rel="noopener noreferrer"&gt;#GermanJavaScriptCommunityRocksToo&lt;/a&gt; 😉🚀😎&lt;/p&gt;

&lt;p&gt;If you want to read this article in English, you are in the right place &lt;a href="https://bit.ly/tscharke-nullish-coalescing-operator-explained" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>operator</category>
      <category>beginners</category>
      <category>german</category>
    </item>
    <item>
      <title>No fear of Videoconferencing</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Sun, 15 Mar 2020 16:32:50 +0000</pubDate>
      <link>https://dev.to/tscharke/no-fear-of-video-communication-12j2</link>
      <guid>https://dev.to/tscharke/no-fear-of-video-communication-12j2</guid>
      <description>&lt;p&gt;I'm used to being in an active exchange with my customers, partners, team members, etc.&lt;/p&gt;

&lt;p&gt;As a #RemoteWork 'er I rely on video communication with different tools like &lt;a href="https://zoom.us" rel="noopener noreferrer"&gt;Zoom&lt;/a&gt;, &lt;a href="https://www.skype.com" rel="noopener noreferrer"&gt;Skype&lt;/a&gt;, &lt;a href="https://slack.com/" rel="noopener noreferrer"&gt;Slack&lt;/a&gt;, &lt;a href="https://spreed.me" rel="noopener noreferrer"&gt;Spreed.me&lt;/a&gt;, &lt;a href="https://hangouts.google.com" rel="noopener noreferrer"&gt;Google Hangouts&lt;/a&gt;, &lt;a href="https://teams.microsoft.com/" rel="noopener noreferrer"&gt;Microsoft Teams&lt;/a&gt; and what they are all called 🤷&lt;/p&gt;

&lt;p&gt;And this sentence already contains the decisive and important point: &lt;strong&gt;Video&lt;/strong&gt;! - in video communication.&lt;/p&gt;

&lt;p&gt;My point is that the &lt;strong&gt;visual&lt;/strong&gt; and thus the &lt;strong&gt;seeing&lt;/strong&gt; and &lt;strong&gt;being seen&lt;/strong&gt; is &lt;strong&gt;important&lt;/strong&gt; and should be used. Like in a normal meeting in the coffee kitchen or a meeting room.&lt;/p&gt;

&lt;p&gt;Because information is transmitted via the spoken word (7%) and body language, body expression (55%), etc. (1)&lt;/p&gt;

&lt;p&gt;But very often I experience a certain &lt;em&gt;shy&lt;/em&gt; of this direct communication and especially a &lt;em&gt;shy&lt;/em&gt; of turning on one's camera during communication - of showing oneself and being seen. No matter whether it is a planned meeting or a spontaneous &lt;em&gt;"let's talk about it for a moment"&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This means that essential information is &lt;strong&gt;lost&lt;/strong&gt; and it also feels very boring, &lt;strong&gt;unsocial&lt;/strong&gt; and &lt;strong&gt;isolated&lt;/strong&gt; to talk to a photo or a dark screen.&lt;/p&gt;

&lt;p&gt;Sure, there is also the possibility to communicate only textually; but the &lt;strong&gt;direct communication&lt;/strong&gt; is not to be underestimated - and &lt;strong&gt;turning on your camera&lt;/strong&gt; certainly not 😉And there's hardly any "excuse" to refrain from this (tools and the hardware are available).&lt;/p&gt;

&lt;p&gt;Therefore...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses every opportunity for a &lt;strong&gt;direct conversation&lt;/strong&gt;, whether it is with a single person or a group of people.&lt;/li&gt;
&lt;li&gt;Always &lt;strong&gt;turn on&lt;/strong&gt; your &lt;strong&gt;camera&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request to turn on the camera&lt;/strong&gt; from/to your call-partner.&lt;/li&gt;
&lt;li&gt;Make sure that you're &lt;strong&gt;well recognizable&lt;/strong&gt; (light, the position of the camera).&lt;/li&gt;
&lt;li&gt;Don't &lt;strong&gt;worry&lt;/strong&gt; about your appearance (&lt;em&gt;if you aren't applying as a face model&lt;/em&gt; 🤣 )&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prepare the sound and your camera before a conversation&lt;/strong&gt;. Briefly check in the settings if everything works, if you're recognizable, etc. This takes less than 1 minute 😉&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And like everything else in life, &lt;strong&gt;it gets easier the more we do it!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Having the &lt;strong&gt;direct conversation&lt;/strong&gt;, whether it's just for a minute or, say, a full pairing session, is priceless. It conveys the spoken words and body language, body expression (even if it is only a camera shot) and creates a &lt;strong&gt;connection&lt;/strong&gt; - a connection with/to your counterpart. &lt;strong&gt;It strengthens the relationship, the trust and brings us closer together.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And as with any conversation, things can be &lt;strong&gt;talked about directly&lt;/strong&gt; and any "misunderstandings" can be quickly identified and cleared up/resolved. Because we not only hear what someone says, we also see the other person and communicate at eye level (visually seen).&lt;/p&gt;

&lt;p&gt;So...use the direct conversation and &lt;strong&gt;switch on your camera&lt;/strong&gt; - &lt;strong&gt;ALWAYS&lt;/strong&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a&gt;(1)&lt;/a&gt; &lt;a href="https://www.berufsstrategie.de/bewerbung-karriere-soft-skills/koerpersprache.php" rel="noopener noreferrer"&gt;Body language&lt;/a&gt; (German only 🤷‍♂️)&lt;/li&gt;
&lt;li&gt;Photo by &lt;a href="https://unsplash.com/@introspectivedsgn" rel="noopener noreferrer"&gt;Erik Mclean&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>communication</category>
      <category>video</category>
      <category>remote</category>
      <category>people</category>
    </item>
    <item>
      <title>Home-Office, Remote-Work,… What!?! A definition of terms</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Sun, 05 Jan 2020 18:02:02 +0000</pubDate>
      <link>https://dev.to/tscharke/remote-what-a-definition-of-terms-5m9</link>
      <guid>https://dev.to/tscharke/remote-what-a-definition-of-terms-5m9</guid>
      <description>&lt;h1&gt;
  
  
  Prologue
&lt;/h1&gt;

&lt;p&gt;Today (09th of April) it feels like the whole world talks about &lt;strong&gt;Home-Office&lt;/strong&gt; and &lt;strong&gt;Remote-Work&lt;/strong&gt;. Some people practice it nowadays, others (like me 😉) practice it for years.&lt;/p&gt;

&lt;p&gt;With my personal mindset and some learnings, readings and experiences, today is a good time to update this article and bring in some of the learnings and refresh the structure.&lt;/p&gt;

&lt;p&gt;And the main questions, that are often brought to, are the questions of the concepts. &lt;strong&gt;What is behind these terms?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, I would like to write down the terms I know and define them how I understand and use them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Statement
&lt;/h1&gt;

&lt;p&gt;Before today's situation (#COVID-19) you could read a lot of &lt;strong&gt;Remote-Work&lt;/strong&gt;, &lt;strong&gt;Digital Nomads&lt;/strong&gt; and &lt;strong&gt;New Work&lt;/strong&gt;, etc. And gladly paired with the statement: &lt;em&gt;Remote-Work is the future&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;One more thing in advance, because I will never tire of repeating it and that in 2020 it makes more sense than ever before:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Remote-Work is not the future, it is the present&lt;/strong&gt; (1)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Table of Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Concepts and Definitions&lt;/li&gt;
&lt;li&gt;
Terms

&lt;ul&gt;
&lt;li&gt;Telecommuting / Telework / Telearbeit&lt;/li&gt;
&lt;li&gt;Home-Office&lt;/li&gt;
&lt;li&gt;Remote-Work&lt;/li&gt;
&lt;li&gt;Distributed-Work&lt;/li&gt;
&lt;li&gt;Remote-Teams&lt;/li&gt;
&lt;li&gt;Digital Nomads&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Footnotes&lt;/li&gt;

&lt;/ul&gt;

&lt;h1&gt;
  
  
  Concepts and Definitions &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;In general, the terms refer to &lt;strong&gt;working independently of location and time&lt;/strong&gt;. It can be one, the other or both; it is, therefore an &lt;em&gt;or&lt;/em&gt; or an &lt;em&gt;and&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Furthermore, certain criteria must be met to be able to work anywhere in the world and at any time (e.g. internet, equipment, time zones, mindset, tools, etc.)&lt;/p&gt;

&lt;p&gt;Above my definitions is the term &lt;a href="https://en.wikipedia.org/wiki/Frithjof_Bergmann#New_Work" rel="noopener noreferrer"&gt;&lt;strong&gt;New Work&lt;/strong&gt;&lt;/a&gt;, which represents a model developed by Frithjof Bergmann. More precisely, &lt;a href="https://wikipedia.org" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the years between 1976 to 1979, he undertook trips to the former countries of the Eastern bloc and began to question capitalism and communism. In this time he introduces his concept of New Work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For me, the following terms are therefore aspects that contribute to a &lt;em&gt;New Work&lt;/em&gt; but are not specified in it and therefore are not &lt;em&gt;must&lt;/em&gt; be.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Sometimes there're country-specific peculiarities/differences. The characteristics I mark with a flag (e.g. 🇩🇪) and list them there.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Terms &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Telecommuting / Telework / Telearbeit &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In 1973, Jack Nilles (Rocket scientist with the US Air Force) described the concept of &lt;em&gt;working independently of location&lt;/em&gt; for the first time. Jack spent a lot of time in traffic jams and wondered if there could be other forms of "work" or better "working together".&lt;/p&gt;

&lt;p&gt;With these ideas, he spends a lot of time of research and all this ends in these definitions &lt;a href="https://en.wikipedia.org/wiki/Telecommuting" rel="noopener noreferrer"&gt;taken from Wikipedia&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;[..]The term means [..] a work arrangement in which employees do not commute or travel to a central place of work, such as an office [..].&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Others words for it are telecommuting, telework, teleworking, working from home (WFH), mobile work, remote work, and flexible workplace.&lt;/p&gt;

&lt;p&gt;Nowadays I would say it's the definition we know as &lt;strong&gt;Home-Office&lt;/strong&gt; because it is &lt;strong&gt;location-independence&lt;/strong&gt; only.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🇩🇪 The word "Telework" was translated in Germany 1-to-1 to &lt;strong&gt;Telearbeit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;🇩🇪 So "Telearbeit" is a term that I know from Germany only.&lt;/li&gt;
&lt;li&gt;🇩🇪 The exclusively &lt;a href="https://de.wikipedia.org/wiki/Telearbeit" rel="noopener noreferrer"&gt;German Wikipedia&lt;/a&gt; says about it: "&lt;em&gt;The term Telearbeit refers to forms of work in which employees perform all or part of their work outside the employer's premises.&lt;/em&gt;". This refers to the actual &lt;strong&gt;Home-Office&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;🇩🇪 This term is used in certain "circles" in Germany as a &lt;em&gt;devaluation&lt;/em&gt; because here the mentioned topics are only slowly gaining ground. Conscientious people also use the word Telearbeit to point out that the mindset of the other person - charmingly put - is lagging behind the times (&lt;em&gt;that I never used 😉 I will describe it for completeness&lt;/em&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Home-Office &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The workplace including the infrastructure is &lt;em&gt;at home&lt;/em&gt;. In general, it is &lt;strong&gt;location-independent&lt;/strong&gt; and not time-independent.&lt;br&gt;
It's not time-independent working, because the person has to keep to the official office hours to be reachable e.g.&lt;/p&gt;

&lt;p&gt;There are two models for &lt;strong&gt;location-independence&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I). The home address is contractually regulated - then &lt;em&gt;&lt;strong&gt;it is not&lt;/strong&gt;&lt;/em&gt; location-independent.&lt;/li&gt;
&lt;li&gt;II). The home address is &lt;em&gt;not&lt;/em&gt; contractually regulated and it is my own decision to work at home, although I could go somewhere else at any time - then &lt;em&gt;&lt;strong&gt;it is&lt;/strong&gt;&lt;/em&gt; location-independent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're different in Germany, so we have some &lt;em&gt;specials&lt;/em&gt; 🤦‍♂️&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🇩🇪 The word "Home-Office" was translated to "Remote-Work" because 🤷‍♂️I've no clue; it sounds cool or the most Germany thought that "Home-Office" isn't an English word? 🤔🤷‍♂️&lt;/li&gt;
&lt;li&gt;🇩🇪 If an employer allows and defines this term in the employment contract, the employer is responsible for the working-situation and working-equipment (e.g. desk, chair, lamp, monitors, keyboards, etc.) and the corresponding conditions of the "Employment Protection Act" (in german: &lt;a href="https://de.wikipedia.org/wiki/Arbeitsplatzschutzgesetz" rel="noopener noreferrer"&gt;Arbeitsplatzschutzgesetz&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Remote-Work &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Remote-Work is &lt;em&gt;not&lt;/em&gt; Home-Office. It extends the term Home-Office by the factor of &lt;strong&gt;time-independence&lt;/strong&gt;. This means that in Remote Work a person works &lt;strong&gt;location-independent and time-independent&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🇩🇪 The term is also often used when the employment type "self-employed" is added to the two factors of location- and time-independent work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In current discussions, this term implies that regardless of the type of employment, an office or Headquarter (HQ) is available. This means that working independently of location is an "option" that can be used. However, if there is no office or similar, then location-independent is no longer an option and we would have to speak of &lt;em&gt;Distributed Work&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Distributed-Work &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This means that people work &lt;em&gt;independently of location&lt;/em&gt; AND &lt;em&gt;time&lt;/em&gt; AND &lt;em&gt;distributed&lt;/em&gt;. It extends the term Remote-Work by the factor of &lt;strong&gt;distribution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This term is currently being used more and more often since more and more companies are implicitly distributed. These companies have no offices, Headquarters (HQ) or other premises, and do not want them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Matt_Mullenweg" rel="noopener noreferrer"&gt;Matt Mullenweg&lt;/a&gt; talks about it in his podcast &lt;a href="https://podcasts.apple.com/us/podcast/episode-17-matt-mullenweg-reflects-on-distributed-work/id1463243282?i=1000460808329" rel="noopener noreferrer"&gt;Distributed&lt;/a&gt; and Canva has also presented it in her blog post &lt;a href="https://product.canva.com/challenging-hq-privilege/" rel="noopener noreferrer"&gt;Challenging hq privilege&lt;/a&gt;. The term and its distinction from &lt;em&gt;Remote-Work&lt;/em&gt; are currently under active discussion. 😃&lt;/p&gt;

&lt;p&gt;To be honest, until a couple of weeks before, I use the terms Remote-Work and Distributed-Work synonymously. Nowadays I use the term &lt;strong&gt;Distributed-Work&lt;/strong&gt; only, because Remote-Work becomes the new Home-Office and so Distributed-Work should become the new Remote-Work 😆&lt;/p&gt;

&lt;h2&gt;
  
  
  Remote-Teams &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;More than two people (a &lt;a href="https://en.wikipedia.org/wiki/Team" rel="noopener noreferrer"&gt;team&lt;/a&gt;) who practice Remote-Work, i.e. &lt;strong&gt;work location&lt;/strong&gt; AND &lt;strong&gt;time-independent&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Most remote teams I hear about are in permanent employment. Only rarely do I hear of teams consisting of only self-employed or even of permanent employees and self-employed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Digital Nomads &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A Digital Nomad practices Remote-Work and extends this by the factor of &lt;strong&gt;non-sedentary lifestyle&lt;/strong&gt; or puts this factor in the foreground.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Nomads&lt;/em&gt; are people who lead a non-sedentary lifestyle. This means that they are people who emphasize the two aspects of travel and frequent changes of location. Nomads do not have a permanent home. They stay where they want and as long as they want.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Digital&lt;/em&gt; because they meet the above criteria and work in a digital profession.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Footnotes &lt;a&gt;&lt;/a&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Cover Image by &lt;a href="https://unsplash.com/@sloppyperfectionist" rel="noopener noreferrer"&gt;Hans-Peter Gauster&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;(1) I didn't invent this statement. I've adopted it because I find it coherent and appropriate. Unfortunately, I can't find the author anymore. If someone knows more, please leave me a comment 😉&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>homeoffice</category>
      <category>remotework</category>
      <category>distributedwork</category>
      <category>newwork</category>
    </item>
    <item>
      <title>What are ways to convey language- and framework-properties in a better way in teams?</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Sun, 29 Dec 2019 16:16:30 +0000</pubDate>
      <link>https://dev.to/tscharke/what-are-ways-to-convey-language-and-framework-properties-in-a-better-way-in-teams-66h</link>
      <guid>https://dev.to/tscharke/what-are-ways-to-convey-language-and-framework-properties-in-a-better-way-in-teams-66h</guid>
      <description>&lt;p&gt;In some projects I always come across the following question, which is asked in the same way or differently:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How often do you meet developers who deal with your languages, architectures and frameworks?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After asking some questions these points come up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers copy &amp;amp; paste something together until it &lt;strong&gt;just&lt;/strong&gt; works.&lt;/li&gt;
&lt;li&gt;Making changes or even putting parts into another context is not possible.&lt;/li&gt;
&lt;li&gt;No thought was given to language-/framework-properties.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This leads to a situation in the projects where it becomes difficult to find your way around and work "properly" because side effects are possible and cannot be estimated 🕳️&lt;/p&gt;

&lt;p&gt;For me, this is the question behind it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What are ways to convey how to do it right/better and to arouse the interest and enthusiasm of the team members.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To be quite frank, I'm familiar with these situations and sometimes I'm doing it by myself 😞🤦‍♂️ This means that there're situations where a certain "pressure" arises to find a &lt;em&gt;quick&lt;/em&gt; solution. So that I fall back on an answer from Stack-Overflow e.g. without having to follow it up afterwards. By this, I mean that I don't always sit down afterwards and look at the solution in detail to…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;learn how it works and&lt;/li&gt;
&lt;li&gt;to grow on it, to do it better from now on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this is repeated often enough, it leads to an unhealthy "culture" in the team or even in the company and has long-term economic consequences (e.g. the effort to implement new features increases, maintenance and updates becomes difficult, even impossible).&lt;/p&gt;

&lt;h2&gt;
  
  
  Can be counteracted this?
&lt;/h2&gt;

&lt;p&gt;My answer is: &lt;strong&gt;Yes, it can!&lt;/strong&gt; I would go even further and emphasize &lt;strong&gt;that it have to do&lt;/strong&gt; so starting immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can be counteracted this?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start with yourself&lt;/strong&gt; 🤳: Start - from now on - doing it differently and better yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pair/Mob-Programming&lt;/strong&gt; 👨‍👩‍👧‍👦: It's incredibly motivating to work on features or bugfixes together with someone else. Everyone involved learns and knowledge is passed on. In my opinion, it should be taken care that partners fit together humanly and have different levels of knowledge also. This means that everyone should have different experiences; be it in terms of language, technology, frameworks, code history or other areas of a project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pull Request&lt;/strong&gt; 🔄: If Pull Request (&lt;em&gt;PRs&lt;/em&gt;) are done with defined rules or even a ductus, then this can work "miracles". If PR's are reviewed in a constructive, friendly and benevolent manner, then this contributes to knowledge transfer and transparency. PR's should not be seen as an evaluation of the work. Rather, they should serve to push forward jointly defined guidelines and to recognize where things are repeatedly going in an unhealthy direction. It's therefore crucial that reviewers are "carefully selected" and that reviews are seen as important (e.g. there must be time for them). PR's have to be seen as a &lt;strong&gt;save-place&lt;/strong&gt; where things are going in a good direction. By identifying what is missing or that something does not correspond to what was agreed upon. PR's are bidirectional.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lightning Talks/Demos&lt;/strong&gt; 📽️: Besides demos, in which the newest features are presented, there should be regular lightning talks in which everyone introduces to others and shows what new architectures or language-/framework-properties are available (in short and on/with code). Or what is often noticed (e.g. through the reviews) and should be done differently. At the end of the talk, the team should then commit to it and incorporate what they have learned into the current development. Just to make it clear: It's not about a big presentation, more consciously about something small, concise and crisp. Quasi presentations &lt;strong&gt;from&lt;/strong&gt; developers &lt;strong&gt;for&lt;/strong&gt; developers. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The pathfinder rule&lt;/strong&gt; 📐: &lt;a href="https://blog.cleancoder.com" rel="noopener noreferrer"&gt;Clean code&lt;/a&gt; can be used in general and often it helps to apply only this one rule. So, leave the part of the code you're working on better than you found it. Means, that while you're working on a feature or bugfix, clean up at the same time. Refactor the code, update the code around it to the "latest" (agreed upon state) the team has committed to. I think it's important that you only refer to the part you're working on. This gives the entire project an iterative improvement and renewal. Do not change/adapt everything and it's also clear that there will be parts of code that will not be touched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With all these points I'm not concerned with dogmatism. It's about starting with it and being the pioneer - the one who makes it better from now on - to &lt;strong&gt;lead&lt;/strong&gt; by example.&lt;br&gt;
To ensure that these things are taken seriously because they cause economic damage in the long term. In my experience, team members will quickly follow and &lt;em&gt;critics&lt;/em&gt; will always be there anyway.&lt;/p&gt;

&lt;p&gt;Do you know this from your own experience? How do you see that? What're your approaches to communicate how to make it right/better?&lt;/p&gt;

&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@egnaro" rel="noopener noreferrer"&gt;Rick Mason&lt;/a&gt; on &lt;a href="https://unsplash.com" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>communication</category>
      <category>codequality</category>
      <category>agile</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Why I choose the title "Software Artist"</title>
      <dc:creator>Thomas Scharke</dc:creator>
      <pubDate>Sun, 10 Nov 2019 18:16:59 +0000</pubDate>
      <link>https://dev.to/tscharke/why-i-choose-the-title-software-artist-4bec</link>
      <guid>https://dev.to/tscharke/why-i-choose-the-title-software-artist-4bec</guid>
      <description>&lt;p&gt;I'm now other 15 years in the IT business and most of my time I'm actively sitting in front of a keyboard and writing code. Some times I do it on my own and more alone but mostly I do this with other peoples regardless of whether in the same room or remotely. And I do more…&lt;/p&gt;

&lt;p&gt;In my carrier, I already had so many titles starting from "developer" over "application developer", "software developer" towards to "software designer" and it ends in "software developer" and all of this with attachments for the corresponding technologies like #Java, #JavaScript, #TypeScript, etc. (e.g. "JavaScript Software Developer") and you can get even more creative in it and make something like "Typescript and React-Native Software Mobile App Developer" - you got the picture 😉&lt;/p&gt;

&lt;p&gt;And if you're working together with a team or being part of a team and feels responsible for the people, the working environment, the code the quality of code and the results or better the products someone thinks you're a "leader". And to share this information they found it a solid idea to put this information in addition to your job title. And so it ends up in "Lead Developer, "Lead Software Developer", "Lead React-Native Software Developer for Mobile Apps" and so on. &lt;/p&gt;

&lt;p&gt;And here you may already see the confusion for me and for others. Does someone else realize what I'm doing? Do I explain good enough what I'm doing? Do teammates, recruiter or new customers locate me with this? Does it justice to what I do?&lt;/p&gt;

&lt;p&gt;Ok, it's kind of &lt;em&gt;engineering&lt;/em&gt; and so I'm a kind of a &lt;strong&gt;software engineer&lt;/strong&gt;. But there's more in it…&lt;/p&gt;

&lt;p&gt;With these points in my head, I stumble about the article &lt;a href="https://medium.com/hackernoon/dont-be-a-software-engineer-be-a-software-artist-204dbd47e8ca" rel="noopener noreferrer"&gt;Don’t be a Software Engineer, be a Software Artist&lt;/a&gt; from Jeremy Song in the last year. And during the reading me tought: &lt;em&gt;Wow 😮 this describes exactly my confusion and brings a solution for me too 🙏&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Jeremy describes in his article the following requirements for a software engineer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;knowing how to write code and test code,&lt;/li&gt;
&lt;li&gt;knowing how to identify business problems, collect user requirements, design a project and release it,&lt;/li&gt;
&lt;li&gt;and anything in software engineer’s job description.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;And he comes to the conclusion: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Usually, there is no requirement of writing easy-to-understand code, or designing a project that is easy-to-use. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Spontaneously I asked myself the questions, what's about understanding the customers, the products, the teams, the organisational parts and all the social think besides the technical parts?&lt;/p&gt;

&lt;p&gt;Jeremy answers it with&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Software artists can surely build software with highest standards. But being a software artist is more than just being an excellent software engineer who can write good code and design good architectures. Being an artist in software industry requires you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understand your customers and&lt;/li&gt;
&lt;li&gt;be a teacher and an influencer.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;This describes exactly what I'm doing, what I'm feeling and what I would like to expand further in the future.&lt;/p&gt;

&lt;p&gt;With this in mind, I decided to call myself a &lt;strong&gt;Software Artist&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Does this answer my previous questions? Let's think about it…&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does someone else realize what I'm doing?&lt;/li&gt;
&lt;li&gt;Do I explain good enough what I'm doing?&lt;/li&gt;
&lt;li&gt;Do teammates, recruiter or new customers locate me with this? &lt;/li&gt;
&lt;li&gt;Does it justice to what I do?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To be honest, the last question is answered this &lt;strong&gt;yes&lt;/strong&gt;, only.&lt;/p&gt;

&lt;p&gt;Teammates, recruiter or new customers cannot find me if they following the searching path like "JavaScript", "React Native", "Teamlead of whatever" or so. I explained not more precisely what I'm doing as before and at the moment no more realize what I'm doing except that it has anything to do with software.&lt;/p&gt;

&lt;p&gt;In the end, I've achieved the following for me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I justice what I do and it's more than building software and writing code.&lt;/li&gt;
&lt;li&gt;The title is a good icebreaker to get into a conversation with.&lt;/li&gt;
&lt;li&gt;The title sounds very cool - I think 😆😆 and&lt;/li&gt;
&lt;li&gt;with my subtitle &lt;strong&gt;Passionate implementer of ideas&lt;/strong&gt; it describes exactly what I'm doing, what I ❤️ to do, what I stand for and what you can expect from me thought beyond technologies.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What do you call yourself? What kind of values is behind it for you? What do you think? Are there other &lt;strong&gt;Software Artist&lt;/strong&gt; out there?&lt;/p&gt;

&lt;p&gt;Cover-Image/Photo by Ari He on &lt;a href="https://unsplash.com/" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>softwareartist</category>
      <category>title</category>
      <category>career</category>
      <category>developer</category>
    </item>
  </channel>
</rss>
