It's better to be a T shaped developer. This helps you become a better team player too. If you have a good understanding of the process involved in front-end, back-end, product, design etc, you can practice empathy better when working with other people. You get to learn a lot from different languages, frameworks, philosophies etc that you can use in your work. If you wanna start something on your own at one point of your life, you can do it by yourself