{"id":2440,"date":"2015-12-22T12:08:29","date_gmt":"2015-12-22T12:08:29","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=2440"},"modified":"2015-12-22T12:25:31","modified_gmt":"2015-12-22T12:25:31","slug":"57th-sqldev-user-group-meeting","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/miscellaneou\/57th-sqldev-user-group-meeting\/","title":{"rendered":"57th SQL\/DEV user group meeting about refactoring and transpilers"},"content":{"rendered":"<p>I attended our local Microsoft community user group meeting which was about refactoring and transpilers. It&#8217;s full proper title (on Croatian) was <em>57. sastanak SQL\/DEV UG \u010cakovec-Vara\u017edin.<\/em><\/p>\n<p>This was 57th meeting in a row, and the presenter <a href=\"http:\/\/www.mscommunity.hr\/profile\/nikola-begedin\/3836\">Nikola Begedin<\/a> had two awesome topics (with few notes I took):<\/p>\n<h4>Principi i konvencije u refaktoriranju koda (Principles and conventions in code refactoring)<\/h4>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_1.jpg\" rel=\"lightbox[2440]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2441\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_1.jpg\" alt=\"57devug_1\" width=\"600\" height=\"458\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_1.jpg 600w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_1-300x229.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>There are typical problems in every code with typical fixes for each of these problems. So, it&#8217;s useful to know them in order to be able to detect them early in the code and fix them before they introduce <a href=\"https:\/\/en.wikipedia.org\/wiki\/Technical_debt\">technical debt<\/a>.<\/p>\n<p>Few of the principles:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.refactoring.com\/catalog\/replaceTempWithQuery.html\">extract temp to query<\/a><\/li>\n<li><a href=\"http:\/\/martinfowler.com\/bliki\/TellDontAsk.html\">tell, don&#8217;t ask<\/a><\/li>\n<li><a href=\"http:\/\/martinfowler.com\/bliki\/DataClump.html\">data clump<\/a><\/li>\n<li><a href=\"http:\/\/rickyclarkson.blogspot.hr\/2007\/03\/refactoring-or-decoupling-which-one-do.html\">decoupling<\/a><\/li>\n<\/ul>\n<p>You should look to refactor<\/p>\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/God_object\">God objects<\/a><\/li>\n<li>high churn code<\/li>\n<li>bugs &#8211; &#8220;bugs like company&#8221;. If a bug appeared at the same function, then refactor it because it&#8217;s obviously too cumbersome and the bug will inevitably manifest itself again<\/li>\n<\/ul>\n<p>Few of the recommended books:<\/p>\n<ul>\n<li><a href=\"http:\/\/amzn.to\/1mfvZLC\">Clean Code: A Handbook of Agile Software Craftsmanship<\/a><\/li>\n<li><a href=\"http:\/\/amzn.to\/1QI0NSy\">Refactoring: Improving the Design of Existing Code<\/a><\/li>\n<li><a href=\"http:\/\/amzn.to\/1mfw7Lb\">Growing Object-Oriented Software, Guided by Tests<\/a><\/li>\n<\/ul>\n<h4>Kori\u0161tenje transpilera (using transpilers)<\/h4>\n<p><a href=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_2.jpg\" rel=\"lightbox[2440]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2442\" src=\"http:\/\/www.nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_2.jpg\" alt=\"57devug_2\" width=\"600\" height=\"461\" srcset=\"https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_2.jpg 600w, https:\/\/nikola-breznjak.com\/blog\/wp-content\/uploads\/2015\/12\/57devug_2-300x231.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Transpiler is a source to source compiler. What that means is that it&#8217;s basically a tool which translates from one language to another.<\/p>\n<p>Transpilers allow us to write modern JavaScript code, to work with modules, use advanced language features (await, async, arrow functions, &#8230;), etc.<\/p>\n<p>Some options that we have today are:<\/p>\n<ul>\n<li><a href=\"https:\/\/babeljs.io\/\">Babel<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/google\/traceur-compiler\">Google Traceur<\/a><\/li>\n<li><a href=\"http:\/\/browserify.org\/\">Browserify<\/a><\/li>\n<li><a href=\"http:\/\/requirejs.org\/\">RequireJS<\/a><\/li>\n<\/ul>\n<p>Visual studio 2015 supports Gulp task running via Task Runner Explorer.<\/p>\n<blockquote><p><strong>The point is that we don&#8217;t need these but since sooner or later more and more browsers will support these functions and you can use them already today, I don&#8217;t see any reason why not to use all the benefits that they offer.<\/strong><\/p>\n<p>https:\/\/twitter.com\/HitmanHR\/status\/679276361492598784<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I attended our local Microsoft community user group meeting which was about refactoring and transpilers. It&#8217;s full proper title (on Croatian) was 57. sastanak SQL\/DEV UG \u010cakovec-Vara\u017edin. This&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2443,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[47],"class_list":["post-2440","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneou","tag-conferences"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=2440"}],"version-history":[{"count":4,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2440\/revisions"}],"predecessor-version":[{"id":2447,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2440\/revisions\/2447"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/2443"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=2440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=2440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=2440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}