Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] using rusage



2008/6/23 Curt Sampson <cjs@example.com>:

> Perhaps you really meant, "defensively within reason,"
> for example, by not doing a readback and compare of every block you
> write to the disk, in which case we would be in agreement that you need
> to strike a balance.

OK, we are in agreement, then.

> You might also have a look at Erlang, where it's common practice not to
> bother with error-checking code, and "let it fail" is the usual mode of
> operation.

I have used Erlang some, and I love it, but...

>> In C, you just have to accept that you are going to need some guard
>> code. You should certainly factor that guard code well; macros can be
>> your friend here.
>
> Yup.

Most systems programming is still done in C, with C++ and Java a
distant second. Obviously, Erlang is heavily used by Ericsson for
their telecom systems programming.

When systems programmers have a choice of language, they should
obviously choose the one that allows them to solve the problem with
the fewest lines of clearly written, well factored code possible.
However, systems programmers often do not have a choice, or do not
have the management support to make a choice.

> Right. That is a cost-benefit decision where in most cases I would
> agree with you. The difference is that I looked at it explicitly from a
> cost-benefit point of view, and recognised that that's a trade-off I'm
> making.

No, the difference is that you explicitly stated that it is a
cost-benefit situation, whereas I assumed that anyone with a brain
would realise that *every* decision is, whether you do the analysis or
not.

Your point is well-taken: guard code can be taken to an extreme. In
fact, I myself have argued recently and vociferously that we should be
letting Perl throw run-time errors in almost all cases, since the vast
majority of the code we write cannot reasonably recover from a
failure, and an unhandled runtime error provides a nice stack trace,
which is what we need to debug errors anyway.

-- 
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links