Monday, November 29, 2010

New algorithms are painful in any language.

I think this set of examples from langref.org helps to show the pain of unexpected algorithms. It's a simple case, but note that none of the examples is remarkably clearer or shorter than most of the others. Library and language niceties often help for common use cases (hashtables, sorting, matrix multiplication, ...). With time, the set of what's common grows. Most programmers don't need to write new algorithms. But if you do, you can't always expect your language or library to save you.

No comments:

Post a Comment