in reply to RE: On elegant coding...
in thread Just thinking ...

I shun this coding style, because it either implies an additional dependency which doesn't exist, or introduces a dependency which shouldn't be there.

If you use

a && b && c
where you mean
if (a) { b; c; }
and b returns false, you're hosed.

Therefore, as an element of "elegance", I don't introduce or require any more dependencies than I can safely justify.

In practical terms, I'd reject your code during a code review, demanding a rewrite on the grounds of maintainability.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: RE: On elegant coding...
by princepawn (Parson) on Oct 19, 2000 at 17:05 UTC
    But I think it is perfectly OK to generate expectations of functions and develop code whose logic is dependent on it.
      It is not really OK, but it is unavoidable.

      That said, it is still to be avoided where feasible.

      There is a big picture principle here. And that principle is that our ability to develop software is fundamentally limited by our ability to keep track of what is going on. So every step we take to avoid developing (or to remove) dependencies is another step by which we have extended what we can do with the software we are developing. You have by that much made it easier to develop more, fix bugs you find, and migrate support from one person to another.

      Pick up virtually any book on software engineering for more.