3 ms·
A minor quibble: The article leaves out the commands needed to actually run the program. Also, just for grins, the first language I learned: 10 INPUT "Heig
by analog31 5y ago
A minor quibble: The article leaves out the commands needed to actually run the program. Also, just for grins, the first language I learned:
10 INPUT "Height above sea level(m)", H
20 D=SQR(2*6367.45*(h/1000.0)
30 PRINT "Distance to horizon", D
RUN
- HWR_14 5y agoMinor quibble: You omit units from the output.
- bobochan 5y agoYes, if you read the first Dartmouth BASIC documentation you immediately understand that Kurtz and Kemeny were designing a language that students could teach themselves, with the goal of them being able to transition to Fortran.
- analog31 5y agoAmusingly, my physics and math classes all used FORTRAN, but my teachers were OK with me translating the programs to BASIC so I could run them on my crude MS-DOS computer. I had a copy of the IBM FORTRAN compiler, but it was this cumbersome beast that required two diskettes -- one contained the compiler and the other contained the linker, or something like that. And the complete compile/link workflow took several minutes. BASIC, and then Turbo Pascal, were game changing because you could run a program instantly. BASIC even had crude array math via the MAT statement though I don't recall the details. I got to my senior year, second semester, and had a meeting with my advisor to make sure I had met all of my graduation requirements. He looked at my record and said: "Hey, you were supposed to take a programming class. But you know how to program, don't you?" I said yes. He checked the box to waive that requirement for me. Then I started breathing again.
- zozbot234 5y agoOne nice thing about the INPUT facility in BASIC is that it's truly designed for interactive use out-of-the-box and does its own error recovery on inputs that are incomplete or fail to parse. With other languages (FORTRAN, C/C++) you generally have to implement that part manually.
- aragilar 5y agoI'm not sure that's a minor one in the case of Fortran, I've seen enough Fortran code to know that every codebase has its own special set of flags that it needs to compile correctly (or the need to dig up an old, unmaintained compiler...). Also missing from the Fortran code is `implicit none` (and let's not talk about good old fixed format or the mess with comparison operators or common blocks or ...).