How do you switch mentally between programming languages

Renegade

Staff member
Luminary
Do any of you work with multiple programming languages at once? How do you switch mentally between them. Or even if you work on say one tech stack on one project and then on another tech stack in the next project, how do you get back in the mould.

For example a ? is a null operator in Flutter but a predicate method convention in Ruby.
 
I am pretty amateur in programming so when I am switching language it is a hassle as I have to start thinking more about the syntax and idiosyncrasies of the language rather that the original program I was trying to solve. Sometimes I get distracted by the language and go off in a different tangent altogether.

Parser helps in simple analysis of code. But recently I properly configured LSP (language server protocol) and that has been a big help when writing code and switching languages.
 
  • Like
Reactions: Neotheone
The solution is to spend time with the language. You practice it enough that it comes naturally to switch between the two like you would with natural languages. Also having rock solid fundamentals help - a "for" loop will work the same everywhere, just have to keep a language reference handy.
 
I have been switching from Python to TypeScript to Java since last two years as different applications in my org have different codebases and we have to work on all as per the need. It was a hassle at first, it takes time to get used to the languages but once you cross this threshold it becomes second nature.