{"id":5015,"date":"2019-05-07T02:19:15","date_gmt":"2019-05-07T02:19:15","guid":{"rendered":"http:\/\/redmonk.com\/jgovernor\/?p=5015"},"modified":"2019-05-07T16:58:29","modified_gmt":"2019-05-07T16:58:29","slug":"typescriptexploding","status":"publish","type":"post","link":"https:\/\/redmonk.com\/jgovernor\/typescriptexploding\/","title":{"rendered":"TypeScript is Exploding, JavaScript is the Fittest"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/redmonk.com\/rstephens\/files\/2019\/03\/toptwenty-2019-01.png\" width=\"600\" height=\"450\" \/><\/p>\n<p>RedMonk publishes a regular<a href=\"https:\/\/redmonk.com\/sogrady\/2019\/03\/20\/language-rankings-1-19\/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=language-rankings-1-19\"> state of the nation<\/a> examining programming language popularity as a function of activity in Stack Overflow and GitHub. The rankings have become more useful as we have established a reasonable time frame to examine trends, and as such my colleague Rachel Stephens recently published the above chart. When I first looked at it the data point that immediately struck me was the rise of TypeScript. At a glance it looks like TypeScript is about to overtake Swift in terms of popularity. But then, the chart is actually about the position of languages relative to one another, rather than reflecting any absolute metrics. Swift remains the fastest growing programming language we&#8217;ve ever seen using our methodology\u2013it exploded in mid 2016. But new technology adoption tends to look like an s-curve, and Swift may indeed have begun to saturate its niche.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/2\/2f\/Error_Function.svg\/1920px-Error_Function.svg.png\" width=\"600\" height=\"420\" \/><\/p>\n<p>Developers were hungry for an alternative to Objective-C, and Apple provided one, but Swift has not established itself in new niches, such as server-side development. When considering Rachel&#8217;s chart I thought we should probably examine some other metrics. Using the same methodology as our overall language rankings analysis, here is a chart of growth in pull requests across public GitHub repositories, with language determined by a repository\u2019s base language.<\/p>\n<p><a href=\"http:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5016\" src=\"http:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin.png\" alt=\"\" width=\"600\" height=\"600\" srcset=\"https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin.png 1000w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin-150x150.png 150w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin-300x300.png 300w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin-768x768.png 768w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin-480x480.png 480w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/swift_typescript_kotlin-627x627.png 627w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Pull requests are an indirect measure of community activity and as such this chart is quite something. It\u2019s also notable that the TypeScript growth looks like it\u2019s a cumulative graph, when in fact that\u2019s just growth in annual numbers.<\/p>\n<p>GitHub Stars are an indicator of developer interest, and it is interesting to triangulate trends over time. The majority of the interest in Swift came immediately following Apple\u2019s initial launch. Similarly, Kotlin saw a spike in interest when Google added it as a first-class supported language for Android. TypeScript on the other is less spiky and possibly more sustained in that it&#8217;s not correlated with major vendor launches.<\/p>\n<p><a href=\"http:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-5018\" src=\"http:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars.png\" alt=\"\" width=\"597\" height=\"597\" srcset=\"https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars.png 1000w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars-150x150.png 150w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars-300x300.png 300w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars-768x768.png 768w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars-480x480.png 480w, https:\/\/redmonk.com\/jgovernor\/files\/2019\/05\/stars-627x627.png 627w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a><\/p>\n<p>So what is driving TypeScript growth? One high level answer is that more strongly typed languages &#8211; in which you need to define the type of information in a variable up front &#8211; are having a renaissance. Rust, for example, has gained a passionate following in the systems programming space &#8211; you can now get jobs writing Rust with folks including Cloudflare, Fastly and PingCAP. (And for the inevitable questions about why Rust is not included in the Top 20 Languages chart: it\u2019s currently sitting at #23.)<\/p>\n<p>JavaScript is a weakly typed language &#8211; you don&#8217;t need to specify the type in a variable. TypeScript though is a superset of JavaScript, with optional static types which then compiles to plain JavaScript.<\/p>\n<p>What are the advantages of typing? Some good examples are found in one of the drivers of the TypeScript growth &#8211; the Angular framework. It turns out static typing is valuable when you&#8217;re building and maintaining a framework. This post by Viktor Savkin \u2013<a href=\"https:\/\/vsavkin.com\/writing-angular-2-in-typescript-1fa77c78d8e8\"> Angular: Why TypeScript<\/a> \u2013 is an excellent read. Stronger typing is particularly valuable in refactoring &#8211; because it makes interface boundaries explicit. This driver, combined with TypeScript&#8217;s focus on being tool-friendly, makes it an excellent choice for a large project. Savkin also emphasizes that TypeScript is still extremely flexible in that &#8211; you can write untyped JavaScript where appropriate and mix and match the two.<\/p>\n<p style=\"padding-left: 40px;\">&#8220;TypeScript takes 95% of the usefulness of a good statically-typed language and brings it to the JavaScript ecosystem. You still feel like you write ES6: you keep using the same standard library, same third-party libraries, same idioms, and many of the same tools (e.g., Chrome dev tools). It gives you a lot without forcing you out of the JavaScript ecosystem.&#8221;<\/p>\n<p>Savkin&#8217;s point on tool support is particularly telling because one of the most well known pieces of software written in JavaScript and TypeScript is the much loved Visual Studio Code, which has become the code editor of choice for many language communities including JavaScript and Go. According to npm&#8217;s<a href=\"https:\/\/medium.com\/npm-inc\/this-year-in-javascript-2018-in-review-and-npms-predictions-for-2019-3a3d7e5298ef\"> annual survey<\/a> for 2018 46% of JavaScript developers now write some TypeScript. By npm&#8217;s most recent survey numbers a &#8220;whopping&#8221;<a href=\"https:\/\/www.businesswire.com\/news\/home\/20190423005225\/en\/npm-Survey-What%E2%80%99s-New-JavaScript-2019\"> 61% of all JavaScript developers report using TypeScript<\/a>.<\/p>\n<p>ZDNet recently wrote a post asking<a href=\"https:\/\/www.zdnet.com\/article\/could-typescript-replace-javascript-use-of-programming-language-spin-off-soars-me-thats-go\/\"> Could TypeScript replace JavaScript<\/a>. The framing feels a little awkward, given TypeScript essentially is JavaScript, but there is no doubt that developers with JavaScript skills looking for some type safety in their code are gravitating towards TypeScript.<\/p>\n<p>From a Darwinian perspective it is precisely the ability of JavaScript to adopt to new niches as it evolves that makes its growth so sustainable. \u00a0It is indeed the &#8220;fittest&#8221; language for a number of niches.<\/p>\n<p>Another notable space where TypeScript has found a home for itself is in configuration as code tools. Both Atomist and Pulumi make extensive use of the language. Atomist founder Rod Johnson knows a bit about abstraction and productivity, being the creator of the Spring Framework, and he decided to standardise on TypeScript at Atomist for building automation tools, what he calls a <a href=\"https:\/\/atomist.com\/developer.html\">Software Delivery Machine<\/a>. In a<a href=\"https:\/\/thenewstack.io\/spring-rod-johnson-enterprise-java\/\"> New Stack interview<\/a> he argues:<\/p>\n<p style=\"padding-left: 40px;\">&#8220;I think TypeScript is probably the most important language right now, because if you think about languages, you could think about a language that\u2019s ideal and wonderful and makes something like 50 times better, but if it isn\u2019t easy to adopt there\u2019s no point. You can think about a language that\u2019s incredibly easy to adopt and makes everything twice as good. The former is Haskell, the latter is TypeScript.<\/p>\n<p style=\"padding-left: 40px;\">TypeScript makes JavaScript twice as good, and that\u2019s a conservative estimate. It takes an astonishing amount of things you need to do and means you\u2019re going to be significantly more successful. In terms of impact, TypeScript is the most important thing right now possibly.&#8221;<\/p>\n<p>The idea that TypeScript could find converts from the legions of Java developers out there is interesting. William Saar, who has been writing Java since 1996 asks <a href=\"https:\/\/medium.com\/@saarw\/is-typescript-the-only-language-your-company-needs-9f1fb11925b4\">Is TypeScript the only language your company\u00a0needs<\/a>? One point I really like in his analysis is that frameworks such as <a href=\"https:\/\/typeorm.io\/\">TypeORM<\/a>\u00a0and\u00a0<a href=\"https:\/\/nestjs.com\/\">NestJS<\/a> were written with types in mind and provide constructs such as dependency-injection that are familiar to developers with experience from Java frameworks like Spring and Hibernate. Frameworks of course <a href=\"https:\/\/redmonk.com\/sogrady\/2011\/04\/27\/frameworks-lead-adoption\/\">drive language adoption<\/a>.<\/p>\n<p>Some thoughts on Microsoft given it&#8217;s the company&#8217;s Build 2019 conference this week.<\/p>\n<p>While it&#8217;s currently fashionable to talk about opportunities that Microsoft has missed, there are some things it&#8217;s never lost sight of &#8211; namely the important of developer productivity. Visual Studio Code has won converts in multiple languages &#8211; even more impressive because code editors are one of the things software developers are least pragmatic about. Code offers excellent, &#8220;just works&#8221;, support for TypeScript. Developers love Code, they love TypeScript, and they love GitHub. These are all excellent platforms in their own right. Together that&#8217;s an amazing, rich set of services to build momentum on.<\/p>\n<p>JavaScript continues to fill new niches, and in a world of engineering &#8211; that is where tradeoffs are appropriate &#8211; TypeScript is exploding.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Disclosure: Microsoft is a client. Atomist is also a client.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RedMonk publishes a regular state of the nation examining programming language popularity as a function of activity in Stack Overflow and GitHub. The rankings have become more useful as we have established a reasonable time frame to examine trends, and as such my colleague Rachel Stephens recently published the above chart. When I first looked<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"class_list":["post-5015","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9wfjh-1iT","_links":{"self":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts\/5015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/comments?post=5015"}],"version-history":[{"count":0,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts\/5015\/revisions"}],"wp:attachment":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/media?parent=5015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/categories?post=5015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/tags?post=5015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}