<story><title>Reverse Engineering One Line of JavaScript</title><url>https://www.alexkras.com/reverse-engineering-one-line-of-javascript/</url></story><parent_chain><item><author>cyberferret</author><text>Nice.  But it does highlight a trend in modern programming languages such as Ruby etc. where these one line shorthand methods are used to such an extent these days that new programmers to the project have to spend an inordinate amount of time reverse engineering some of these shortcuts to make sense of program flow and understand the program in their heads.&lt;p&gt;Take the simple, quick initialiser:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    foo ||= 1
&lt;/code&gt;&lt;/pre&gt;
Instead of the more verbose&lt;p&gt;&lt;pre&gt;&lt;code&gt;    if foo.nil?
      foo = 1
    end
&lt;/code&gt;&lt;/pre&gt;
Undoubtedly, the first line is a much cooler version, but like skinny jeans was once cool - getting in and out of them far outweighed the cool factor.</text></item></parent_chain><comment><author>skrebbel</author><text>This doesn&amp;#x27;t highlight that trend. Writing a 128 byte demo is an art, and done for fun. This isn&amp;#x27;t conciseness out of laziness or coolness, it&amp;#x27;s a challenge in its own right. I think you vastly underappreciate how hard it is to put cool visuals in so little space. It doesn&amp;#x27;t really have much to do with ordinary programming.&lt;p&gt;It&amp;#x27;s like saying F1 racing is cool but it does highlight a trend of reckless driving in highways.</text></comment>
<story><title>Reverse Engineering One Line of JavaScript</title><url>https://www.alexkras.com/reverse-engineering-one-line-of-javascript/</url></story><parent_chain><item><author>cyberferret</author><text>Nice.  But it does highlight a trend in modern programming languages such as Ruby etc. where these one line shorthand methods are used to such an extent these days that new programmers to the project have to spend an inordinate amount of time reverse engineering some of these shortcuts to make sense of program flow and understand the program in their heads.&lt;p&gt;Take the simple, quick initialiser:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    foo ||= 1
&lt;/code&gt;&lt;/pre&gt;
Instead of the more verbose&lt;p&gt;&lt;pre&gt;&lt;code&gt;    if foo.nil?
      foo = 1
    end
&lt;/code&gt;&lt;/pre&gt;
Undoubtedly, the first line is a much cooler version, but like skinny jeans was once cool - getting in and out of them far outweighed the cool factor.</text></item></parent_chain><comment><author>icebraining</author><text>I don&amp;#x27;t think they are just &amp;quot;cool&amp;quot;, they&amp;#x27;re also useful, much like writing &amp;quot;inordinate&amp;quot; is useful, despite being a relatively uncommon word.&lt;p&gt;This is different from huge one-liners, which I think are almost always inappropriate.</text></comment>