Northrop Frye said this quote

Beauty and truth may be attributes of good writing but if the writer deliberately aims at truth he is likely to find that what he has hit is the didactic.