While often you do get rock solid code that is ugly and just works. there is nothing to say that elegant code can't solve all the problems and do it in a more readable and maintainable way. When I started transition my coding style form a imperative/OO base to a more functional base I found that you can get many elegant solutions that handle edge cases and are maintainable by designing a solution instead of growing one.