Skip to content
Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Why is a raven like a writing desk?

Thoughts both confusing and enlightening.

Holy Wars

elbeno, 26 January, 201526 January, 2015

All right, I have some opinions. Here are the definitive answers to the three most important dilemmas facing programmers today 🙂

* Static typing vs Dynamic typing

Static typing. I suppose dynamic types are OK if you’re hacking together a small tool. But static (strong, preferably HM-inferred) typing allows you to reason about your program much more powerfully. Correctness by construction, enforced by the compiler, is a wonderful thing. I used to write a lot of unit tests; now I write many fewer, and instead I write my code closer to the ideal of “if it compiles, it runs correctly”.

* Spaces vs Tabs

Spaces. The traditional argument for tabs is that they let everyone see the file the way they want. Except, in today’s world of reviewing code on the web, they don’t. People don’t get to control all the ways they see a file (eg look at github diffs).

So spaces are the only way to provide consistent, aligned code. File size isn’t a consideration: one texture can dwarf all the source code a single programmer produces in a year. Number of keystrokes or ease of cursor motion isn’t a consideration: use a real editor, please. (Hint: hitting the tab key shouldn’t insert a tab character.) Which brings me nicely to…

* Emacs vs Vi(m)

Emacs. Now don’t get me wrong; vi is a great editor. But emacs isn’t an editor, it’s a lisp OS. As such, it’s a great everything (including a great environment in which to implement vi). That said, both are light years ahead of anything else. What do you mean, your editor can’t delete trailing whitespace/edit files over ssh/show ‘git blame’ inline/do <other thing that emacs & vi have done for decades>?

Also, org-mode. My case rests.

—

In case anyone think this is a serious rant, I do actually work without complaint (mostly) in code that uses tabs, and even sometimes in dynamic languages. So it’s not too serious. Except for the emacs/vi vs everything else part 🙂

Programming

Post navigation

Previous post
Next post

Related Posts

“Smart and Gets Things Done”?

29 January, 200828 February, 2008

I work for a big games company as a senior programmer, and I’m a regular on the interview loop. While I’d love to hire candidates who are smart and get things done, the reality of the situation is that more often than not I also have to hire candidates with…

Read More

Exercising Ranges (part 5)

1 July, 20151 July, 2015

(Start at the beginning of the series if you want more context.) Generalising iota To pretty-print a reversible polynomial, we need to provide for reversibility of iota. So what is iota? It makes a range by repeatedly incrementing a value. What if instead of increment, we use an arbitrary function?…

Read More

Exercising Ranges (part 6)

1 July, 20151 July, 2015

(Start at the beginning of the series if you want more context.) Multiplying power series Now we come to something that took considerable thought: how to multiply ranges. Doug McIlroy’s Haskell version of range multiplication is succinct, lazily evaluated and recursive. (f:ft) * gs@(g:gt) = f*g : ft*gs + series(f)*gt…

Read More
©2026 Why is a raven like a writing desk? | WordPress Theme by SuperbThemes