{"id":198,"date":"2019-05-17T19:05:42","date_gmt":"2019-05-17T19:05:42","guid":{"rendered":"http:\/\/67bricks.com\/blog\/?p=198"},"modified":"2019-05-17T19:05:42","modified_gmt":"2019-05-17T19:05:42","slug":"arrows-and-outrageous-fortune","status":"publish","type":"post","link":"https:\/\/blog.67bricks.com\/?p=198","title":{"rendered":"Arrows, and outrageous fortune"},"content":{"rendered":"<p>Tim talked about arrow functions in JavaScript, and how &#8220;this&#8221; works with arrow functions. The behaviour of &#8220;this&#8221; differs between ES6 arrow functions, and traditional ES5 and before JS functions.<\/p>\n<p>He suggested some rules of thumb:<\/p>\n<ul>\n<li>Don&#8217;t use arrow functions as methods in object literals, because they do not pick up the scope from the object literal that you might expect<\/li>\n<li>Don&#8217;t use arrow functions as methods in classes &#8211; it does work, but it&#8217;s more verbose than using the concise class method syntax<\/li>\n<li>Do use arrow functions as function parameters &#8211; e.g. arr.map(el =&gt; this.doSomething(el)) is much clearer than using bind or assigning this to another variable outside the method<\/li>\n<li>Be careful using &#8220;this&#8221; with an arrow function if you&#8217;re using JQuery &#8211; because JQuery reassigns &#8220;this&#8221;<\/li>\n<li>Don&#8217;t use them in lifecycle functions in Vue &#8211; Vue reassigns &#8220;this&#8221; instead<\/li>\n<\/ul>\n<p>We also talked about lambdas in TypeScript and in other languages.<\/p>\n<p>Then, Ed talked about the past and future of programming, based on a talk he&#8217;d recently attended by Uncle Bob. He talked about the history of programming, using mercury delay lines for memory, and how the profile of what a &#8220;programmer&#8221; is has changed over time. Half of programmers have less than five years experience &#8211; so passing information on is harder than it used to be, and understanding the importance of disciplines such as TDD is less common. Uncle Bob thinks that a combination of lack of experience, and that programmers are managing increasingly important systems, means that there will be a disaster created by poor software in the near future. Uncle Bob suggests that more attention towards craftsmanship will help prevent this &#8211; the alternative being greater regulation of programmers.<\/p>\n<p>We expressed many strong opinions on these topics.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tim talked about arrow functions in JavaScript, and how &#8220;this&#8221; works with arrow functions. The behaviour of &#8220;this&#8221; differs between ES6 arrow functions, and traditional ES5 and before JS functions. He suggested some rules of thumb: Don&#8217;t use arrow functions as methods in object literals, because they do not pick up the scope from the &hellip; <a href=\"https:\/\/blog.67bricks.com\/?p=198\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Arrows, and outrageous fortune&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":1,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}