Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: XBASIC to Perl translator: semantical equity

by Vautrin (Hermit)
on Apr 16, 2004 at 12:17 UTC ( #345736=note: print w/replies, xml ) Need Help??


in reply to XBASIC to Perl translator: semantical equity

The form of BASIC I remember learning about 15 years ago was a very ugly language. There were no functions, so I would use gotos all over the place to roll my own. The code was a mess, and kludgy.

Even if a BASIC => Perl translator existed, or even if you could code one, you most likely would not want to translate your program. The 4000 lines of code would go from being maintainable in XBASIC to very cryptic perl and pretty hard to change without breaking anything.

I would recommend creating the program in Perl from scratch. Make use of an Object Oriented programming paradigm so your code is more efficient and maintainable, and write lots of test cases along the way to make sure everything does what it is supposed to.


Want to support the EFF and FSF by buying cool stuff? Click here.

Replies are listed 'Best First'.
Re: Re: XBASIC to Perl translator: semantical equity
by Anonymous Monk on Apr 17, 2004 at 21:28 UTC
    Its a mess. The BASIC program just outputs some graphics. I would loved to have some numerical outputs that i could test against. But the code is just a mess and i fear breaking it during adding some functionility.

    So its not trivial to collect output to test against.
      The BASIC program just outputs some graphics. I would loved to have some numerical outputs that i could test against. But the code is just a mess and i fear breaking it during adding some functionility.

      With a bit of work, you can treat the graphics as "numerical outputs". If the output is supposed to be pixel-perfect, the graphics files produced by the two programs will be identical. If there's some acceptable range of variation, perhaps there's a way to use one of the image-processing modules on CPAN to help with the comparison.

        Thats a good idea. I will try to dig if the output is artifactless when accessed with perl.

        thanks for this practical idea. Murat

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://345736]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2022-01-24 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?