<story><title>38% of bugs at Airbnb could have been prevented by using types</title><url>https://www.reddit.com/r/typescript/comments/aofcik/38_of_bugs_at_airbnb_could_have_been_prevented_by/</url></story><parent_chain><item><author>hardwaresofton</author><text>Relatively recently I&amp;#x27;ve adopted the stance that JS (via V8+NodeJS) has the best feature set of the &amp;quot;scripting language&amp;quot; tier of interpreted programming languages, assuming ecosystems for your problem are comparable. The combination of compile time type-checking support (via Typescript), parallelism support (recently in v11 w&amp;#x2F; worker threads), and built in async IO paradigms give Node a huge leg up over ruby, python, and perl.&lt;p&gt;Weirdly enough, JS is the best in my opinion precisely because it does so much to &lt;i&gt;not&lt;/i&gt; be itself. The crazy iteration speed of the JS ecosystem means that people have done crazy things, but the good stuff has remained. Python relatively recently added typing[0], and Matz has mentioned that ruby has no plans to include types in the language proper (though people are working on it). Perl might be the closest in terms of features since it has thread support but...&lt;p&gt;If you enjoyed this hot take, here are a few others you might enjoy:&lt;p&gt;- &amp;quot;extensive&amp;quot; unit testing is a poor man&amp;#x27;s type checker&lt;p&gt;- developers that don&amp;#x27;t think specifying types is helpful are still early in their careers (those who suffered in the dungeons of Java get some slack)&lt;p&gt;[0]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.python.org&amp;#x2F;3&amp;#x2F;library&amp;#x2F;typing.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.python.org&amp;#x2F;3&amp;#x2F;library&amp;#x2F;typing.html&lt;/a&gt;</text></item></parent_chain><comment><author>sametmax</author><text>I believe the most amazing feature of JS is the ability to make their devs think they got it all figured  out.&lt;p&gt;&amp;gt; Python relatively recently added typing[0]&lt;p&gt;The typescript compiler and the mypy type checker both appeared in 2012.&lt;p&gt;Function annotations have also been officially part of the Python syntax since 2006, although they could be used for more than typing.&lt;p&gt;Browsers still do not support the typescript syntax as of today, you need a transpiler.&lt;p&gt;&amp;gt; parallelism support (recently in v11 w&amp;#x2F; worker threads), and built in async IO paradigms give Node a huge leg up over ruby, python, and perl.&lt;p&gt;Python has supported non blocking processing as far as 21 years ago with threads. It&amp;#x27;s actually the language of choice for pentesting a networks because it&amp;#x27;s so easy to implement a custom service scan.&lt;p&gt;Python then, in 2002, saw the rise of Twisted for pure asynchronous I&amp;#x2F;O + callbacks, as it was for JS and AJAX at the time. Ansyncio came way later, yet Python implemented async&amp;#x2F;await and yield before it was part of JS.&lt;p&gt;Python implemented multiprocessing as well, which allows to leverage multiple cores, more than 10 years ago. I remember that producing the equivalent result ishard to use accross all major browsers, and nodejs, consistently. The Python multiprocessing pool has even not changed API when we migrated from Python 2 to 3 and works with both (I just tried it to be sure).&lt;p&gt;&amp;gt; Weirdly enough, JS is the best in my opinion precisely because it does so much to not be itself.&lt;p&gt;I think you should try to put in production 4 or 5 other languages before stating such a strong opinion. Your post feels more like over enthousiasm due to lack of experience than a real analysis of the state of dynamic programming languages.&lt;p&gt;There are strong qualities to Perl, PHP, Python and Ruby. The fact they are so popular without having an accidental absolute monopoly on the most extraordinary plateform of the world (the Web) should at least give you a hint of that.</text></comment>
<story><title>38% of bugs at Airbnb could have been prevented by using types</title><url>https://www.reddit.com/r/typescript/comments/aofcik/38_of_bugs_at_airbnb_could_have_been_prevented_by/</url></story><parent_chain><item><author>hardwaresofton</author><text>Relatively recently I&amp;#x27;ve adopted the stance that JS (via V8+NodeJS) has the best feature set of the &amp;quot;scripting language&amp;quot; tier of interpreted programming languages, assuming ecosystems for your problem are comparable. The combination of compile time type-checking support (via Typescript), parallelism support (recently in v11 w&amp;#x2F; worker threads), and built in async IO paradigms give Node a huge leg up over ruby, python, and perl.&lt;p&gt;Weirdly enough, JS is the best in my opinion precisely because it does so much to &lt;i&gt;not&lt;/i&gt; be itself. The crazy iteration speed of the JS ecosystem means that people have done crazy things, but the good stuff has remained. Python relatively recently added typing[0], and Matz has mentioned that ruby has no plans to include types in the language proper (though people are working on it). Perl might be the closest in terms of features since it has thread support but...&lt;p&gt;If you enjoyed this hot take, here are a few others you might enjoy:&lt;p&gt;- &amp;quot;extensive&amp;quot; unit testing is a poor man&amp;#x27;s type checker&lt;p&gt;- developers that don&amp;#x27;t think specifying types is helpful are still early in their careers (those who suffered in the dungeons of Java get some slack)&lt;p&gt;[0]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.python.org&amp;#x2F;3&amp;#x2F;library&amp;#x2F;typing.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.python.org&amp;#x2F;3&amp;#x2F;library&amp;#x2F;typing.html&lt;/a&gt;</text></item></parent_chain><comment><author>wutbrodo</author><text>&amp;gt; developers that don&amp;#x27;t think specifying types is helpful are still early in their careers (those who suffered in the dungeons of Java get some slack)&lt;p&gt;I&amp;#x27;m not high-confidence about this heuristic because 1) the &amp;quot;class label&amp;quot; is a bit subjective and 2) I don&amp;#x27;t have a massive sample size, but attitudes toward typing is one of the best filters for engineer quality I&amp;#x27;ve come across.&lt;p&gt;(No, I haven&amp;#x27;t put this in practice in interviews, and I don&amp;#x27;t ask any related question. It&amp;#x27;s just a correlation whose strength I&amp;#x27;ve found really striking)&lt;p&gt;It&amp;#x27;s part of a broader class of heuristic I&amp;#x27;ve been noticing recently (again, still a very preliminary, low-confidence model):  things like &amp;quot;lack of reliable, quality devtools&amp;quot; and &amp;quot;inability to customize interfaces&amp;quot; bother highly-productive engineers more than less-productive ones, which is what you&amp;#x27;d expect given that inefficient interfaces to their work has a far greater cost to the former. Along these same lines, if (eg) you&amp;#x27;re already pretty bad at understanding complex systems by reading code, you&amp;#x27;re much less likely to notice or care about how much more difficult dynamic typing makes this.&lt;p&gt;I should be clear:  this isn&amp;#x27;t a general-purpose argument against dynamic typing, and I&amp;#x27;m not suggesting that the situation is as simple as &amp;quot;dynamic typing bad, static good&amp;quot;. They both have their strengths and weaknesses, which make each appropriate for different situations; I ended up picking Python for a company whose tech org I was responsible for building, and as much as I personally find engineering in Python to be horribly unpleasant, it was the right choice for the company given the environment it was in, and I would make the same choice in the same situation.&lt;p&gt;I don&amp;#x27;t think my theory above is particularly novel, and I understand the self-serving bias that it aligns with, which is part of why it&amp;#x27;s still such a low-confidence model. But I&amp;#x27;ve been unable to wrap my head around the number of nonsensical defenses of dynamic typing I&amp;#x27;ve seen over the last few years, and this model is the first to offer an explanation: if you can&amp;#x27;t tap into the benefits of static typing, of course the accessibility and flexibility of dynamic typing is going to seem like it far outweighs the foofy, theoretical benefits that static typing brings to stability and comprehensibility.</text></comment>