On Wednesday, 30 April 2014 at 11:20:40 UTC, Ola Fosheim Grøstad
wrote:
On Wednesday, 30 April 2014 at 11:13:46 UTC, John Colvin wrote:
walkLength is a really good name. Clear, concise, to the
point. It's not often that you can make such a short name that
explains the behaviour so well.
Actually it isn't a good abstraction as it exposes
implementation internals.
The name should indicate what you get (the calculating of a
result), not how the framework obtains it (sequential scan).
"walk" indicates that you can use a visitor-pattern, thus it is
a misleading name.
(Not that it matters.)
For algorithms execution complexity is not a mere implementation
detail. "walk' implies exactly that it is O(n) as opposed to O(1)
of built-in length properties. It is a wise approach.