Live data from Hacker News

BASIC turns 60

arstechnica.com

101–110 of 144 posts

Re: BASIC turns 60

#101
Happy birthday to the language that got me into software. Admittedly, BASIC as a language was quite limiting, and, well, basic. At least the flavor I was using. I made quite a few rudimentary games on my dad's old TRS-80 Color Computer, and eventually learned C because of it. BASIC may not be the greatest language power-wise, but it damn well may be the greatest just because of how iconic and important it was to the programming sphere as a whole.

Re: BASIC turns 60

#102
post #2

I distinctly remember being taught BASIC in school in the 1980s and quickly thinking “this is awfully basic” and not wanting much to do with it. Now I don’t know if my childhood evaluation was correct but I do wonder: Were there many complex programs written in BASIC? Or was it largely a teaching tool?

> Were there many complex programs written in BASIC?

I don't know generally, but I worked in housekeeping at a large hotel for a few years in my younger days, and the software they used to track the rooms was in interpreted BASIC.

I didn't know that until my manager started cursing because the software broke. When I looked at the screen, the error message syntax was clearly that of BASIC. I just typed "RUN" at the prompt and everything worked again. She thought I was a genius.

Re: BASIC turns 60

#103
post #4

It's hard to overstate how important BASIC was to the adoption of personal computing - it provided a straightforward way to program an entire generation of home computers and bootstrapped countless careers.

I don’t understand why it isn’t taught to kids instead of scratch. Visual coding is my nemesis. I just disagree with it in principle. It makes even the simplest things complicated and virtually impossible to debug. BASIC was the first computer language I learned. It’s so basic I just taught it to myself from the help section when I was 12, without any exceptional ability on my part.

Why not both? My Atari 800 came with a BASIC and a Logo cartridge. Logo was the thing that got my attention first because it could draw pictures on a TV screen right away, but writing BASIC programs and storing them on a cassette tape was the thing that got me hooked for life.

Re: BASIC turns 60

#104
post #64

Earlier quoted context omitted.

http://dtss.dartmouth.edu/scans/BASIC/BASIC%20Compiler.pdf Dartmouth BASIC was compiled.

Compiled can mean many things. For instance it can mean that only the parsing is done at compile time, leaving the rest for runtime.

I always thought that was called "pseudocompiled" or "semicompiled".

Re: BASIC turns 60

#105
I learned to program with BASIC. My first program was one to balance my Dad's checkbook. I copied it from a manual and added some extra PRINT statements for flair. I was in 4th grade. It was on a Timex Sinclair. Then I tried to draw a smiley face and ran out of RAM -- it only had 1K.

Re: BASIC turns 60

#106
BASIC was my first programming language. Of course I abandoned it for Fortran, C, C++, etc. But when I was considering developing D, I thought about string manipulation. It was so easy in BASIC. Why was it so terrible in C and C++? So, so many bugs in string manipulation code. So much time spent on it.

A major goal of D was to have strings work like in BASIC. And they do! Very happy about that. Thank you, BASIC!

Re: BASIC turns 60

#107
post #2

I distinctly remember being taught BASIC in school in the 1980s and quickly thinking “this is awfully basic” and not wanting much to do with it. Now I don’t know if my childhood evaluation was correct but I do wonder: Were there many complex programs written in BASIC? Or was it largely a teaching tool?

It's Turing complete.. and my apple II library had all sorts of crazy apps written in basic. I remember taking them apart when I was like 10.. and being like who has the time to write all these lines! Which.. I still think is crazy considering no IDE and how you would just input them line by line... leaving space between lines just in case you needed to put a new line in later.

When using line numbers you wouldn't go from 1 to 2 to 3 etc, but from 10 to 20 to 30 so that you can always insert a line (e.g. 11) between 10 and 20. After a while when the numbering became to messy, you'd issue a RENUM command to renumber the entire program, e.g. RENUM 10 would make the first line 10, and then use increments of 10 for subsequent lines. At that point you start over by re-inserting new lines between the others.

Re: BASIC turns 60

#108
Most people think of one of the MS BASIC dialects when they think of BASIC (at least in the US). The original Dartmouth BASIC had matrix primatives, including MAT READ, MAT PRINT, MAT INPUT, and functions like MAT A=INV(B) (yes, matrix inversion), MAT A=BC, MAT A=B+C, MAT A=B-C, MAT A=B(2) (scalar mult), MAT A=TRN(B) (transpose), MAT A=IDN(5,5) (5x5 identity matrix), MAT A=ZER(5,5) (zero), MAT A=CON(5,5) (fill with 1.0).

I cut my teeth on Wang 2200 BASIC, which was an extended Dartmouth BASIC, so it had the above MAT statements, but also a bunch of wild ones that did searching and sorting on arrays, merging two sorted arrays into a sorted output, and more.

Here is a statement that searches a character array A$() in columns 1-5 for a string in Z$: MAT SEARCH A$(),=STR(Z$,1,5) TO B$ STEP 5. Every match writes the location to a descriptor array (this case B$), where each pair of bytes was the offset in the A$ array where the match was found.

Despite all that power, it still was quite limited: all variable names had to be a single letter or a letter and a digit. All variables were global. GOTO and GOSUB were either the line number or a "label" where the label was one of '0 to '255. Strings were statically allocated, not dynamic, and the max length was 64 characters (BASIC-2 extended that to 126 bytes). On the other hand, before the program started running everything was allocated there was no possibility of memory overflow during runtime, and no garbage collection, and any references to missing line numbers was caught up front.

Re: BASIC turns 60

#109
post #10

Earlier quoted context omitted.

On my Apple II's (with AppleSoft BASIC) I missed proper functions and the ability to use a stack. Recursion was next to impossible to express.

The BASIC version that run BBC Micro had proper functions and subroutines with local variables (I think it even had recursion, but I'm not 100% sure). AFAIK, all Microsoft BASIC (of which AppleSoft BASIC was a descendent) versions did not have the above until QBasic.

It did have recursion.

    >LIST
       10PRINT FNFACT(6)  
       20END
       30DEFFNFACT(N) 
       40IF N=1 THEN =1 ELSE =N*FNFACT(N-1)  

    >RUN
           720

Re: BASIC turns 60

#110

BASIC was my first programming language. Of course I abandoned it for Fortran, C, C++, etc. But when I was considering developing D, I thought about string manipulation. It was so easy in BASIC. Why was it so terrible in C and C++? So, so many bugs in string manipulation code. So much time spent on it. A major goal of D was to have strings work like in BASIC. And they do! Very happy about that. Thank you, BASIC!

First BASIC I used was Rocky Mountain basic on an HP 9845C. After that Pascal and C strings were so terrible.

Rocky Mountain BASIC also had multidimensional arrays and array operations. And support for sparse arrays.

Post reply on HN