colin@vu-vlsi.UUCP (Colin Kelley) (03/28/86)
Yes, BASIC does suck, but check out some of the simple BASIC that Peter Norton writes. If you've got to use BASIC, that's the way to do it. Typical program: 100 GOSUB 5000 ' Big comment here saying what 5000 does 200 GOSUB 6000 ' another big comment 300 GOSUB 7000 ' etc... 500 END ... His programs typically do very little in lots of space, but they're not bug-ridden! And it's usually pretty obvious that the programs are inspired by (if not directly converted from) PASCAL... Of course, one of the MANY problems with BASIC is that if this program has to do anything other than a simple demo, it'll do it so slowly that it's useless. But even a seventh grader can show you how to speed it up: - delete all those damn comments, - shorten variable names to 1 or 2 characters, - remove all unnecessary blanks (like for indenting), - change the subroutines to inline (!) code, - get rid of the variable name in all NEXT statements, - and then combine lines together right up to 255-byte-per-line limit! But of course, seventh graders are experienced BASIC programmer already; they know to write their programs like this from the beginning! (And of course, they run a global renumberer every couple minutes!) As you can probably tell, I've been through this stage. Fortunately, though, I followed it through long enough to write long, poorly-written, bug-ridden, useless programs. I found that impossible to avoid. But when I took my first PASCAL course about 5 years ago, I saw the light! I was already an assembly language hacker by then though, so I found it annoying not to be able to get to the low-level stuff when I needed to... then... you guessed it... C! Now I'm a happy programmer. How many other people out there started with BASIC? I'm curious if there are other people who wound up avid BASIC-haters precisely because it was the first language they learned... -Colin Kelley ..{psuvax1,pyrnj}!vu-vlsi!colin BTW: don't interpret my first paragraph as a compliment to Peter Norton. The man obviously has one of the biggest egos around already! (Witness all his products, even back in the early days of PC magazine when he could only afford a small ad, that invariably show his picture, with his sleeves rolled up, ready to take on the world...)
jso@edison.UUCP (John Owens) (04/07/86)
> But of course, seventh graders are experienced BASIC programmer already; they > know to write their programs like this from the beginning! (And of course, > they run a global renumberer every couple minutes!) > > How many other people out there started with BASIC? I'm curious if there are > other people who wound up avid BASIC-haters precisely because it was the first > language they learned... > > -Colin Kelley ..{psuvax1,pyrnj}!vu-vlsi!colin > I seem to have followed almost the same path that you did. I started out with only 4K of RAM, so I tended to fanatically optimize my programs for space as well as speed, even to the point of starting with a goto to the bottom of the program, and having often-used subroutines at the top of the program, in order of use.... I even restorted to multiple ELSEs per IF, and all those other horrible things. I found that I could write relatively bug-free code, as long as I did it all in a short period of time. If I tried to come back to it later, I couldn't ever keep straight all the side-effects of things, and had a terrible time. Nowadays, I use basic for small (less than 20 line) programs, occasionally, but I shudder at the idea of a large program written in BASIC. (An unnamed contractor recently wrote a *LARGE* software package in BASIC, and it would be impossible for anyone else to maintain, even though the author went to reasonable lengths to keep it structured.) So I suppose I don't hate BASIC, I just consider it impractical. -- John Owens edison!jso%virginia@CSNet-Relay.ARPA General Electric Company Phone: (804) 978-5726 Factory Automation Products Division Compuserve: 76317,2354 houxm!burl!icase!uvacs ...!{ decvax!mcnc!ncsu!uvacs }!edison!jso gatech!allegra!uvacs