When writing code, I find it important that my code looks good (except that it should work well). This is well described in Code Complete (p729): "Visual and intellectual enjoyment of well-formatted code is a pleasure that few non-programmers can appreciate."
The problem is that, as soon as I got my code functionally working, and I started to introduce error handling (try-except clauses, etc.) to make it reliable, I believe this will usually ruin my well-designed code and turns it into something that is definitely not visually pleasing. The try-except statements and optional if's make the code less readable and structured.
Interestingly, is this because I am abusing or abusing error handling, or is it inevitable? Any tips or tricks to keep it beautiful?
source
share