Native Language
Before knowing english enough to have a fluent conversation, a transformation always happened. I translated the English sentence to Portuguese, think about it, and then reply back in English. So the thought process always happened in my native tongue. At some point I became good enough so that such translation wouldn’t happen anymore. For very specific things, I still go back to Portuguese, but for the vast majority of things, I know think in English. In fact, my Portuguese vocabulary has deteriorated.
When I work with Python, I often use the same technic. Tasks that I have no idea how to do, are first translated to Swift, and then into Python. It’s a simple mental trick, but something that helps me not feeling overwhelmed. Python is not as expressive as Swift for data modelling, so I am constrained from that angle. The caveat with this imperfect translation layer is that the output is not idiomatic. It’s the same when one hears a joke in English, and it’s impossible to have the same in your one’s language. So the thought process happens in Swift, but the output looks odd when translated. A good example is checking if an array is empty. In Swift one could if array.isEmpty
while in Python if not array
. Or if you are used to count
in Swift: if array.count == 0
you are likely to translate it to if len(array) == 0
. It works, but it’s not idiomatic.
But the same way that transforming from A to B and vice-versa, reading is also a problem. It reminds of when I read French and miss a n’<verbe> pas
. It is elusive when reading code, because an if
is an if
the same with for
s and other constructs. I am not sure what it is, either a combination of Font / Theme being different across Xcode and VSCode. Perhaps something else?