My first rough contact with python was on a translation mission. I was meant to convert a javascript code written in Google Earth Engine to python. To my -limited- knowledge, I had one of 2 choices. Either using the Earth Engine API in Python or translate the code entirely to Python. I went with the second choice, honestly, because I have hit some walls with the first.
Anyway!
This exercise brought to my attention the analogy between translating programming languages on one hand, and translating spoken languages on the other. What is going on there and how are both similar. Or even different?

Spoken Languages and Programming Languages
Well, first, in both we have syntax and structure to deal with; sentence formation, grammar, and word order for the spoken languages and syntax rules for programming languages. Try to forget an “are” in They are playing. And keep waiting for an output from writing print(raster.shape).
Then, dare and not understand the semantics in each of the two translation processes. If you think you can successfully translate a spoken language or programming language without understanding the meaning of the words and sentences in the first and expressions and line code content in the second, well, good luck!!
Most important of all is the element of adapting to the translated environment. The SL being translated needs to adhere to certain conventions abided by in the targeted language. Same, converting a code from javascript to python requires sticking to the conventions of writing the targeted language. I wonder here, is this more strict for spoken or in programming languages?

Spoken Languages but Programming Languages
The first differs from the second in the nature of its content. Translating English to French needs to take into consideration the context and certain cultural nuances. As for the translation of programming languages, here the level of precision needed is significantly higher. No room for subjectivity.
Human translators vs. machine translation. The first group would do a great job for spoken languages, knowing that the machine can help heaps when it comes to translating a long document in a short time. As for the programming languages, machine translation wins most of the time.
Testing and debugging, here’s a third disaster. Cultural sensitivity and proofreading do not really have equivalents on the programming languages side. Or maybe, they are names differently? running the code, testing it, and debugging the code rule over in programming languages.
To wrap it up
Actually, to close this intense subject, there is a bit of similarity in the differences and a bit of difference in the similarities. For example, from experience, machine translation of both types of languages may not be a good idea. That’s why, while acknowledging the importance of languages (spoken and programming), I also acknowledge the importance of the human mind that enriches the process of translating both, more than any other machine.

Leave a comment