If you are new to coding or software engineering, I would suggest sticking to one programming language until you are comfortable with it before trying to learn another one. A good test is to see if you can read through someone else’s codebase and offer suggestions. That gives an indication of not only how comfortable you are to offer suggestions but shows how confident you are.
Rule of thumb: if you understand and can apply these principles – K-I-S-S (Keep It Stupid Simple), D-R-Y(Do Not Repeat yourself), and Y-A-G-N-I (You ain’t gonna need it) – to the programming language you are currently working on at work or learning, then you are probably ready to try another language.
Learning your first programming language takes time and effort. To understand syntax, conventions, and general rules of that language takes long hours of frustration and commitment. But the fun should not stop after learning one.
I once worked with an iOS developer who had also built the android app that I was working on at the time. I was surprised by how good the code quality was, so I asked him how was he able to write for both platforms and to a good standard. Firstly, he told me that he has been a programmer for over 20 years and that picking up another language was fairly easy for him. Secondly, he said that he just explores a lot of the time and tries something new in his spare time. The latter stood out to me, as I like to try different languages here and there but I find that the code quality drops as I am still getting to grips with a new programming language. Then I took the time to reflect on the fact that I have been fortunate to work on a lot of different programming languages in my career. I remembered how quickly I was able to learn Kotlin and then switch to java without any issues.
The first reason why you should experiment with another programming language is that your aim should not be to become the best Swift developer or Java programmer, but you should want to be a great software engineer. As engineers, we have to solve problems daily, be it complex or simple. We have to know what tool best solves our problem, so having exposure to another programming language really helps in finding better, easier and quicker solutions.
To wrap up, do try and expose yourself to different programming languages as there are huge benefits. The documentation will always be there to help you in case you forget when you come back to your first programming language.