BASIC Computer Language Turns 40 1042
5 REM nam37 codes
10 PRINT "In 1963 two Dartmouth College math professors had a radical"
20 PRINT "idea - create a computer language muscular enough to harness"
30 PRINT "the power of the period's computers, yet simple enough that even"
40 PRINT "the school's janitors could use it."
50 END
10 PRINT "In 1963 two Dartmouth College math professors had a radical"
20 PRINT "idea - create a computer language muscular enough to harness"
30 PRINT "the power of the period's computers, yet simple enough that even"
40 PRINT "the school's janitors could use it."
50 END
missing line (Score:5, Funny)
Re:missing line (Score:5, Funny)
10 PRINT "First Post"
20 GOTO 10
Re:Today we use Bash (Score:5, Funny)
10 PRINT "Jorkapp is a Programmer"
20 GOTO 10
but it was too - Basic. IMO, my sig in C is more 1337.
Re:Today we use Bash (Score:5, Informative)
Re:Today we use Bash (Score:5, Funny)
while(1) sounds like the Queen talking.
Re:missing line (Score:5, Funny)
It feels like elementary school again (Score:5, Funny)
15 ? CHR$(7)
20 goto 10
BASIC Sex Ed (Score:5, Funny)
Re:missing line (Score:4, Informative)
A Poem! (Score:5, Funny)
Re:A Poem! (Score:3, Insightful)
Re:A Poem! (Score:4, Funny)
Re:A Poem! (Score:5, Funny)
10 GOTO 30
20 REM ???
30 PRINT "PROFIT!"
Re:A Poem! (Score:5, Informative)
Re:A Poem! (Score:5, Funny)
Re:A Poem! (Score:5, Informative)
20 PRINT "Haiku program"
30 GOTO 10
Ten print this is a (5)
twen-ty print hai ku pro gram (7)
thir-ty go to ten (5)
Re:A Poem! (Score:5, Funny)
Just goes to show you, like comedy, its all in the timing.
Re:A Poem! (Score:5, Interesting)
No kidding. 17 syllables is a lot of room to maneuver in English... far, far less in Japanese.
Ever try watching anime with both the English subtitle and the English dubbing turned on? A Japanese character will say something subtitled, e.g., "I'm cold" and they'll have to dub in something like, e.g., "I feel cold. It's cold in this room!" just to make the syllable count come close.
Re:A Poem! (Score:5, Funny)
Re:Look at all these posts. (Score:5, Funny)
Haiku in English is dumb
Add last line next time
Learn to count! (Score:5, Informative)
Re:Look at all these posts. (Score:4, Interesting)
I think you'll find that literary critical academics are well aware of the preferences of certain languages for certain poetic techniques.
Hexameter (six stress verse) is considered wonderful in French early modern poetry, and almost always terrible in English early modern poetry (Sidney uses it, but his hexameter isn't given particularly great credit).
Quantitative measure is considered to have worked wonderfully in classical Greek, but is accepted as essentially impossible in English (Coleridge semi-successfully attempted it in Christabel).
A Petrarchan sonnet's composition in English is an exercise in frustration and a Shakespearean sonnet's structure in Italian uncomfortably abrupt.
They had a dream (Score:5, Funny)
Re:They had a dream (Score:5, Funny)
And now we have ... (Score:5, Funny)
Re:And now we have ... (Score:5, Funny)
Janitors are programmers too! (Score:5, Funny)
And that, children, is where the seeds of garbage collection were sowed.
-Adam
5 REM Testing.. (Score:5, Funny)
20 PRINT "that all comments in this story"
30 PRINT "be typed in basic"
40 END
Re:5 REM Testing.. (Score:5, Funny)
20 END
Re:5 REM Testing.. (Score:5, Funny)
System.out.println("GOTO 10");
Re:5 REM Testing.. (Score:3, Informative)
Re:5 REM Testing.. (Score:5, Funny)
> 20 PRINT "that all comments in this story"
> 30 PRINT "be typed in basic"
> 40 END
1K Adventure (Score:5, Funny)
10 PRINT "You are in a cave."
20 PRINT "Go N, S, E OR W?"
30 INPUT A$
40 GOTO 10
School Janitors (Score:5, Insightful)
From the Jargon File (Score:5, Interesting)
AAAaaaaghhh (Score:3, Interesting)
And when you had to add something and have uneven spacing of line numbers... Oh it just drives the type A personality in me nuts!
The only good part about line numbers was how easy it made it to write GOTO statements.
Re:AAAaaaaghhh (Score:3, Informative)
And when you had to add something and have uneven spacing of line numbers... Oh it just drives the type A personality in me nuts!
Ah, but AUTO numbers the lines for you. You get a new number each time you hit enter. AUTO [n] starts at line [n].
RENUM renumbers all the lines with a consistent spacing, including the GOTOs, GOSUBs, etc.
I can't believe I still remember that PC-DOS BASICA stuff.
Re:AAAaaaaghhh (Score:3, Interesting)
10 LET M$ = "Microsoft"
And when you had to add something and have uneven spacing of line numbers
Of course, that's why many micro BASIC dialects had a renumbering program available.
And then came VB (Score:5, Insightful)
Obligatory Dijkstra quote (Score:5, Funny)
Nostolgia (Score:5, Funny)
| * |
| * |
| * |
| * |
|* |
| |
| |
*BOOM* YOU CRASHED. TRY AGAIN? [Y/N]
Re:Nostolgia (Score:5, Informative)
Jave derived from BASIC??? (Score:3, Interesting)
Ah, the memories... (Score:3, Interesting)
Re:Ah, the memories... (Score:3, Interesting)
Mine was in the early 70's, on a ASR-33 Teletype in my high school math class that was connected via dial-up connection to some mainframe at Penn State.
Ten characters per second on a roll of paper. with a spiffy paper-tape punch hanging on the side.
Dijkstra said it best ... (Score:5, Informative)
"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration." -- Professor Edsger Dijkstra
Oh yeah and "Goto considered harmful" too, of course.
RIP buddy. :-)
zRe:Dijkstra said it best ...not (Score:5, Interesting)
Don't believe it, kids. If your brain hasn't been ruined by age 7, you can unlearn any bad habits you pick up. His remark is of a stupidity level equal to "if you learn French at school, you won't be able to learn German."
As a matter of fact, not only did I once inherit a program that someone had written - well - on a BBC micro that was a pleasure to maintain, I once myself had to write a quick and dirty assembler for an obscure microprocessor in HP Basic, having no other resources available in a crisis. Despite which I have never once had the urge to use labels in C.
It is a poor musician who blames his instrument... (Score:5, Insightful)
Re:Dijkstra said it best ... (Score:5, Insightful)
Okay, now all the professional coders whose first programming experience was in BASIC on a VIC-20, Apple II, or TRS-80, raise your hands... man, there seems to be a lot of us, huh.
Oh yeah and "Goto considered harmful" too, of course.
GOTO is essential -- all processors use it at their lowest levels (it goes by the name JMP in assembly language, though.)
All other types of branching or looping are just syntactic sugar.
Ah, the fun I had with QBasic... (Score:4, Interesting)
I think it was the limited nature of the language which kept me interested in it for so long. Those DOS memory limits were fun... coding a 2D RPG, and trying to stay within around 450KB, so it would run on most people's DOS machines. It was a challenge, I tell you... and trying to keep the code neat, and tidy... also a fun challenge.
To this day, I'm still amazed at some of the things which people were able to do with QBasic, and QuickBasic... fast raycasters, 3d polygon game engines, even voxel engines!
I think, I'll go looking for all those old Qbasic games. They may not have been much, but they were fun to play.
Using a language vs. knowing what to use it for (Score:3, Insightful)
My life's language arc (Score:3, Interesting)
Atari Basic
6502 Assembler
Fortran
Action!
Deep Blue C
Pascal
Metrowerks C
GNU C
Perl (just enough to make my Unix life easier)
Java
GNU C++
Visual Basic
RealBasic
Have I come full circle? By the time I got to C++ and VB, I was mainly programming for work, but RB has made programming fun again, and I have launched a couple personal projects for the first time in years.
Gold bonus points if you know what Action! was.
BASIC got me going (Score:4, Insightful)
And Windows 3.1 never would have been as accepted as it was if not for VB 1.0. I think VB was probably the thing that got a lot of people on Windows because programming Windows in C at that point was very complicated for the home hobbiest.
Re:BASIC got me going (Score:3, Insightful)
Happy Birthday BASIC but where is the pathway to any flavour of the language now?
Once upon a time BASIC came as a free part of the computer box. A lot of boxes, you turned them on and there was BASIC. To do anything at all, you had to learn BAS
The Janitors Liberation Organization (Score:5, Insightful)
The JLO
Re:The Janitors Liberation Organization (Score:3, Interesting)
He started taking classes and 5-6 years later got a Phd. in entomology. We like to joke around 'If this Phd. thing doesn't pay off you can always fall back on your experience in the janitorial field...'
The lesson: NEVER underestimate
REM Thank You For Bad Habits (Score:5, Interesting)
Eventually I evolved onto qbasic with its functions and subs and (gasp) no line numbers! Then there's VB and VBA. The most fun I've had with those are the shell calls.
On machines that are so locked down that you can't even traverse directories let alone get a shell prompt, you run your form of BASIC, and do basic shells through it or even shell to cmd.exe or command.com -- at one point, I had a really lamed out, simple, featureless, just for fun version of netcat that executed shell commands, piped it to a text file, and had the text file's contents sent through the network. (this with VB's socket stuff). If nothing else, it was a good way to make fake Novell login prompts in the mid 90's.
In the end, not a lot of people will be taken seriously for knowing BASIC, but since it was the first language I used, I appreciated the retro code.
a BASIC error (Score:5, Funny)
11 PRINT "Happy Birthday to you"
12 PRINT "Happy Birthday dear BASIC"
13 END
Dammit... Missed out a line. Now I remember why I should always increment line numbers by 10.
Re:a BASIC error (Score:3, Informative)
Re:a BASIC error (Score:4, Funny)
10 gosub 60
20 gosub 60
30 print "happy birthday dear BASIC"
40 gosub 60
50 end
60 print "happy birthday to you"
70 return
(tested in MS Office XP VBA, will not work in vb.net as gosub has now gonesub and will not return)
Why BASIC was good (Score:5, Insightful)
But the old line-oriented BASIC had some advantages in the bad, old days:
1) Interactive editing is difficult to do on a teletype -- many schools only had a hardcopy terminal to a timeshare service. Being able to drop a line in the middle, or retype a single statement really really helped learn what was going on, without having to re-send the entire program. Even with a primitive CRT, full-screen text editors were of poor quality -- dropping in statements helped to debug and fix features.
2) Later, it was ubiquitous: You could write the same abusive repeating naughty-word program at a Radio Shack, an Apple Dealer, or a department store selling Commodore PETs.
3) It beat COBOL or FORTRAN. The only thing with BASICs interactivity might be FORTH -- imagine if we'd been saddled with page-delimited, stack-based code in all our micros. It's a lot harder to learn, but would have helped modularity and library development.
Consumers vs. Creators (Score:5, Interesting)
I must admit that I share his lament. The programmer-to-user ratio got considerably worse as the ubiquity of computers increased.
When I got my first computer (comment hoping skip the 'geek pissing match'), the majority of other people with computers were using them to write programs. As the PCs (now workstations) got adopted (then coopted) by 'business' for them to do their thing, the computer became a 'tool'. I never stopped programming, but all my non-geek friends started to get in on the computer-owning game. Most of them couldn't write a line of BASIC with a gun to their head, even though they have the capacity to do so, but gosh, they all thought they were just whizz-bang computer users! *sigh*
As a colleague of mine (and a really amazing programmer) once said: "Accessibility is the yellow brick road to mediocrity"
insensitive clods (Score:4, Insightful)
60 PROFIT! (Score:4, Funny)
-------------------^
Command Not Found "PROFIT"
Memories of First Programming (Score:3, Informative)
...of typing in BASIC programs on a Teletype with a large roll (yes, just like bathroom towels) of yellow newsprint on a Data General Nova. [ed-thelen.org]
And, to write and read my program - paper tape!
In those days, having a machine do math for you, math that would otherwise be tedious crunching by hand, gave me a sense of wonder and power.
And lo...... (Score:4, Funny)
shouldn't that be... (Score:3, Funny)
60 PRINT "COOL! I USED TO PROGRAM ON MY APPLE
70 GOTO 50
CVS
The old days were better for beginners. (Score:5, Insightful)
Seriously, though. The computers of the 80's were great for learning programming on. Not that BASIC is a good teaching language, but it was accessible and simple.
Modern computers have too many features that you want serious programmers to have access to (complicating languages), and modern languages have all sorts of safety, structure, and OO features that are great for serious programmers but also complicate things for beginners.
Breaking into programming is much harder than it used to be.
10 PRINT "3-2-1 Contact Got Me Started with BASIC" (Score:5, Interesting)
First programs included the standard:
10 print "Enter your name: "
20 input NAME$
30 print NAME$ " is a doofus."
40 goto 30
About that time, I started getting 3-2-1 Contact Magazine, a science and nature periodical written for kids who had grown out of Sesame Street and The Electric Company. In the back of every issue was the "BASIC Training" feature, which had simple games and programs for a variety of platforms. The IBM versions were usually the only ones I could use; Apple IIe and Commodore 64 PEEK and POKE calls were meaningless in Mac MS-BASIC.
But later, BASIC facilitated an (extremely sketchy) introduction to the Macintosh toolbox. MS-BASIC on the mac had built-in pseudo toolbox calls so that you could change fonts, draw graphics primitives and buttons. I ended up writing a grade tracking program that was a snare of interwoven GOTOs and GOSUBs.
I breezed through two years of programming courses in high school and learned C in my own time. Looking back, I'm a little ticked off that my HS didn't offer "real" computer science with Pascal or C or any sort of AP treatment.
Then I learned Perl. Now I do websites. I've forgotten most of BASIC. I have been told this is a good thing. But sometimes (actually, lately, more and more) I have to deal with VBScript and I see "LEFT" and "MID" and I think "what the hell is this crap?"
Ah, memories.
I feel sorry for all the BASIC bashers (Score:5, Insightful)
In defence of BASIC (Score:5, Insightful)
1. When I and many other people started out with computers, BASIC was the only game in town. Yes, there was assembler and other languages, but its easy to forget these days that information was hard to come by pre-web and indeed, for children who don't have the disposable income for specialist magazine subscriptions. Libraries typically had a couple of computer books, but these would be non-specific description books (that no longer exist as genre really) explaining that a computer had ROM, RAM and you could hook it up to a printer and a VDU! etc. etc. They had hand-drawn "screenshots" of space invaders and pac-man. BASIC was easy enough that we could get started without being put off. On Slashdot its easy to be intellectually macho, but theres a lot to be said for a low learning curve that encouraged you ever onward.
2. BASIC today. Well, its probably not for serious programmers. However, what is often forgotten here is that not everyone who programs is a professional programmer. Or wants to be. For very simple programs, GOTO is no sin. At least when the alternative is no program at all and, say, organising data in a text file by hand or "manually" in Excel or something. Bad habits are not a problem here, because one is never going to go on to have to write mission critical software in C or whatever. I know there are modern scripting languages that are perhaps just as easy to use, but you might be surprised how many people you might have thought have difficulty programming a VCR will break out QBASIC or VB when they need 20 line quicky knocking together and the programmers are "busy until further notice". Its easy to belittle this from a position of knowledge and authority, but relatively speaking these people are your friends in a landscape of PHBs that think programs just happen.
So in conclusion, BASIC is often better than nothing. That might sound like feint praise, but like I say, for the non-specialist that can be quite a valuable thing. Computer programming for the masses. Mock it at your peril.
BASIC? That's too newfangled for me! (Score:5, Funny)
My first BASIC project (Score:5, Funny)
After learning the basics, I started my first project - a random text generator. I wanted to see if, left to its own devices, the Apple II would eventually reproduce the works of Shakespeare. Or at least, produce a few dirty words on its own.
I spent two days coding (never having used a keyboard before, typing was arduous)
The program went like this:
10 A=INT(RND(1)*30) +1
20 REM
30 IF A=1 THEN $B="A"
40 IF A=2 THEN $B="B"
...
340 IF A=30 THEN $B="."
350 PRINT $B;
360 GOTO 10
If I recall, there was no "copy" or "paste" function in the boot ROM AppleII BASIC. Typing this was hell on my 9-year-old fingers.
The good news is, the program worked. The bad news is, after I'd finished it, the teacher showed me how to cut 29 lines out of my program using the $CHR() function. I wanted to shoot him.
All in all, BASIC served me well. It's a great intro programming language for pre-teens.
Before we dismiss BASIC as a simple language (Score:5, Insightful)
I remember how I got into programming in school - we had these BBC computers [retro-trader.com] which could run BASIC. The language was simple enough for me to understand and intuitive enough for me to actually like programming. (Before that I had seen an aunt learn COBOL and the very look of the language frightened me)
Sure, BASIC is not as advanced as C, BASIC uses GOTO statements, BASIC (not QBASIC though) uses archaic line numbers (but still not as archaic as the Fortran 77 tradition of having to write everything after 7 spaces), but BASIC is the best tool to introduce an enthusiastic person to the world of programming. See this example: In BASIC you would show the person:
10 PRINT "Hello World"
20 END
Bingo, the person magically sees his first program work. Try the same thing with C:
#include
int main(){
printf("Hello World\n");
return 0;
}
See how much more you have to explain? Ever tried to explain stdio.h and int main to someone?
Re:Before we dismiss BASIC as a simple language (Score:4, Insightful)
Yeah, my uni teaches Java to first years. Java is a nice language (and the uni programmers put together a library to hide most of the exception handling) ... but your first program looks like this:
We were basically taught to type "public static void main string args" as an invocation that we would (hopefully) come to understand more in later weeks...
Office Max, Casio Basic Calc $5 (Score:4, Interesting)
When I vacationed in Canada a few years ago, I took my TI-83 to convert currency and measurements for me. But, I found an even bigger need during the trip... converting CDN$ per litre of "petrol" to USD per gallon of gas. Things made a lot more sense at the pump.
Re:ahem (Score:5, Informative)
Re:ahem (Score:3, Informative)
Re:ahem (Score:5, Funny)
20 PRINT "Born: 1964"
30 END
Re:ahem (Score:5, Funny)
20 PRINT "Born: 1964"
30 END
25 PRINT "Spell checked: Never"
RUN
Re:ahem (Score:5, Funny)
Re:I miss the simple life (Score:3, Funny)
Edsger Dijkstra? Does not like it (Score:5, Interesting)
What it really means is that the programmers won't program exactly the way Dij wants them to do. It is not "good" or "bad": just different. Programming should not be a straitjacket: the more options and the more different ways to do thing, the better. Those who think that there is no place for anything like a GOTO should look at html.
Re:Edsger Dijkstra? Does not like it (Score:3, Funny)
Or.... (Score:3, Insightful)
Or the programmer did think about it, and the use of the GOTO (or equivalent "jump over here!" coding tool) caused no problems in regards to these issues.
Re:Troll? Moi? (Score:4, Informative)
Loops and functions keep things neet, organized and structured (assuming a half-competant programmer)
This isnt a point of view thing. Some things are confusing and some arent, thats just the way it is.
Try maintaining code full of goto's. Good luck.
Re:Troll? Moi? (Score:5, Interesting)
Ever tried to sift through someone's OOP program that is poorly documented and methods are badly named? It's just as bad. Ever seen a method that calls six others methods in different objects in it's body which are all overloaded 5 or 6 times? Bad/Sloppy programming spans all languages and isn't confined to a goto statement.
How about poorly named method signatures? For example
String getNumber(String x, int i, boolean q, vector a)
I've seen crap like this before from programmers.
Try maintaining code full of goto's. Good luck.
No it's not the best thing in the world to do, but if it's well documented it's not as bad as you make it out to be. I started out in basic when I was 7, and I work now as a Java programmer. I would gladly take well commented code with GOTO's over poorly done OOP code.
Re:Troll? Moi? (Score:5, Insightful)
I've had to maintain programs written by developers who, like you apparently, separated out the maintainability aspects from their concept of "well-written" code.
Well written code does not mean written fast - it means the next guy down the line, after you've moved on and forgotten about it, can easily follow the logic and make changes with minimal effort. GOTO's almost never facilitate this. Please trust your peers on this - it's been debated often enough and long enough by those in the know that it's no longer a subject for reasonable debate. In fact, defending the use of GOTO usually shows one of two things:
1) Inexperience -or-
2) Old Age (meaning the behaviour is so ingrained one simply can't comprehend anything different).
Of course, I'm assuming you have the option to not use GOTO. If the language you use has no control structors other than Jumps and Labels, then obviously you have no choice. But I would argue that even if that's the case, you're probably using an old language for one of two reasons:
1) Not experienced with anything else -or-
2) Too old and stubborn to move on to anything else (meaning the behviour is so ingrained that you probably sit alone in the corner pumping out Cobol not even aware that you were laid off months ago and replaced by the Janitor who took a crash course in Javascript).
Re:WHY! WON'T! IT! DIE! (Score:5, Informative)
Microsoft certainly doesn't claim that.
Nor do they claim that
They do claim that, because it's true.
BASIC was always the applications and scripting language at Microsoft. For a long time, DOS and the early Windows shipped with a free basic interpreter (sadly, those days are over).
Visual Basic remains one of Microsoft's flagship products. It's philosophy is similar to the original BASIC philosophy: you shouldn't have to be a comp sci graduate to write computer programs. Whether VB succeeds in that regard is another question, but it's what they intended.
BASIC is still Microsoft's language for application automation (think Visual Basic for Applications), Web development (ASP with VBScript), and as a tool control language for gluing together objects written in lower level languages. In a sense, some form of BASIC fills the roles in Windows that Scheme, Perl, and TCL occupy in UNIX.
Re:WHY! WON'T! IT! DIE! (Score:3, Interesting)
However, all Microsoft Office programs that support Macros do ship with Visual Basic for Applications... with which you can write simple-interface BASIC programs. I've used it on several occasions in cases where I wished I had VB on a machine for a short scrappy program...
Re:WHY! WON'T! IT! DIE! (Score:5, Informative)
VBScript is surprisingly capable. Read more about it here [microsoft.com].
Windows NT, CMD + QBASIC (Score:5, Interesting)
All of these can be started as an editor, eg QBASIC / EDCOM
On the other hand, only vers 1.1 can read the dos help file HELP.HLP.
Amusingly, Windows understands what a QHELP file is, that if you click on a quickbasic help file, it says 'this is a DOS help file', whereas any other help file (eg 4dos.hlp), it says "unknown format".
In any case, basic shipped with msdos, because in older times, computers had a rom-basic in their bios.
GWBASIC is a standalone emulator for graphical workstations (ie workstations that replaced the rom-basic with video memory).
BASIC in its raw form continues to affect the way that COMMAND.COM and CMD.EXE work. For example, if one does a test, and it is false, the rest of the line is skipped. In the sample below, we see two statements, separated by an &. If one makes the if statement, one gets neither command, while if the statement is true, both work.
One can implement a die style command by this, or by replacing echo with set, pass a parameter to a subroutine. In any case, it's dodgy.Re:WHY! WON'T! IT! DIE! (Score:3, Funny)
That was a great help file (Score:3, Interesting)
I learned the majority of basic programming just by following the hyperlinks in the help file. Almost every function came with a useful example program.
The whole help system in q/quickbasic was very well done. You could point and click on a function and bring up its help entry IIRC.
Re:WHY! WON'T! IT! DIE! (Score:3, Informative)
This was at the same time as Borland came out with Turbo Pascal, so there really wasn't any incentive to learn MS-BASIC. Especially as computers were beginning to be networked to UNIX servers.
Re:WHY! WON'T! IT! DIE! (Score:3, Informative)
Latter when IBM was going to get into the home computer market with there PC they went to Microsoft to buy bas
Re:Spinning in his grave (Score:3, Informative)
VB is a power tool... if you use it correctly you can get a simple program done faster than you could in C. If you use it incorrectly, you end up with a memory hog application that could have been written better in C.
Re:Spinning in his grave (Score:5, Insightful)
The comparison I believe the original post was making was between a good VB app and a good C app and between those, I'm guessing the C one would be better.
-N
Re:Best Headline Ever (Score:3, Informative)
Since when can you play sounds with JavaScript? (Score:3, Interesting)
No, I meant Java. There are lots of people who are not professional programmers who use Java, particularly to write applets for web pages. I brought up two common things those applets do, play sounds and rotate images.
First year comp sci classes often use Java as their language. There's no sharp distinction (to the beginning programmer) between the language and the libraries and APIs. Sun marketed the free SDK towards individual home users. I was pointing out that in those senses (alleged ease of learning