Hi, I'm Samuel Cochran

on Twitter, Facebook, Google, LinkedIn, GitHub, Stack Overflow, and Steam.

Whitespace Wars

This   is        why
I      really    don't
like   lining    up
source code      like

Write it naturally. Don't
insert whitespace for no
good reason -- it just
reduces legibility.
diff --git a/a.rb b/b.rb
index 560e580..1cdad3a 100644
--- a/a.rb
+++ b/b.rb
@@ -1,3 +1,4 @@
 module Here
+  IS      = ANOTHER

I find it much easier to read/write code laid out like the normal text I read—no weird whitespace to line things up, just flowing text. This makes sense—my brain is already trained to comprehend the roman alphabet depicted in sentence and paragraphs with varying whitespace, etc. Skimming paragraphs is natural, and translates to skimming methods, grouped declarations, and the like.

I'd really like to see some studies on code comprehension relating to coding style. After looking quickly, nothing springs out. Death to the Space Infidels! makes reference to a couple of paywalled articles.