I've worked with innumerable people like this over the decades. The thing is, they're usually not phoning it in. They're really trying hard. They just suck. It looks like they're working hard, because they often show up early, stay late, ask a lot of questions, and produce a lot of output.
It's hard to fire them, because to many outsiders, they're workhorses. They know just enough to scrape by on each task, but they also have institutional knowledge and social connections that make them seem invaluable. Often that institutional knowledge is that they're the only person who understands their own shitty code. Their more-capable peers usually know that they're incompetent, but management doesn't.
There are many reasons people like this can survive. Peers don't want to explicitly throw them under the bus. The best of their peers simply move on--to other projects in the same company, or more often, to greener pastures at another company. Their peers cover for them, because it's easier to work around a millstone like this than it is to get them removed. It takes months of concerted effort to get a peer fired for underperforming. If you want to try to get someone like this fired, it starts to look like you're the asshole with a personal vendetta. Especially because they've been there for a decade and you probably just arrived.
These millstones aren't outright incompetent. On paper they've got extensive experience. Socially they're well-regarded by everyone at the company except their immediate peers who know they suck. They've been faking it and faking it well since long before you arrived, and they'll be doing it long after you've departed.
Make no mistake, though. These people are rarely phoning it in. They are busting ass to tread water. Sometimes they believe their own lies, but more often they are terrified that someone will find out just how bad they are. That's why they work so hard.
Damn, that's me in 10 years. I'm so bad at my job that my only hope is that I go by unnoticed long enough so my time in the company becomes a strong reason not to fire me. It's been almost two years so far. The thing is I really try to improve, and in some ways I even do, but at a painfully slow pace. Even though I've been in this company for nearly two years I've been working as a software developer since 2012. And it hurts so much to see people coming fresh out of college outperforming me by orders of magnitude. It makes me feel really stupid. But is a really well paying job in a somewhat big company, so I hold onto the hope that if I don't screw up things too much my employers won't even acknowledge my existence. In the end I only feel bad for the people I work with (not those I work for) because they are nice and talented people and it must suck to work with someone that lowers the team's bar.
"The thing is I really try to improve", that statement alone makes me think you are not one of these people.
Don't underestimate the value of slow and steady in the world of corporate development. Many fresh out of college might seem like super stars developers that know all the latest buzz word technologies, I know this is a massive generalisation, but they don't like to work on "boring" or "legacy" and often quick to jump ship to the next opportunity.
Also, please be aware that this feeling is a common symptom of imposter syndrome.
Maybe there's a better job out there for you? Either at another company where you'll get mentoring and support for growth, or in an entirely different career. It doesn't sound like you enjoy what you're doing now.
I've stagnated at jobs in the past. I've thought it was my problem. Then I moved on to better places, where coworkers helped each other to excel, where people placed a premium on improvement and education.
If your company shoves everyone into a cubicle and assigns them individual tasks, how are you ever going to learn? If you can get a job somewhere that embraces pair programming, you might find a whole different world. You can be mentored by your coworkers and collectively solve problems, instead of feeling like you need to put your head down and produce something on your own that may be beyond your expertise.
Fresh grads, especially grads out of code schools, often arrive with a lot of buzzwords ready to go, and a script of practices they've been told are the right way, but that's all flash and no substance. It can lead to overconfidence. There's something to be said for it, though; you can fake it until you make it. The important part is that you actually make it in the end, and to do that, you need mentoring. It sounds like you're not getting the mentoring.
I know it's hard to quit a well-paid job and take a chance, but I think that's better than going to work every day hoping you won't get fired, and not growing as an individual.
I actually like this job. We do pair programming regularly, which is the source of most of my worries that I'm not good enough. My team has a dedicated manager whose job is to mentor us in our careers. I like him and he seems to like me, he is always willing to listen and to offer help. I think the company is outstanding in providing a healthy environment. Which is why I feel so out of place. Everyone is so smart and grows so notably much and I feel I'm falling behind.
It's a matter of perspective... someone, somewhere in one of your previous workplaces, might have thought of you exactly as you think of these people. So maybe don't judge too much.
It's hard to fire them, because to many outsiders, they're workhorses. They know just enough to scrape by on each task, but they also have institutional knowledge and social connections that make them seem invaluable. Often that institutional knowledge is that they're the only person who understands their own shitty code. Their more-capable peers usually know that they're incompetent, but management doesn't.
There are many reasons people like this can survive. Peers don't want to explicitly throw them under the bus. The best of their peers simply move on--to other projects in the same company, or more often, to greener pastures at another company. Their peers cover for them, because it's easier to work around a millstone like this than it is to get them removed. It takes months of concerted effort to get a peer fired for underperforming. If you want to try to get someone like this fired, it starts to look like you're the asshole with a personal vendetta. Especially because they've been there for a decade and you probably just arrived.
These millstones aren't outright incompetent. On paper they've got extensive experience. Socially they're well-regarded by everyone at the company except their immediate peers who know they suck. They've been faking it and faking it well since long before you arrived, and they'll be doing it long after you've departed.
Make no mistake, though. These people are rarely phoning it in. They are busting ass to tread water. Sometimes they believe their own lies, but more often they are terrified that someone will find out just how bad they are. That's why they work so hard.