04
Aug 05

Musings on single-point-of-return functions

Cedric Beust muses on single-point-of-return functions.
I’m firmly in the single-point-of-return-function camp:
public int dilbert() {
  int result = 0;
  if (...) {
    result = 1;
  }
  return result;
}

It eliminates an else statement – and I strongly dislike them. Plus I’m dead sure that the return value is initialized at least once with a reasonable return value.
However, as long as the function in question is short, using multiple returns is just fine with me. Of course, it may happen that, while looking at the code, I’ll refactor it to a single-point-of-return function. Just because my sub-consciousness makes me do it ­čÖé


04
Aug 05

Design Patterns

Ned Batchelder has some very profound thoughts on Design Patterns as units of computation.


01
Aug 05

Yak shaving

Of course, I’m the very last one to get it, but it looks like yak shaving is a really useful phrase. Seth Godin explain the concept in great detail.