Programmers that know BASIC; are you embarrassed about that? Why?

I’ve noticed that GOTO is usually only bad if you’re using it to jump backwards in your code. If you’re using it to jump forwards, you’re usually escaping a loop structure and the intent is nearly always fairly obvious. In fact, it’s nearly always more obvious than it would be without the GOTO.

(This is assuming the language supports a relatively rich set of looping structures. Which BASIC really does not, BTW.)

My husband started off with BASIC when he was 10 with an Atari 800 he bought with his paper route money, and wrote a bunch of stuff. He’s now a software engineer, of course, and I think he’s pretty good at it.

Even I did a few things in BASIC as a kid on our TI–I remember particularly spending hours and hours typing in a game program from a magazine, which of course did not work.

I don’t agree. The danger of using GOTO to jump in ANY direction is it can be done without regards to the stack or heap status. If the stack gets out of whack, you’re in for a heap of trouble.

(If you don’t know that those terms mean, we will have a hard time discussing this topic intelligently, but I don’t mind explaining if someone asks.)

I don’t think anyone would be so bold as to say that the derision toward BASIC is ALL attributable to nerd machismo, but I don’t think it can be denied that there is an element of it.

Are you saying it’s instead because BASIC is fundamentally badly designed? How so?

You had assembler commands? Lemme tell you something, young whippersnapper: I learned programming in machine code. Nothing but ones and zeroes. And we liked it! Ouch! I think I broke my hip typing that.

Dad? Is that you? :smiley:

I learned QBasic in 4th grade at Montessori school. My friends and I used to make horiffically violent little text-based games with it, complete with music. I also learned a little VisualBasic. I don’t remember much of it now, though.

I still use QuickBasic routinely, it’s great for text processing.

Also write front ends in Visual Basic 6.0.

You had it easy. I had to enter my programs on the front panel using a single switch. Kids these days…

[Ada Lovelace]You are all a bunch of whiny punks. I invented programming. Hell, I didn’t even have a machine to program, just a bunch of half-assed models and drawings that Chuck B. spewed forth when he wasn’t busy spewing last night’s bender. He lets me ride his “Difference Engine”, but I don’t know why I still put up with all his weird shit anymore.[/Ada Lovelace]

An element. Yes. But there’s way too many posts here apparently denying that it’s only a small element.

To make it clear: By BASIC I mean the microcomputer BASIC dialects of the 1970s and 1980s, such as Commodore 64 BASIC and GW-BASIC for MS-DOS. I do not mean any BASIC that has significant elements of Pascal added in, such as QBasic. I sure as hell don’t mean Visual Basic.

To list the bad design elements. Keep in mind that I consider all of these pretty much fatal:
[ul]
[li]Complete lack of local variables. A local variable is a variable only visible to a specific part of a program. A lack of locals makes it impossible to easily reuse parts of that program.[/li][li]Single-character variable names. Maybe not universal, but very common. Made it essentially impossible to write readable code without massive amounts of comments.[/li][li]Complete lack of most control structures. A single loop construct is not enough. This makes reliance on GOTO inevitable and reading the program hugely difficult. Some dialects had more control structures than others, but none really had enough.[/li][/ul]Those three points make it impossible to develop programs beyond a certain size in BASIC, and that size is quite small. There were better options available even back then (Forth, for example, or a cut-down Lisp dialect) so the designers had little excuse.

Any language that lets you jump outside the current function should be put out of everyone’s misery. I was thinking in terms of C when I made that post, which is probably confusing in this thread. (Yes, you can use goto in C to jump beyond heap cleanup code. But you can fail to clean up the heap in C in a lot of other ways, too, so blaming goto hardly seems fair.)

>BASIC is fundamentally badly designed

This is a fascinating point.

As a beginner’s all-purpose symbolic instruction code, which is what the name means, it’s pretty well designed (I propose so anyway). The fact that forth graders entertain themselves with it helps prove this. BASIC did a pretty good job of giving people who didn’t know what programming was a tool that they could learn.

As a general programming language, it’s clumsy and tends to encourage unrecoverably messy programming. But I gather it wasn’t supposed to be a general programming language. It would be better to say the fault lies with people who try to keep using it after their first few lessons, or all the people who enhanced it over the years and tried to make it the last language we learn rather than just the first.

If they had called it TrainingWheels, perhaps the intent would have been clearer and we wouldn’t be debating it now.

You had ones???

Napier: Pascal is proof by demonstration that even teaching languages don’t need to be as badly-designed as BASIC. They were both designed in the 1960s so language experience to date doesn’t really enter into it: BASIC was just designed by a bunch of FORTRAN-heads while Pascal was designed by someone who realized the future would look like Algol. The fact BASIC came to look like Pascal proves my point rather well.

Don’t get me wrong. Pascal is far from what it should have been, too. (An array’s size should never have been a part of an array’s type. Luckily, nobody copied that misfeature and most people learned on the relatively sane but completely nonstandard Borland implementations.) However, Pascal is much better for the purpose of teaching good programming habits than BASIC could ever be without turning BASIC into a Pascal dialect.

These days, both BASIC and Pascal should be ditched in favor of Python or Ruby or Scheme. (SICP is a wonderful book.) Python, Ruby, and Scheme have the advantage of being real languages that don’t seriously hinder people trying to solve real problems. Back in the 1970s and 1980s microcomputers couldn’t deal with anything so complex, but not even that excuses BASIC: There were Pascal and PL/M implementations for CP/M-80 back in the 1970s.

Yep, but the cost of disk drives at the time meant that CP/M was out of reach for most people. 8-bit micro developers stuck with memory efficient ROM based interpreters, and that meant BASIC. As drives got cheaper with the Apple II, Pascal got a bigger following.
Actually, FORTH is the only other language I can think of that was delivered as a ROM based interpreter. I always wanted a FORTH conversion ROM for my ZX-81 - I never got one, though.

Si

The only thing that bothers me about BASIC is its inability to get at the machine. Bring back PEEK and POKE into Visual Basic Dot Net, and you’ll have a damn good language.

Knew it? There was a time in my life when I was paid to write it.

There are actually programmers out there who don’t know BASIC? I thought everyone learned it at some point or another.

I can’t say I’d ever actually use BASIC for anything (even my quick-and-dirty three-liner programs are in C, any more), but of course I know it, and of course I don’t think that’s shameful in any way.

As a high school computer science teacher, I’d say BASIC has completely outlived whatever usefulness it may ever have had as a beginning programming language.

I teach a class here that is basically “remedial computer skills”. These are students who couldn’t get a C on a multiple choice test of Office 2003 functions, or couldn’t be bothered to try. We do a semester of Office and a semester of web design. Toward the end of the first year of teaching this, I threw in a little Javascript for variety, and damned if these computer neophytes and technophobes weren’t grasping OO concepts inside of a week.

Javascript is a wonderful language. Better than Java, really, especially in terms of its OO model. It’s too bad people think it can only be used in the context of a web browser.