[oclug] Save the Limited Computer Resources
linuxdoctor at yahoo.com
Fri Feb 23 15:34:56 EST 2001
--- Jonathan Earle <jearle at nortelnetworks.com> wrote:
> > -----Original Message-----
> > From: Ross Jordan [mailto:rjordan at blanch.math.uwaterloo.ca]
> > > Although this has probably already been offered (I haven't
> > yet read all the
> > > messages in this thread), I've been "sed"ing a bit
> > recently, and something
> > > like:
> > >
> > > cat <your html file> | sed "/href=/s/http:\/\/some.url/./g"
> > Not to be picky, but this is gratuitous use of cat.
> > sed "sed_command" < file will avoid spawning the additional cat
> > process. It's almost as bad as when people do " cat file |
> > grep regex", rather than "grep regex file" or "grep regex <
> What is the issue with an additional process? The box has more
> than enough
> CPU and memory to handle one cat process - heck, it barely yawns
> stretches when I compile the kernel. :)
> I'm not saying you're wrong, in fact, quite the opposite, but, why
> does this
Actually I've been thinking about this problem for a while myself for
a while. I myself habitually add the additonal "cat xxx | command"
for reason except perhaps for reasons of allowing the line to be read
cleanly left to write. But what's so bad about "command <xxx"? In
human languages we have the same thing. The latin for "I think" is
"cogito" where person, number and tense are included in that single
word, literal english translation: "the person 'I' does 'think'"
However, what I've really been musing about lately is along the same
lines. We constantly see programmes becoming larger and larger
filling all the available resources. More resources are added, and
still they fill, quicker than before. Memory in machines have for
some time now been significantly larger than 640K and for some
programmes the source code won't fit on a single-sided 5 1/4" floppy.
We continue to write programmes and don't bother to compile them with
whatever optimizations are available. We run huge interpretive
programmes like Perl, Tcl/Tk, Python and so forth and not worry that
they take a lot of memory and actually take longer to perform the
tasks than in a compiled language. We use 'excuses' like, it's faster
to write, test and ship that way as if our time is more valuable than
that of the end user(1).
We consume all these resources of memory, storage and time without a
thought except perhaps for "it's cheap" or "there's lots of it."
They said the same thing about fresh air and clean water.
1. "Programmers often neglect proper consideration for the week link
in the software; the person who will be using it.", Leonard Lee, 1992
There are no stupid questions, but there are a LOT of inquisitive idiots.
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
More information about the OCLUG