{"id":860,"date":"2019-12-04T00:00:00","date_gmt":"2019-12-03T23:00:00","guid":{"rendered":"http:\/\/cmagazine.test\/tabs-or-spaces-does-it-really-matter-anymore\/"},"modified":"2020-01-31T11:44:39","modified_gmt":"2020-01-31T10:44:39","slug":"tabs-or-spaces-does-it-really-matter-anymore","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/","title":{"rendered":"Tabs or spaces: does it really matter anymore?"},"content":{"rendered":"<p>Tabs or spaces is the epical battle that any <span id=\"urn:batch-analysis-5e9087da-5b5e-4f7c-b0e1-2a77ab816f88\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/programmer\">programmer<\/span> has to assist at least once in his life. It&#8217;s a styling choice for a <span id=\"urn:batch-analysis-586dc5a7-7495-4aef-b658-e942a81427e1\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/programmer\">programmer<\/span>, but it gets really serious when at least two programmers gets to collaborate in a <span id=\"urn:batch-analysis-31817b53-aa97-4a6a-bb47-7577a75e34c3\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/project\">project<\/span>.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1177\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image1.gif\" alt=\"\" width=\"480\" height=\"268\" \/><\/center>What&#8217;s the deal with that? Why is such stylistic choice so important? Technically they are different, being tabs more convenient for portability &#8211; but in the real world it doesn&#8217;t really matter.<\/p>\n<p>As long as it is a solo programming it&#8217;s no big deal&#8230; until somebody sends that pull request where all spaces are replaced with tabs. And here people start to argue, asking to restore the previous style back.<\/p>\n<p>The good news is, there&#8217;s a solution to this: <b>automatic code formatters<\/b>.<\/p>\n<p>Tabs and spaces are only the tip of the iceberg, what about semi colons? In some languages they are mandatory, but in languages like <span id=\"urn:batch-analysis-4dbc723a-b8ba-45b0-949a-00aa8d80a030\" class=\"textannotation disambiguated wl-no-link wl-creative work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/javascript\">Javascript<\/span> they are <a href=\"https:\/\/github.com\/standard\/standard\/issues\/78\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">kind-a optional<\/a>. And what about other hundred rules\/conventions?<\/p>\n<p>But linters are already doing some code formatting, why can\u2019t they be the only tool to do that?<\/p>\n<p>Before answering such important question, we need to step back a little <span id=\"urn:batch-analysis-9d5394b8-8456-4b29-bed8-de58f64a98f4\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/bit\">bit<\/span> to <b>trees<\/b>, in order to build the foundations for the answer.<\/p>\n<h2>Trees<\/h2>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1179\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image5.jpg\" alt=\"\" width=\"970\" height=\"647\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image5.jpg 970w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image5-300x200.jpg 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image5-768x512.jpg 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image5-600x400.jpg 600w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/center>Code is just a sequence of words in a text file, so what&#8217;s this story about trees? Compilers, type checkers, linters and any tool that interact with code, create an intermediate data structure named <b>AST<\/b> (Abstract Syntax Tree) which abstracts any stylistic choices to focus only on content.<\/p>\n<p>The AST is a tree representation of the code, used to navigate and reason about it in a performant and structured way. Having a structure to reason about the code enable tools to perform analysis on the code itself and even manipulate the content to provide a similar but more &#8220;efficient way&#8221; to reach the same goal.<\/p>\n<p>If you want to dig more in the concept and understand how your code is effectively translated to the AST structure I can recommend the <a href=\"https:\/\/astexplorer.net\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">AST explorer tool<\/a> to visually explore the AST structure of the code live.<\/p>\n<p>Because of the convenience in reasoning with the AST data structure, many tools as linters, compilers, auto formatters use it to perform efficiently analysis on code.<br \/>\nIf both linters and code formatters work with AST, what\u2019s the difference between the two?<\/p>\n<h2>Why a code formatter and not a linter?<\/h2>\n<p>The technical reason a code formatting tool does a better <span id=\"urn:batch-analysis-12e565dc-32e9-49ad-8eb1-5cbc9a25f0c4\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/job\">job<\/span> than a linter to do styling-based tasks is based on how the two tools make use of AST.<\/p>\n<p>The way a linter works is a <span id=\"urn:batch-analysis-2497f171-d9ba-4302-b839-39b102dddafc\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/bit\">bit<\/span> more complicated as it has to check many metrics (such styling or quality) of your code, therefore it has to collect all the conflicts in the AST while traversing it, then trying to solve it in a ordered way:<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1180\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image3.png\" alt=\"\" width=\"657\" height=\"341\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image3.png 657w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image3-300x156.png 300w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/center>But what happens if there are overlapping conflicts &#8211; for instance a wrong variable and a mixed tab\/space indentation in the same line? Well, in this case the first rule found in order is fixed and the rest of the conflicts are left unresolved. A new run may solve it, but many more errors may end up in the same area requiring many runs of the tool before solving them all.<\/p>\n<p>The way a code formatter works with the AST is pretty simple compared:<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1181\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image4.png\" alt=\"\" width=\"435\" height=\"293\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image4.png 435w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image4-300x202.png 300w\" sizes=\"auto, (max-width: 435px) 100vw, 435px\" \/><\/center>It reads the code and simply print it in the configured way. The actual format\/styling is completing ignored as the pure content is used to print the final output.<\/p>\n<p>Eventually it can translate the AST tree in a slightly different one, but the translation is straightforward once the two AST definitions are documented:<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1182\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image2-1024x530.png\" alt=\"\" width=\"1024\" height=\"530\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image2-1024x530.png 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image2-300x155.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image2-768x397.png 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/image2.png 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/center><\/p>\n<h2>Then tabs or spaces?<\/h2>\n<p>Well written code is consistent, and the best way to do so is having a tool that does the work for us. Configuring the linter and the automatic formatter tool that ensures that no matter what&#8217;s the style adopted it is always consistent with the company policy &#8211; or just yours.<\/p>\n<p>But is there a tool to solve such problem? The answer is yes, there is: <a href=\"https:\/\/prettier.io\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Prettier<\/a>. Prettier is a tool that can be combined with your linter to automatically format your code with your styling conventions: configure how the code in the <span id=\"urn:batch-analysis-e788c9a4-b2fa-4d90-956c-d5785d447ae3\" class=\"textannotation disambiguated wl-no-link wl-other\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/project\">project<\/span> should be formatted and that&#8217;s it. No more discussions, just profit.<\/p>\n<p>Prettier is not the first code formatter tool out there, the idea is not original as Prettier itself was inspired by other code formatter tools &#8211; by <a href=\"https:\/\/github.com\/reasonml\/reason-cli#included-binaries\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">refmt<\/a> a ReasonML\/OCaml formatter specifically -, but the original part of Prettier is its plugin structure that abstract the language itself for the formatting.<\/p>\n<p>Compared to other language code formatting tools out there, Prettier leveraged the power of the AST in the formatting tool to provide a generic tool for any language <a href=\"https:\/\/github.com\/prettier?utf8=%E2%9C%93&amp;q=plugin&amp;type=source&amp;language=\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">via plugins<\/a>.<\/p>\n<p>It originally started for the <span id=\"urn:batch-analysis-81e16530-623c-4945-a528-e11264ce4b5b\" class=\"textannotation disambiguated wl-no-link wl-creative work\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/javascript\">Javascript<\/span> language, then extended to the JSX syntax and all other JS-targeted languages (Typescript, Coffeescript, etc..) building up a generic structure to customise parsers and configurations in a modular way: this opened the path for a universal tool for code formatting.<\/p>\n<p>If you want to try Prettier live before installing it, there&#8217;s a <a href=\"https:\/\/prettier.io\/playground\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">live playground<\/a>.<\/p>\n<p><img id=\"hzDownscaled\" style=\"position: absolute; top: -10000px;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tabs or spaces is the epical battle that any programmer has to assist at least once in his life. It&#8217;s a styling choice for a programmer, but it gets really serious when at least two programmers gets to collaborate in a project. What&#8217;s the deal with that? Why is such stylistic choice so important? Technically&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/\">Read more<\/a><\/p>\n","protected":false},"author":10,"featured_media":955,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[36],"tags":[],"collections":[],"class_list":{"0":"post-860","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-backend","8":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Tabs or spaces: does it really matter anymore? - Codemotion Magazine<\/title>\n<meta name=\"description\" content=\"Tabs or spaces is the epical battle among programmers. The good news is, theres a solution to this: automatic code formatters.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tabs or spaces: does it really matter anymore?\" \/>\n<meta property=\"og:description\" content=\"Tabs or spaces is the epical battle among programmers. The good news is, theres a solution to this: automatic code formatters.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-03T23:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-31T10:44:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Marco Liberati\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marco Liberati\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/\"},\"author\":{\"name\":\"Marco Liberati\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/35b2a685d3154030dccf48af78880509\"},\"headline\":\"Tabs or spaces: does it really matter anymore?\",\"datePublished\":\"2019-12-03T23:00:00+00:00\",\"dateModified\":\"2020-01-31T10:44:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/\"},\"wordCount\":871,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/code-3337044_1920.jpg\",\"articleSection\":[\"Backend\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/\",\"name\":\"Tabs or spaces: does it really matter anymore? - Codemotion Magazine\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/code-3337044_1920.jpg\",\"datePublished\":\"2019-12-03T23:00:00+00:00\",\"dateModified\":\"2020-01-31T10:44:39+00:00\",\"description\":\"Tabs or spaces is the epical battle among programmers. The good news is, theres a solution to this: automatic code formatters.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/code-3337044_1920.jpg\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/code-3337044_1920.jpg\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/tabs-or-spaces-does-it-really-matter-anymore\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backend\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/backend\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Tabs or spaces: does it really matter anymore?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Codemotion.Italy\\\/\",\"https:\\\/\\\/x.com\\\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/35b2a685d3154030dccf48af78880509\",\"name\":\"Marco Liberati\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5f7b8b739c7398e9a151fa3f30d1f29fb44a77c4723ece6995dd896d3ad0c90e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5f7b8b739c7398e9a151fa3f30d1f29fb44a77c4723ece6995dd896d3ad0c90e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5f7b8b739c7398e9a151fa3f30d1f29fb44a77c4723ece6995dd896d3ad0c90e?s=96&d=mm&r=g\",\"caption\":\"Marco Liberati\"},\"description\":\"I am passionate about data visualisation and the start-up enviroment. If I can write in JS I will, and it will probably be mapped into a graphDB and visualised: I like drawing pixels on the screen, better if I can do it with Javascript and ReactJS. Recently I've been exploring the GraphQL world and how it can leverage the productivity of developers for building complex apps and\\\/or data dashboards. Community fellow of the RomaJS and GraphRM.\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/author\\\/marco-liberati\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Tabs or spaces: does it really matter anymore? - Codemotion Magazine","description":"Tabs or spaces is the epical battle among programmers. The good news is, theres a solution to this: automatic code formatters.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/","og_locale":"en_US","og_type":"article","og_title":"Tabs or spaces: does it really matter anymore?","og_description":"Tabs or spaces is the epical battle among programmers. The good news is, theres a solution to this: automatic code formatters.","og_url":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2019-12-03T23:00:00+00:00","article_modified_time":"2020-01-31T10:44:39+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg","type":"image\/jpeg"}],"author":"Marco Liberati","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Marco Liberati","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/"},"author":{"name":"Marco Liberati","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/35b2a685d3154030dccf48af78880509"},"headline":"Tabs or spaces: does it really matter anymore?","datePublished":"2019-12-03T23:00:00+00:00","dateModified":"2020-01-31T10:44:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/"},"wordCount":871,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg","articleSection":["Backend"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/","url":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/","name":"Tabs or spaces: does it really matter anymore? - Codemotion Magazine","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg","datePublished":"2019-12-03T23:00:00+00:00","dateModified":"2020-01-31T10:44:39+00:00","description":"Tabs or spaces is the epical battle among programmers. The good news is, theres a solution to this: automatic code formatters.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/tabs-or-spaces-does-it-really-matter-anymore\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Backend","item":"https:\/\/www.codemotion.com\/magazine\/backend\/"},{"@type":"ListItem","position":3,"name":"Tabs or spaces: does it really matter anymore?"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/35b2a685d3154030dccf48af78880509","name":"Marco Liberati","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5f7b8b739c7398e9a151fa3f30d1f29fb44a77c4723ece6995dd896d3ad0c90e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5f7b8b739c7398e9a151fa3f30d1f29fb44a77c4723ece6995dd896d3ad0c90e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5f7b8b739c7398e9a151fa3f30d1f29fb44a77c4723ece6995dd896d3ad0c90e?s=96&d=mm&r=g","caption":"Marco Liberati"},"description":"I am passionate about data visualisation and the start-up enviroment. If I can write in JS I will, and it will probably be mapped into a graphDB and visualised: I like drawing pixels on the screen, better if I can do it with Javascript and ReactJS. Recently I've been exploring the GraphQL world and how it can leverage the productivity of developers for building complex apps and\/or data dashboards. Community fellow of the RomaJS and GraphRM.","url":"https:\/\/www.codemotion.com\/magazine\/author\/marco-liberati\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-600x600.jpg","author_info":{"display_name":"Marco Liberati","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/marco-liberati\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg",1200,675,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-768x432.jpg",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg",1200,675,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg",1200,675,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920.jpg",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/09\/code-3337044_1920-600x600.jpg",600,600,true]},"uagb_author_info":{"display_name":"Marco Liberati","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/marco-liberati\/"},"uagb_comment_info":0,"uagb_excerpt":"Tabs or spaces is the epical battle that any programmer has to assist at least once in his life. It&#8217;s a styling choice for a programmer, but it gets really serious when at least two programmers gets to collaborate in a project. What&#8217;s the deal with that? Why is such stylistic choice so important? Technically&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=860"}],"version-history":[{"count":5,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/860\/revisions"}],"predecessor-version":[{"id":3172,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/860\/revisions\/3172"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/955"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=860"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}