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

10 Non-C++ Book Recommendations for C++ Programmers

19 January, 2018

So you’ve learned enough C++ to function. You’ve read a bunch of the usual recommendations: Meyers, Stroustrup, maybe even Alexandrescu and Stepanov. You know enough to recommend Lippman et al. to newbies rather than the other “C++ Primer.” The internet has lots of C++-related book recommendations to make — for…

Read More

The Camel Has Two Humps

6 June, 200729 July, 2007

I’ve just been reading an interesting paper on teaching programming. First, the data regarding rates of attrition on computing courses is startling. Between 30% and 60% of the total CS intake fails the very first programming course! The paper’s authors postulate 3 programming hurdles to be negotiated: sequencing and assignment…

Read More

Exercising Ranges (part 8)

1 July, 20152 July, 2015

(Start at the beginning of the series if you want more context.) Extras from the Haskell Prelude Having implemented iterate, there were a couple of other useful things from the Haskell Prelude that I wanted to have available with ranges. First, there’s cycle. It simply takes a finite range and…

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