Some problem spaces have boundaries and exceptions. These can be somewhat ameliorated by better representations ... but sometimes (e.g. device driver apis, or context switching code that works on multiple processor families, or (heaven forfend) business logic) ugly is ugly and you can't do much about it. It can't all be elegant global illumination solutions...