Exceptional coding style
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Jan 17 22:05:36 PST 2013
On Thu, Jan 17, 2013 at 05:59:13PM -0800, Walter Bright wrote:
[...]
> But in practice, I find over and over again that carefully formatted
> code tends to go hand in hand with well designed code.
>
> It's like internet postings. If you see a posting in ALL CAPS, or
> all lower case, or sloppy grammar/spelling, or long runon sentences,
> or no paragraph breaks, etc., it's almost certainly devoid of
> interesting content. If you see an electronics board with a rat's
> nest of wires and sloppy construction, odds are high it won't work.
> If you see a neatly laid out board, odds are it works.
>
> And so on for just about every engineering/construction work.
This is interesting. I think it holds not just for code formatting, but
with the overall design of the code as well. When you see unfocused
module APIs, leaky abstractions, and copy-n-pasted code, you know you're
in for a world of pain, no matter how beautifully the code may be
formatted. (Although generally, such symptoms often also go along with
poor formatting. But I've seen horribly-designed code that was
superficially very prettily formatted.) When you see a function that
converts IPv6 addresses to strings and then uses string comparisons for
subnet checking, you know that the rest of the code is going to be
equally bad, if not worse.
And on and on it goes.
T
--
Why ask rhetorical questions? -- JC
More information about the Digitalmars-d
mailing list