Jack of All Trades, Master of None
This discussion often starts with the question if you want to be a Jack of All Trades and Master of None, or someone recognized for your distinguished knowledge in some area.
Being a Generalist will give you some opportunities while being a Specialist will give you others.
I will give you some questions to ask yourself, and according to your answers, you choose what do you want to become.
Where do I want to work?
A good question to start and as yourself is "Where do I want to work?".
This one matters because some markets are more developed than others.
Meaning that, in some places, you will be able to specialize in one thing and find several jobs while in other places you have to be able to do perform many different tasks.
Luckily, in today’s world, remote work is very common and you might become an expert in a skill that is in high demand in many parts of the globe.
Big Company or StartUp?
At big companies with thousands of employees, you are most likely going to specialize in something.
First, since the company has many people, a team can focus on something, and people in this team can focus even more.
Second, consider that a big company usually pushes the edge of computational needs, with extra-large databases, millions of users.
For situations like this, having a decent knowledge of databases is not enough, you have to be a specialed DBA (Data Base Administrator), and even then, you will specialize in some specific product like Oracle, PostgreSQL, or SQLServer, for instance.
On the other hand, in startups, you have to take care of servers, databases, deployment, everything.
With cloud computing, most tasks became much easier, at the cost of actually learning a platform like AWS, Azure, or GCP.
And even then, at some point, you will have big enough needs that will require you to dive deeper into these platforms.
Freelancer, Entrepreneur, or Employee?
As an entrepreneur, you have to wear many hats.
If you are also a coder responsible for building the product itself, this means that you, as an entrepreneur has even more hats to wear.
Entrepreneurs are generalists by default.
Freelancers have a choice.
If you look for work on global platforms, even if you are very specialized, you might find more than enough gigs to make good money.
And the more specialized you are, the more you can charge per hour.
Freelancers who are generalists usually make less per hour, but they always have gigs.
Finally, as an employee, you can follow the same idea of the section "Big Company or Startup".
The bigger the company, the more you can specialize.
Hybrid
There is a lot of talk about the "T-Shaped" developer and similar nomenclatures.
This kind of professional is a combination of Generalist and Expert.
You specialize in at least one thing while being average on many others.
This is mostly doable in a sub-niche.
For instance, if you are a DBA specialized in Oracle Databases, it doesn’t hurt to know some stuff about other databases.
You won’t be as effective, but at least you know how to ask the right questions when you lack enough knowledge in a given situation with tech you are an expert in.
Specialist or Generalist?
If I had to choose, I would totally go for Generalist.
If you just choose to specialize because you heard about this super hyped tech, you are just taking a bet that might or not pay off.
If, and only if, your actual job or opportunities force you to specialize in something, then you go deeper and become an expert in it.
Taking this route will automatically turn you into a T-Shaped professional while you don’t run the risk of specializing too early.