<?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: Angelo Moroni</title>
    <description>The latest articles on DEV Community by Angelo Moroni (@hooloovoochimico).</description>
    <link>https://dev.to/hooloovoochimico</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%2F218619%2F310e36b1-ae07-4d94-a931-d534079abf50.jpg</url>
      <title>DEV Community: Angelo Moroni</title>
      <link>https://dev.to/hooloovoochimico</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hooloovoochimico"/>
    <language>en</language>
    <item>
      <title>Ternary Operator, I miss you</title>
      <dc:creator>Angelo Moroni</dc:creator>
      <pubDate>Tue, 27 Aug 2019 13:08:55 +0000</pubDate>
      <link>https://dev.to/hooloovoochimico/ternary-operator-i-miss-you-9dc</link>
      <guid>https://dev.to/hooloovoochimico/ternary-operator-i-miss-you-9dc</guid>
      <description>&lt;p&gt;Kotlin is a wonderful language but I remember I was really sad when I saw that it doesn't have the ternary operator. I was a Java developer and I have user this operator a lot of times because I think it's fast to write and easy to read.&lt;/p&gt;

&lt;p&gt;Wait, wait, yes: I know that &lt;code&gt;if&lt;/code&gt; expression returns a value, but I think writing an &lt;code&gt;if&lt;/code&gt; is superfluous when the body has only one instruction.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;I'd rather write this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val foo = booleanValue ? something : anythingElse
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;than this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;foo&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="n"&gt;booleanValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;anythingElse&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, since the body may present a complicated expression, using the ternary operator I could write fewer lines of code.&lt;/p&gt;

&lt;p&gt;Yes, you're right, I'm lazy; but If I wasn't so lazy, I'd be a farmer instead of a developer.&lt;/p&gt;

&lt;p&gt;And yes you're right when the code is too much concise, it is less readable and I also believe that balance between readability and brevity is a good thing, but I don't think that ternary operator is the problem.&lt;/p&gt;

&lt;p&gt;In fact, Kotlin advocates suggest us to avoid a list of &lt;code&gt;if&lt;/code&gt; because it can lead to many bugs and so why shouldn't the ternary operator be kept?  &lt;/p&gt;

&lt;p&gt;What do you think about it? Do you agree with me?&lt;/p&gt;

</description>
      <category>kotlin</category>
    </item>
    <item>
      <title>Android: Rainbow Background</title>
      <dc:creator>Angelo Moroni</dc:creator>
      <pubDate>Mon, 26 Aug 2019 14:19:06 +0000</pubDate>
      <link>https://dev.to/hooloovoochimico/android-rainbow-background-2gc0</link>
      <guid>https://dev.to/hooloovoochimico/android-rainbow-background-2gc0</guid>
      <description>&lt;p&gt;Few minutes ago, I found this wonderfull android library: Rainbow by skydoves! &lt;/p&gt;

&lt;p&gt;With this library you can apply gradations and tinting to any views like image below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TyeZM514--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zwpfaooj96kecmal2c3h.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TyeZM514--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zwpfaooj96kecmal2c3h.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find all about this library here --&amp;gt; &lt;a href="https://github.com/skydoves/Rainbow"&gt;https://github.com/skydoves/Rainbow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;let me know if you like it too. &lt;/p&gt;

&lt;p&gt;Thanks skydoves! &lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>github</category>
    </item>
  </channel>
</rss>
