Writing test scripts in the same language that the app was written in is typically the best path because it enables your organization's developers to easily read and write test code. Plus, the test code can live in the same repository as the application's source code. Every situation is different, though, and you may not be able to use the same code as your application. In some scenarios, the application may already be written and won't be updated, so it's irrelevant if developers need to read your test code.
One of the most crucial decisions when writing your own test automation scripts will be your choice of programming language. Selection of a test automation language depends largely on the language an application was developed with, but there are other factors to consider.