View Single Post
  #153   Report Post  
Posted to uk.d-i-y
Martin Brown Martin Brown is offline
external usenet poster
 
Posts: 2,701
Default OT - Programming Languages

On 03/02/2015 21:58, Adam Funk wrote:
On 2015-02-03, Tim Streater wrote:

In article , Adam Funk
wrote:
On 2015-02-01, wrote:


I also dislike python, although it has its uses (and a wide variety of
special purpose libraries). However, in case you consider it a useful
piece of information, note that the Physics dept at Imperial College
teaches python in first year physics.

The significance of whitespace still bugs me, ...


Whitespace should *not* be significant; there are no other contexts in
life in which it is. This idea is just a throwback to the days of
FORTRAN.


Well, there are two ways of looking at that. I actually used FORTRAN
(maybe we called it Fortran by then; I'm not sure) in the late 1980s,
& often ran into syntax errors caused by overtyping past column 72.


I don't recall such problems with any of the compilers I used. It would
have been FORTRAN77 by then - earlier compilers were less forgiving.

OTOH, "Consistently separating words by spaces became a general custom
about the tenth century A. D., and lasted until about 1957, when
FORTRAN abandoned the practice." It used to be the case that if you
called a variable DODO, the compiler would parse it as DO DO & your
program would be dead as a....


That is incorrect at least in correctly implemented FORTRAN compilers
there are no reserved words and as such you could have coding horrors
that used any reserved word you liked in any position no matter how
crazy for example the arithmetic statement function:

FORMAT(A4)= A4+1.0

Lurking at the top of deliberately obfuscated code. It did crash some
weaker compilers but it should not crash any of the mainstream ones.

Or equally unwise but still syntactically valid

IF (IF .EQ. THEN) IF = IF*THEN

Or the malformed DO loop that was actually typed in as

DO 13 I = 1.3

Spaces are insignificant and the mistake is full stop "." vs comma ",".
It set variable DO13I = 1.3 instead of looping to 13 3 times. This text
ambiguity led to the loss of Mariner 1 in 1963 see 6.8 Warning at

http://math.scu.edu/~dsmolars/ma60/nchpt6.html

Or the "reserved words" section at:
http://www.math-cs.gordon.edu/course...N/fortran.html

Defensive programming practice in later years used IMPLICIT to prevent
accidental assignments to typos from getting through unnoticed.

--
Regards,
Martin Brown