9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Douglas A. Gwyn" <DAGwyn@null.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] ... in the Kingdom of Sources
Date: Fri, 12 Sep 2003 09:18:22 +0000	[thread overview]
Message-ID: <EsycnRJHy5Fs2PyiU-KYuQ@comcast.com> (raw)
In-Reply-To: <e3132ecf965715b1af36966e850f2a61@vitanuova.com>

rog@vitanuova.com wrote:
> is truncating a 1MB file to 512K due to a mid-stream dud character
> really a better solution than just flagging the dud character itself?
> as you suggest, the answer is subjective, but surely the old maxim is
> useful:
> 	be liberal in what you accept and strict in what you generate.

The trouble is, most programs are data transformers, and
garbage in means garbage out *unless* the garbage is detected
and an appropriate strategy used to deal with it.  What is
appropriate depends on the intended application.

An impossible character encoding in input text data indicates
that the preceding process did not do *its* job.  Naturally
you want to be able to handle such situations.  But merely
ignoring the fact that something is wrong and proceeding with
the computation just propagates the error; it doesn't "fix"
the situation.  It probably doesn't matter much if you're just
hacking, but if something important depends on having correct
data, a better strategy is called for.  I would hate to think
that the codes sent to a respirator or pneumatic brake hadn't
been correctly generated.

I admit that lazy programming is more fun.  So have fun, but
don't think that an approach that has different goals is
therefore inherently deficient.


  parent reply	other threads:[~2003-09-12  9:18 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-05 11:54 David Presotto
2003-09-05 12:14 ` Lucio De Re
2003-09-05 12:33   ` boyd, rounin
2003-09-07  9:00     ` Aharon Robbins
2003-09-07  9:05       ` boyd, rounin
2003-09-08  9:10         ` Douglas A. Gwyn
2003-09-08  9:52           ` boyd, rounin
2003-09-08 17:33           ` rob pike, esq.
2003-09-09  8:34             ` Douglas A. Gwyn
2003-09-09 15:50               ` rob pike, esq.
2003-09-09 15:50               ` rob pike, esq.
2003-09-10 10:17               ` Bruce Ellis
2003-09-11  9:07                 ` Douglas A. Gwyn
2003-09-11 13:06                   ` rog
2003-09-11 14:01                     ` Lucio De Re
2003-09-11 14:25                       ` rog
2003-09-11 15:17                         ` Lucio De Re
2003-09-12  9:18                         ` Douglas A. Gwyn [this message]
2003-09-11 15:48                     ` rob pike, esq.
2003-09-11 17:04                       ` Lucio De Re
2003-09-11 17:40                         ` chris
2003-09-12  4:13                           ` boyd, rounin
2003-09-12  9:18                           ` Douglas A. Gwyn
2003-09-12 15:18                             ` rob pike, esq.
2003-09-12 16:39                               ` rog
2003-09-12  9:18                         ` Douglas A. Gwyn
2003-09-12  0:56                     ` Bruce Ellis
2003-09-11 15:42                   ` rob pike, esq.
2003-09-12  1:18                     ` okamoto
2003-09-12  9:18                     ` Ralph Corderoy
2003-09-12  9:57                       ` Bruce Ellis
2003-09-15  8:27                         ` Douglas A. Gwyn
2003-09-12  3:53                   ` boyd, rounin
2003-09-12  3:01               ` Dan Cross
2003-09-07 13:48       ` Russ Cox
2003-09-07 15:45         ` David Presotto
2003-09-06 11:13   ` boyd, rounin
  -- strict thread matches above, loose matches on Subject: below --
2003-09-05 12:04 David Presotto
2003-09-05  6:39 lucio
2003-09-05  6:31 ` Lucio De Re
2003-09-05 11:30 ` David Presotto
2003-09-05 11:42 ` David Presotto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EsycnRJHy5Fs2PyiU-KYuQ@comcast.com \
    --to=dagwyn@null.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).