The source content for blog.juliobiason.me
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
5.2 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<!-- viewport-fit=cover is to support iPhone X rounded corners and notch in landscape-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, viewport-fit=cover">
<title>Julio Biason .Me 4.3</title>
<!-- CSS -->
<link rel="stylesheet" href="https://blog.juliobiason.me/print.css" media="print">
<link rel="stylesheet" href="https://blog.juliobiason.me/poole.css">
<link rel="stylesheet" href="https://blog.juliobiason.me/hyde.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Sans:400,400italic,700|Abril+Fatface">
</head>
<body class=" ">
<div class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<a href="https:&#x2F;&#x2F;blog.juliobiason.me"><h1>Julio Biason .Me 4.3</h1></a>
<p class="lead">Old school dev living in a 2.0 dev world</p>
</div>
<ul class="sidebar-nav">
<li class="sidebar-nav-item"><a href="&#x2F;">English</a></li>
<li class="sidebar-nav-item"><a href="&#x2F;pt">Português</a></li>
<li class="sidebar-nav-item"><a href="&#x2F;tags">Tags (EN)</a></li>
<li class="sidebar-nav-item"><a href="&#x2F;pt&#x2F;tags">Tags (PT)</a></li>
</ul>
</div>
</div>
<div class="content container">
<div class="post">
<h1 class="post-title">Why Mixing Spaces and Tabs IS a Big Deal</h1>
<span class="post-date">
2016-12-15
<a href="https://blog.juliobiason.me/tags/tabs/">#tabs</a>
<a href="https://blog.juliobiason.me/tags/spaces/">#spaces</a>
<a href="https://blog.juliobiason.me/tags/clean-code/">#clean code</a>
<a href="https://blog.juliobiason.me/tags/editors/">#editors</a>
</span>
<p>Why something so small is actually a big deal.</p>
<span id="continue-reading"></span>
<p>Reading Reddit comments about <a href="https://www.reddit.com/r/programming/comments/5gc871/how_terrible_code_gets_written_by_perfectly_sane/">How terrible code gets written by perfectly
sane people</a>
when I read this comment:</p>
<blockquote>
<blockquote>
<p>spaces/tabs for indentation</p>
</blockquote>
</blockquote>
<blockquote>
<p>Is this a joke? I've been programming professionally from 2008 and I've not
yet found an actual case where this was an actual problem. The code looks
the same on everyone's screen if you set tab length in the editor to same
as the amount of spaces in your indentation. It would take seconds to fix
this :) I've never seen a tabs vs spaces argument go anywhere. It's such a
dumb thing to complain about. Maybe because I'm young I don't have
experience of bad code editors of old days but it's 2016 now. It's not a
big deal anymore.</p>
</blockquote>
<p>Unfortunately, I lost the time to properly reply to this comment, but here it
goes:</p>
<p>No, it <em>isn't</em> a joke. If you've read <a href="https://www.goodreads.com/book/show/3735293-clean-code?from_search=true">Clean Code</a>,
you'd see that, at some point, Uncle Bob mentions that there isn't an actual
experiment about it, but his team personally found that a programmer that cares about
consistency and follows coding standards are prone to write less buggy code.</p>
<p>I get what he means: If someone cares about the small stuff,
they also care about the big stuff. It doesn't mean that people that ignore
coding standards (and the difference between using tabs and using spaces)
doesn't care about the big stuff; but on my own experience in those 28
years in the field proved the opposite: people who cared about
&quot;putting the code at the door&quot; without worrying about following coding standards
(and we can add tabs vs spaces here), proper code documentation,
separation of concerns, a good level of abstraction, tend to write
horrible/unmaintable code.</p>
<p><em>This</em> is why mixed spaces/tabs is bad: it means that whoever didn't care enough
with something so small as the coding standard, probably didn't care
about the bigger stuff. Their only worry was to deliever stuff, no matter
what. &quot;And no matter what&quot; usually results in terrible code.</p>
<p>So, while not an &quot;actual problem&quot;, it is an indicator that something really
terrible is going on. So, no, it isn't a joke and yes, it is a big deal. And
it has absolutely nothing to do with &quot;bad code editors&quot;, it's a problem with
&quot;bad coders&quot;.</p>
</div>
</div>
</body>
</html>