Sorting an array
Fairlight
fairlite at fairlite.com
Wed May 18 18:03:58 PDT 2016
> Go ahead, use Basic for this task and hope you can use it for your
> next task, and the next one, and the next one ...
>
[...]
You appear to have -completely- missed my point. I was -not- saying I
advocated using BASIC for the task. I was saying that the required bubble
sort can be done in a language as dated and (typically inadequate) as
BASIC, so it's therefore easily implementable -inside filePro-, without
needing to using -any- external language.
Why would anyone invoke the 500lb gorilla overhead of PHP, when you can
bang out a pure-fP bubble sort? That's nuts.
> As I said, "I prefer PHP", did not suggest it was the "best nor
> only" solution. Over Basic, I still choose PHP. If I am not
> mistaken, you may be able to install it, run it as "scripts" and not
> have to install Apache nor MySQL if resource is an issue. Sorting
> array in PHP is as simple as:
[...]
I prefer not to use more system resources than necessary. Every time you
invoke -your- solution, assuming you're using SYSTEM, you're invoking:
1) One bash shell for parsing SYSTEM's command, before you even call
2) One php interpreter, both of which use
3) Way more RAM than necessary for this simple task.
Frankly, it's sloppy and massive overkill. If we were parsing XML with
all its vagaries and complications, I'd buy it. We're not. We're talking
about a simple sort algorithm which has been around for decades.
> Do not be ashamed if you have to resort to dumping data to a filePro file
> and read it back, you do what you must to get the job done.
And "must" is absolutely a misnomer in relation to bringing in external
tools for doing a bubble sort which can be done directly inside filePro.
> This is quick and easy within your environment. It is a common
> practice to create temporary tables to store, manipulate data and
> doing so in filePro should not be cause of shame. In SQL, one
It should be cause for shame if the task is easy enough that you're
draining far more system resources than necessary for the task at hand.
"Quick and easy" is -not- always the correct solution, and the path of
least resistance often comes with a price to be paid later.
There's a reason that the best programmers have actually learned -systems-
to a decent degree, as opposed to taking the stance of, "I just program in
[insert_language]. I don't need to know systems, nor do I care to."
Software doesn't exist in a vacuum; it runs -on- systems. Yes, if you're
programming, you should know the OS, and you should know (or at least
research) the expense you're invoking by taking any given path, -before-
you decide upon a path.
There's a reason PHP coders are a dime a dozen, and often suck beyond
the telling of it. They quite often -don't- usually know systems, and
therefore write insecure, bloated, horribly convoluted code which nobody
in their right mind would touch if they had a clue. PHP is the AOL of
languages: so simple, any idiot can do it Ä and far too many do. PHP and
especially PHP web applications are a blight upon security, largely because
the people coding both seem not to know or care about the underlying
systems which support their code, and don't bother to learn in most cases.
I'm not saying there are no good PHP programmers. I know some exceptional
ones. But they -are- in the minority, IMNSHO.
And more to the point at hand, NO external program is necessary in the
proposed case, in the first place.
> Then again, some one like J.P. or Barry (??) White may point you to
Brian White.
mark->
--
Audio panton, cogito singularis.
More information about the Filepro-list
mailing list