Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3622836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:18:31+00:00 2026-05-18T23:18:31+00:00

I don’t want an automated solution. When you have to translate a program from

  • 0

I don’t want an automated solution.
When you have to translate a program from a language to another, what do you do? You prefer to rewrite it from the beginning or copy and paste it and change only what need to be changed?
What’s the best choice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:18:32+00:00Added an answer on May 18, 2026 at 11:18 pm

    It depends on

    • the goals (quick hack for one time use? long-lived production project for work?)

    • the resources I have (how many man-hours? Test suit and/or functional spec for old code? familiarity with both languages?)

    • most importantly, differences between the languages. Both the conceptual (OO? functional? reflection? control structures?) as well as available libraries.

      Please note that this bullet is not as trivial as it seems – this depends in large part on how idiomatic the original program is – as an example, some people write very “C-like” Perl code (e.g. using C control flow and very C++ like OO design) which can be trivially copied to C or C++, and some people write incredibly intricate idiomatic Perl using functional programming, closures and reflective capabilties; which can’t be obviously translated into C/C++.

    • Also, quality of the original code. E.g. good program will have separated business logic, usually expressed in standard configuration and control flow that’s easier to directly clone.

    E.g. translating from PHP to Perl for a hack job, you can often start out with copying, since many PHP constructs can be 1-to-1 mapped onto equivalent Perl constructs (just take your pick of Perl templating web library). The resulting code won’t be GOOD Perl but will be Good Enough for some purposes.

    On the other hand, translating, say, LISP code to Java, you’re better off just translating the original code into a functionality specification and re-write from scratch. Your example of Python and JavaScript is probably in the same box.

    Usually you have two languages that share at least some concepts (e.g. both have OO, and some imperative control structures) and thus you end up with some combination of the two approaches – parts of the code can be “thoughtlessly” translated, parts need to be re-written from scratch.

    The more of the second (complete rewrite) approach, the better quality idiomatic and powerful code you end up with.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't have much PHP experience and I want to know how to best
I don't understand where the extra bits are coming from in this article about
I don't want PHP errors to display /html, but I want them to display
I don't want to take the time to learn Obj-C. I've spent 7+ years
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't get me wrong, I want them to get saved. But I always thought
Don't know if this has been answered before. Have custom routes to users. If
I don't like Jackson. I want to use ajax but with Google Gson. So
I don't have any experience in updating a Rails app and when I google
I don't know when to add to a dataset a tableadapter or a query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.