DEV Community

Cover image for From PHP to Kotlin - Day 1 - Setting goals
Fernando Aparicio
Fernando Aparicio

Posted on

From PHP to Kotlin - Day 1 - Setting goals

To switch to another language, you have to learn its structure and rules. But really, to get the best benefit, it's more useful to think about doing an exercise you've solved before using your favorite language and try to solve it using the new one.

Thinking about how to approach the language change, I've done a list of rules so as not to get lost in the transition.


Rules for changing language

  • To start with, find a kata that has varied elements to test your skills.

  • Use the good practices that you already know from your usual language and fight to achieve the same. Never lower the quality!!!
    You may have to rethink certain terms that seemed non-negotiable in your usual language and that are approached differently in the new language... that mental process of arguing why it is different will give you the deep knowledge of the new language.

  • Apply TDD with DDD always. That means that you have to start thinking about how to use the testing framework of that language and then writing the code. As we know, TDD without an structure like DDD is useless. You can do something unreadable but full tested and it's not the goal. Change the language, not the structure.

It may seem a bit crude to fight with the testing framework before the code. But if you have decided to change to another language, it's surely because you've already read something about how it's articulated and you've liked what you see,

so now it's time to get serious (from kindness, of course) and see how to set up the tests with the new language. Having different rules may susprise you and will also make you change your mentality.

You will hardly be able to do the same thing the way you are used to... and tests are no exception. In my case I'll use the mower kata.


Discussion (0)