Different languages require different paradigms. You definitely don't write or develop code in the same way, for example. Matlab, Python, C # or C ++. Even hierarchies of objects will vary greatly depending on the language.
However, if your code consists of several interrelated procedures, you can leave with direct line-by-line translation (each language allows you to write two or three interrelated functions, remaining idiomatic). But this applies only to the simplest programs.
Prototyping in a high-level language and then realizing the same idea in a reliable and clean way in a “production” language is very good practice, but it involves two very different things:
- Prototype in any language you want. Test, experiment and convince yourself that the idea works. Pay attention to the big picture, do not focus on performance, but on high-level ideas. Pay attention to the difficulties that you encounter during implementation, since you will again encounter them in step 2.
- Bring in an idea from scratch in a production environment in X. This will be faster than if you hadn't completed the prototyping stage, since most of the difficulties were accomplished in the first stage. Use the idiomatic X and focus on correctness. Pay attention to corner cabinets, overall reliability and correct operation. You will notice that approximately half of your code consists of new things that did not appear in 1. (for example, checking errors, handling cases in the corner, I / O, unit testing, etc.).
You can see that line feed line by line is obviously not a good idea, since you are not translating into the same program.
Also, when not prototyping, I find that I discard the first version and create another that I like better, i.e. I find myself a prototype! Implementing the same thing twice is not a waste of time, it is a normal flow of development.
source share