home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19546 < prev    next >
Encoding:
Text File  |  1993-01-11  |  2.8 KB  |  57 lines

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