[lug] Re: Bash While Loop Error

Tkil tkil at scrye.com
Fri Dec 1 21:58:47 MST 2000


[this is some e-mail that Solo and i have been exchanging off-list.  i
thought the list might be interested / would like to comment.  Solo
granted me permission to repost the portions of his e-mail that were
sent privately.  enjoy!]

>>>>> "SCDM" == SoloCDM  <deedsmis at aculink.net> writes:

SCDM> BTW, why do so many people put down C and C++?  

i didn't mean to be "putting down" c and c++.  it's just that you are
assuming the responsibility for a lot more things when you go down to
that level.  also, some things aren't built-in that are very helpful
at this sort of text massaging; strings, associative arrays, fairly
easy handling of i/o, etc.

put another way, after the third or fourth "strcat" or "strcpy", i
start to get annoyed with the whole thing.  i can handle c++ strings a
little bit, but unless i install a pretty powerful regex engine, and
optional add-ons to the STL, perl still has more goodies built-in than
c++ does.  c++ can do things that perl can't -- no argument there.

fundamentally, i find it easier to *express* myself in perl; its basic
constructs are at a high enough level that they map well things in
this problem space.  you don't have to think of a string as a series
of characters, with this length, allocated on the heap, so remember to
free it, wait, make sure it's null terminated, blah blah blah.  in
perl, it's just a string.  likewise with arrays and lists.  they're
much more natural in perl than in c/c++ (at least to me).

SCDM> Also, what is . . . as you put it -- "scripting" languages?  I
SCDM> understand you were referring to Python and Perl, but exactly
SCDM> how do Python and Perl rank higher than C and C++?

the semantic difference between "scripting" and "programming"
languages isn't strict, and there's a lot of disagreement there.

in this case, it sounded like you were gluing other applications
together, possibly doing some manipulation of the text streams as they
go from one component to another.  this is an ideal use of a very high
level language, even if the performance isn't totally optimal.  (even
if it takes two weeks to run, would you rather be doing something else
in that time, or spending two weeks to get a factor of 2 or 3 in speed
out of a c/c++ program?)

anyway.  hope this was coherent; i've been a bit out of it lately with
a cold.  further ponderings on similar topic:

   http://slinky.scrye.com/~tkil/perl/what-to-learn.html

finally, i just want to re-iterate that i didn't mean to put down c or
c++.  i just think that the tradeoff (more efficiency vs. much more
pain in development and debugging) is weighed in favor of a language
that "does things for you".  (note that this is a big part of what
Java was supposed to provide as an advantage over c++ -- the memory
management side of things, at least.)  i actually rather like c++, but
i view it as more of a language of last resort.

put another way, developer time is much more expensive than computer
time.  if i can write a script in perl in one day, that takes three
days of cpu to run, i'm still better off than if it had taken me three
days to write and one to run.  (and if something takes me a day of
perl, i'll guarantee that you can't do it in three days in c++...).

t.




More information about the LUG mailing list