POV-Ray : Newsgroups : povray.off-topic : Context switching : Re: Context switching Server Time
4 Sep 2024 13:20:49 EDT (-0400)
  Re: Context switching  
From: Jim Henderson
Date: 24 Apr 2010 16:38:53
Message: <4bd356dd@news.povray.org>
On Sat, 24 Apr 2010 19:30:52 +0100, Orchid XP v8 wrote:

> Warp wrote:
>> Orchid XP v8 <voi### [at] devnull> wrote:
>>> why would you want to do this?
>> 
>>   Why would one want to do pattern substitution?
> 
> No, why would you want to find anything that's a number, parse it, and
> add one to it. It doesn't seem like a particularly useful example. I'm
> sure the same techniques could be used to do something more useful, but
> I can't think of an example.

Immediately one that comes to me is the output of a program that was off 
by one - and the original program is no longer available or it would take 
longer to re-run than to just correct the data.

> Anyway, I forget how we even got started on this topic, but this debate
> has gone on long enough to make a few things clear. It seems that
> low-level text munging is useful for the kind of stuff you do, and not
> especially useful for the kind of stuff I do. Let's leave it at that.

It's entirely possible if you understood it better and what the 
capabilities of the various programs are, you could save yourself time 
(either now or in the future) by not doing things in a way that is harder 
or takes more time.

I said earlier that I'm not a software engineer - and I'm not.  I took a 
few courses in programming and Computer Science when I was at uni, but I 
do understand that if the only language you know is BASIC (the first 
language I learned - Commodore BASIC), many things will seem impossible 
to do because the *tool* is limited.  By understanding that there are 
other tools available and some tools are better suited to accomplish a 
task than others, you broaden your ability to get the job done 
efficiently.

If I had stuck with just programming in C (which was may main language of 
choice), then doing the types of data manipulation I do with awk or sed 
(I prefer the former, actually, but can use both), I'd be stuck in a 
cycle of code, compile, run, analyze, modify code, compile, run, 
analyze.....which takes a lot more time.

In C, a program to search and traverse the directory structure would be 
quite long (actually, one can see what's involved by looking at the 
source for grep!), but using a tool that's built for that purpose?  Much 
more efficient than building your own.

You know the old saying, when the only tool you have is a hammer, 
everything looks like a nail?

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.