General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Lawrence D’Oliveiro
Fireship
comments
Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "FORTRAN in 100 Seconds" video.
Statements were not limited to the length of a single line. FORTRAN had continuation capabilities (put any character other than blank or “0” in column 6) since the beginning.
35
I can remember a computer consultant I met once, whose job it was to help people with their FORTRAN code, stating that he would never even look at a user’s program unless it had IMPLICIT NONE at the top.
23
Speaking of “frameworks”, a logical next step would be to look at RATFOR, a.k.a. “RATional FORtran”. It was basically a preprocessor that translated into regular FORTRAN, but introduced some nicer statement constructs.
9
Did they ever fix the weird issue with how arguments were passed to functions and subroutines? Namely, if the actual argument was a simple variable or an array element, it would pass the address of that. If it was a more complex expression, then that would be evaluated into a temporary location and the address of the temporary was passed. In other words, the called routine could modify the actual argument in one case, but not another. Imagine you had declared a constant “PI” in your program and set it to π = 3.14... Now imagine that, due to a bug, you passed this to a routine which modified it. Suddenly your “PI” value, that you thought was a constant, is not so constant any more!
7
Why do you need the word “call”? Why not just have that line as addition(sum, 1, 2) as in other languages? Because there are no reserved words in FORTRAN!
2
Which could lead to its own mistakes. There was a story about code for a space probe where the line DO 10 I = 1,10 became instead DO 10 I = 1.10 What’s the difference? The first is the beginning of a DO-loop, the second is a simple assignment of the value 1.10 to a variable called “DO10I”. No compiler error, but the program behaves entirely differently.
2
Dijkstra called APL “the language of tomorrow to solve the problems of yesterday”.
2
The card punch I used might have been an IBM 129. It stored the entire line in memory, with no display (other than a column number) until you pressed a key to punch the card. Make a typo? Hold down a key to advance the column number (preserving the existing contents of the line prior to that) to the point where you need to make the correct, press the correct key, then advance past that to the end (again preserving the existing contents of those columns), and punch a new card.
2
It was better than getting the data-entry people to input the programs. They made so many typos -- confusing “O” and “0” and “1” and “I”, for example. I just found it quicker to input the programs myself.
2
If you are doing “scratchpad”-style programming (a few lines of code to calculate something), I would recommend using Jupyter notebooks with Python code. Makes it very easy to try things out. You can even get graphical plots and other rich output. And basic widgets for simple interaction.
1
2:07 Unfortunately, there was this misfeature (or may be it was just an ambiguity in the original language spec) whereby a loop would always iterate at least once, even if the termination condition was true at the start. Not sure if this was ever fixed.
1
Notice I didn’t say anything about “do-while”.
1
@chri-k Guess which one I was talking about. Consider the equivalent of for i in range(len(s)) : ... do something with s[i] ... ♯end for where s might be empty in some situations.
1
@chri-k CONTINUE was a no-op. Other languages didn’t have this problem.
1
@chri-k I noticed.
1
@vincentgoudreault9662 Other languages (like C or Python, even old Pascal) don’t need a keyword to distinguish the two. Why FORTRAN?
1
@vincentgoudreault9662 Try giving the same name to an array and a subroutine in FORTRAN, and let us know what happens.
1
@WielkiKaleson So how does that explain the need for CALL?
1
@WielkiKaleson Maybe read the comments before replying next time.
1
@andresmartinezramos7513 Which doesn’t answer the question I asked, which is why subroutine calls need the word “CALL” in FORTRAN, but not in other languages.
1
It was so that FORTRAN didn’t have any reserved words.
1
Python has the NumPy engine for operating efficiently on large multidimensional arrays, including sparse ones. With custom operator overloads, you can express complex manipulations in a single line of code.
1
@Migoyan I don’t see any Fortran code in the NumPy source tree. Can you point me at any?
1
@vincentgoudreault9662 And not FORTRAN, either.
1
@vincentgoudreault9662 If they were originally written in FORTRAN, why change to C? Unless perhaps FORTRAN wasn’t good enough.
1
@vincentgoudreault9662 I wonder why, if FORTRAN is such a good language, you can’t find “people good enough” to work in it.
1
@vincentgoudreault9662 Why is it not being taught in schools? Does it take more “discipline” to “master” FORTRAN than C?
1
@vincentgoudreault9662 What is the point of FORTRAN, then, if you can do the same things more easily in C?
1
@vincentgoudreault9662 Wonder why that old “fast” FORTRAN code was recoded into C, then. Have you looked at the NumPy code? Maybe you could offer to speed it up by rewriting it in FORTRAN.
1
@vincentgoudreault9662 It is up to you to back up your claim with actual, working code. Otherwise, why bother to make it? We have plenty of such code for C; show us some for FORTRAN, if you can. And if you can’t ...
1
I learned it from a book called “The Compleat Cybernaut”. The bio said the author was working in some city (might have been Liverpool) as a blacksmith. She must have led an interesting life ... I devoured that book over a weekend. But in those days, I had no access to an actual computer -- not for another three years.
1
That’s a lot of code to do something so simple. Try this: import functools, operator for i in range(11) : print("%d! = %d" % (i, functools.reduce(operator.mul, range(1, i + 1), 1)))
1
FORTRAN actually has no reserved words.
1