home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!sun4nl!ruuinf!plato.phil.ruu.nl!hjv
- From: hjv@phil.ruu.nl (Hendrik Jan Veenstra)
- Subject: Re: Conversion of BASIC code to "C"
- Message-ID: <hjv.726759816@groucho.phil.ruu.nl>
- Sender: news@phil.ruu.nl
- Nntp-Posting-Host: groucho.phil.ruu.nl
- Organization: Department of Philosophy, University of Utrecht, The Netherlands
- References: <1993Jan8.183821.20711@adobe.com> <1993Jan10.131651.1@csbina.csubak.edu>
- Date: Mon, 11 Jan 1993 13:43:36 GMT
- Lines: 44
-
- camp5@csbina.csubak.edu writes:
-
- >In article <1993Jan8.183821.20711@adobe.com>, (Scott Sivi) writes:
- >> Does there exist a method or application by which BASIC files can be
- >> converted
- >> to "C".
-
- >You probably couldn't even do it by hand unless the BASIC program was
- >completely flowed and never used a GOTO! The way BASIC programmers spaghetti-
- >code programs, I doubt it's possible. (I'm assuming you won't use goto in C.
- >I wouldn't.)
-
- Ignoring the fact that the above is a rather simplified outlook on day-to-day
- practice, it isn't true either. There _do_ exist programs that translate
- Basic to C -- I know of at least one such package; it's a program for
- translating GFA Basic (Atari ST and PC platforms) to C. I've never used it
- and assume that the output of such a program will be a bit crude -- and
- probably the input source will have to meet some tight constraints as well,
- but in principle it _can_ be done.
-
- And on the spaghetti statement: I agree that there are lots of hobby-basic-
- programmers who write terrible code, but probably the same holds for every
- language. The only difference being the fact that more hobby-programmers
- use basic than C, Lisp or SmallTalk... :) However, I started with Basic
- myself (quite some time ago, fortunately :) and have always tried to write
- as structured and clear as possible (which isn't too hard with modern basics).
- No GOTO's, no GOSUB's, as little global vars as possible, etc. and several
- of these programs _were_ hand-converted to C later on -- without too much
- trouble and without ending up with horrible Basic-like C. And I know quite
- some programmers who write serious applications (commercial apps) in Basic.
- And no spaghetti-code... The days of the "GOTO 1250" are long ago...
-
- But hey, I don't want to start another language-war... :) And besides, I
- don't mean to _defend_ Basic (why do you think I switched to C...?). I
- just wanted to say that IMO it's not _that_ difficult to translate Basic to
- C, provided the Basic-source was indeed written a bit 'decent' (y'all know
- what I mean by _that_ :).
-
-
- --
- Hendrik Jan Veenstra hjv@phil.ruu.nl * How can I save my dreams
- Dept. of Philosophy * in the nightmare, in the flood
- University of Utrecht * But I try.
- The Netherlands *
-