Test automation is nothing but software development intended to test.It requires same programming skills, approach and practices.Just like software development we have choices for technology stack, infrastructure and language for Implementation.
Your choice for test automation language and stack is important but not obvious because there is no best choice for everything, you need to find what is right for you.
Ask Questions, Find what you need
Fist you need to ask the below question and understand what you need
Choose the Language based on needs
below are the popular language choices with their scores for listed factors
I will recommend you to choose ruby as a primary language for automation ,but why ?
- language for humans. A well written Ruby code can be read by a non-programmer and can understand its flow without getting diverted with language
- readable, implicit and less verbose i.e less code
- choice of third party libraries and support
- support for build automation like rake
- debugging is not straight forward
- less job openings (lol)
Clearly there is no single best language, but based on above points you can decide the right technology stack and language. You may also want to choose multiple languages over your stack for example Ruby for Web,API.Mobile testing automation along with cucumber and Java/python for performance testing and monitoring.