From: Terence on
I have been reading all the posts for some months and I am very
surprised with all the problems planted and the contortions programmers
are going through to write their programs.

Rule 1. If you have a problem (not a simple question) that you have to
expose here you are probably going about your problem-solving algorithm
wrongly. And any program is an algorithm in concept, with minor
algorithms within the main one. There is USUALLY a simpler way - if you
think about it first

Rule 2. If you feel you have to call some special service or an
external non-fortran routine or program (access to Winteracter or
Microsoft's API's for screen control excepted). you are probably doing
something wrong.

Riule 3. Put yourself in the position of the person later modifying
your work because you are no longer around. Would you hate yourself if
faced with your coding? Is the algorithm obvious?

I have never been faced with a mathematical or language-processing
requirement I could not solve with simple programming. The only awkward
problems I HAVE met were all related to getting round the 64k byte
limit of arrays in early fortran, but even then, there are sparse array
methods and list-processing, and the use of external storage offered
essentially unlimited arrays in the practical sense. OK, so it was a
bit slower, but the results came out earlier too! And on time!

If you get the chance, have a look at the old algorithms published and
libraries of Fortran code available form the old days, and marvel at
the elegance ans simplicity forced on people who had only 64K or
memory, or even 4K of memory in thier computers.

From: Elijah Cardon on

"Terence" <tbwright(a)cantv.net> wrote in message
news:1161646242.349155.289220(a)i42g2000cwa.googlegroups.com...
>I have been reading all the posts for some months and I am very
> surprised with all the problems planted and the contortions programmers
> are going through to write their programs.
>
> Rule 1. If you have a problem (not a simple question) that you have to
> expose here you are probably going about your problem-solving algorithm
> wrongly. And any program is an algorithm in concept, with minor
> algorithms within the main one. There is USUALLY a simpler way - if you
> think about it first
>
> Rule 2. If you feel you have to call some special service or an
> external non-fortran routine or program (access to Winteracter or
> Microsoft's API's for screen control excepted). you are probably doing
> something wrong.
>
> Riule 3. Put yourself in the position of the person later modifying
> your work because you are no longer around. Would you hate yourself if
> faced with your coding? Is the algorithm obvious?
>
> I have never been faced with a mathematical or language-processing
> requirement I could not solve with simple programming. The only awkward
> problems I HAVE met were all related to getting round the 64k byte
> limit of arrays in early fortran, but even then, there are sparse array
> methods and list-processing, and the use of external storage offered
> essentially unlimited arrays in the practical sense. OK, so it was a
> bit slower, but the results came out earlier too! And on time!
>
> If you get the chance, have a look at the old algorithms published and
> libraries of Fortran code available form the old days, and marvel at
> the elegance ans simplicity forced on people who had only 64K or
> memory, or even 4K of memory in thier computers.
I've always been looking for good advice. Everything I read here seemed
wrong to me. As if it were an exercise in english .... EC


From: Dylan Sung on

"Terence" <tbwright(a)cantv.net> wrote in message
news:1161646242.349155.289220(a)i42g2000cwa.googlegroups.com...
> If you get the chance, have a look at the old algorithms published and
> libraries of Fortran code available form the old days, and marvel at
> the elegance ans simplicity forced on people who had only 64K or
> memory, or even 4K of memory in thier computers.
>

When tackling a problem, I find it easier to create separate programs to do
single jobs that spits out the results. Usually, they are only about a
hundred or so lines long, so it isn't too hard to figure out what its all
about despite the lack of comments, as I do space out block of related
stuff, but don't indent. I find indented code harder to read.

Dyl.

From: beliavsky on

Terence wrote:
> I have been reading all the posts for some months and I am very
> surprised with all the problems planted and the contortions programmers
> are going through to write their programs.
>
> Rule 1. If you have a problem (not a simple question) that you have to
> expose here you are probably going about your problem-solving algorithm
> wrongly. And any program is an algorithm in concept, with minor
> algorithms within the main one. There is USUALLY a simpler way - if you
> think about it first
>
> Rule 2. If you feel you have to call some special service or an
> external non-fortran routine or program (access to Winteracter or
> Microsoft's API's for screen control excepted). you are probably doing
> something wrong.

I disagree. I'd guess that many, if not most, "production" Fortran
programs need to do this, which is one reason why Fortran 2003
standardizes interoperability with C and why Fortran 2008 has
EXECUTE_COMMAND_LINE. That "math" code should be separated from the
code using these features.

<snip>

> If you get the chance, have a look at the old algorithms published and
> libraries of Fortran code available form the old days, and marvel at
> the elegance ans simplicity forced on people who had only 64K or
> memory, or even 4K of memory in thier computers.

They may have used EQUIVALENCE, which is not elegant or simple to
follow.

From: Ian Bush on
beliavsky(a)aol.com wrote:

>
> Terence wrote:
>> Rule 2. If you feel you have to call some special service or an
>> external non-fortran routine or program (access to Winteracter or
>> Microsoft's API's for screen control excepted). you are probably doing
>> something wrong.
>
> I disagree. I'd guess that many, if not most, "production" Fortran
> programs need to do this, which is one reason why Fortran 2003
> standardizes interoperability with C and why Fortran 2008 has
> EXECUTE_COMMAND_LINE. That "math" code should be separated from the
> code using these features.

Hmmmm, I think I disagree with both ! For me it would be

Rule 2. If you feel you have to call some special service or an
external non-fortran routine or program (MPI excepted). you are
probably doing something wrong.

I've contributed heavily to three "production" Fortran programs which are
sold, provided a fair bit of input for a fourth, and bits and pieces for others,
and only one of these breaks the above - and that is really a function of the
large amount of legacy code in it,

Ian