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

Doxygen and C++: <i>not</i> a marriage made in heaven

19 August, 200529 July, 2007

I briefly interrupt your scheduled browsing… Doxygen is a documentation system for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors) and to some extent PHP, C#, and D. So it says on the website, and so it is. It’s also a Good Thing, most people would assume. Doxygen…

Read More

after an hour's fiddling…

29 September, 200529 July, 2007

Got GTK+/gtkmm projects compiling under Win32. Eclipse (CDT) doesn’t really know about pkg-config. So in order to get CDT to drive the command line correctly I had to put the `pkg-config –libs gtkmm-2.4` as part of a -l directive to the linker. It doesn’t work as just a link option…

Read More

Experimenting with (cubic) Bézier subdivision

27 February, 20081 March, 2008

As you know, a Bézier curve (here meaning specifically a cubic Bézier) is often used for drawing all kinds of things in vector graphics. It has the nice property that the endpoints and control points form a bounding box, and deCasteljau’s algorithm is a nice numerically stable way of evaluating…

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