Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watrose.UUCP Path: utzoo!watmath!watnot!watrose!tohaapanen From: tohaapanen@watrose.UUCP (Tom Haapanen) Newsgroups: net.lang Subject: Re: structured assembler (BASIC) Message-ID: <7947@watrose.UUCP> Date: Tue, 25-Mar-86 17:15:40 EST Article-I.D.: watrose.7947 Posted: Tue Mar 25 17:15:40 1986 Date-Received: Wed, 26-Mar-86 03:13:39 EST References: <443@3comvax.UUCP> <7900003@ztivax.UUCP> <153@crin.UUCP> Reply-To: tohaapanen@watrose.UUCP (Tom Haapanen) Organization: University of Waterloo, Ontario Lines: 52 Keywords: BASIC tombre@crin.UUCP (Karl Tombre) writes: >Here is the main point. Yes indeed you must have your algorithm right. But >if you have a structured, clear algorithm, you can write a BASIC program >which is not pure "vomit". Of course it won't be as well implemented as in >PASCAL, C or something like that, but IT IS POSSIBLE TO PROGRAM IN A CLEAN >WAY WITH BASIC. Some hints : put in your comments a description of EVERY >variable (my rule : between 50% and 70% of the code should be comments), So it'll be well documented vomit... :-) >NEVER use the same variable for two different things, use SUBROUTINES in >which you comment about input and output (no undocumented side effects), Input and output from subroutines? But BASIC does not allow formal parameters or returned results! Having to pass input in global variables is gross and practically prevents recursion. >use GOTOs only when you are compelled to do it (in if then else structures >for example), separate your program into distinct parts, ... if...then...else should NOT need a goto and it shouldn't have one forr clarity. Naturally, if the language is brain-damaged enough to be missing the else, you'd need a goto. In my opinion any reasonable programming language has the following features: - reasonable (!) syntax and variable name length - named subroutines, with parameters and results - dynamic local storage allocation (to allow for recursion) - control structures: if...then...else, while...end, for...end, case - data structures: arrays and records, with dynamic allocation possible (to allow variable-sized structures) A case can be made for languages that are missing one of the five (such as APL2 etc.) but "normal" BASIC only has the first feature! There are BASICs that have four of the five, but then they are more like Pascal than BASIC anyway. \tom haapanen / watrose!tohaapanen university of waterloo ..!watmath <-- watmum!tohaapanen \ watlion!tohaapanen I am one in ten, a number on a list I am one in ten, even though I don't exist No-body knows me, though I'm always there A statistical reminder of a world that doesn't care (c) UB40, 1981