Ask HN: I got duped into working on legacy code, should I leave?

62 points by throwawaysbdi ↗ HN
I recently moved cross country to work on what was supposed to be a fairly nice, new stack. I love my new city but the job is killing me.

Its legacy code dating back more than 20 years. I'm afraid that my skills will rot if I stay too long. The code quality is also horrible and its making me hate coding.

The company talks about how we're just around the corner transitioning to newer stuff. After talking to some veterans, apparently it's been "right around the corner" for years.

I was hired for my React and Typescript skills/interest and it's been months with no signs of being able to use them. I'm not good with their current stack but I have no interest in learning it because its so obsolete. I'm beginning to think that they mislead new employees because otherwise they would ask for a lot more money or walk away.

I'm torn about my best course of action. I'm not good at my job because I don't know their tech. I'm not good with their tech because I hate it and I'm bitter that I was lied to. I can't mentally force myself to learn this ancient shit. On the other hand, they're paying me, so I owe them something right?

The best solution for me is definitely to just get a job somewhere else, but I've only been at my current job for a few months. Should I just stick it out and hope I don't get fired for underperforming?

125 comments

[ 5.7 ms ] story [ 270 ms ] thread
Quit... Have been through this. If it you cannot apply anything you learn in this company in your next jobs, it's a waste of your time.
If you leave then they're no longer paying you, so you owe them nothing, right? :)
Exactly, you owe them your labor while they're still paying you. If they gave you a signing bonus or something under the assumption that you'll stay for a certain amount of time, then they will probably (justifiably) crawl it back.

Like another person said, there are people who enjoy modernizing codebases (I sometimes do myself), but if you are hating your job, do everyone a favor and make a change.

You should probably start with your manager, and explain why you are considering leaving.

Put in an amount of effort that you consider professional at work (by which I mean, put in enough effort that you're proud of yourself, even if you're less productive than you'd consider ideal for someone specialising in what they need). Use React on side projects. Look for better opportunities, and be more picky and curious about the actual work you'll be doing. You owe them no more loyalty or accommodation than they've shown you by misleadingly recruiting you.

Chalk it all up to career learning... Try not to get too personally invested or discouraged.

It's difficult to be proud of anything I'm doing :). Whenever I propose a design for something, I'm told to do it the fastest way which is usually a bad hack.

I'm amazed the code works at all. The stack traces are more than twenty deep sometimes. I can't stand to look at it for more than 20 minutes without a break.

I need to be more careful next time I'm looking for a job

The stack traces are more than twenty deep sometimes.

Haven't counted but I think this is totally not unusual when I work on Java which I consider a modern stack.

I should clarify that's over 20 deep of our code , not counting all the framework stuff.
The depth of the stack is not a very good metric for code quality.
Why is everyone quibbling with him about that. He just wants to express his opinion that the codebase is very bad in a more colorful way than by simply calling it doubleplusbad. Let's just take his word for it and move on.
Because we are trying to tell OP in a nice way something we think he will benefit a mot from rather than just what he seems to be wanting?
It's bad in a lot of specific ways but I'm trying not to out myself since it's a fairly small company.

The overarching problem is trying to reinvent the wheel because the management thinks we can do things better than the language designers.

The end result is a buggy and generally bad reimplementation of core libraries. ORM, math, dates, full text search. There's a half-baked custom version of everything.

Add regression tests, replace with your own code. or quit.
That's the worst thing to do: doesn't provide any value at the part that matters. It may worth to improve code quality where it matters (the business logic), but to improve it where it doesn't matter is a waste of time to both the employee and the employer
I would think this was implied:

Only noobs like myself years ago would go ahead and refactor a lot of code during work hours without a good reason.

However when you stumble through something and finally understand the idea behind it (good or bad) then it might be a good time to add a couple of tests.

And when you have a few tests that covers nearby code you can hopefully find the courage to make a few surgical cuts to remove the worst tumors. ;-)

Not "proud of what you're doing", but "proud of how you're conducting yourself". Make sure you can walk out at 5pm holding your head high thinking "All things considered, I gave them good value for what they paid me today".

Also consider that "the fastest way which is usually a bad hack" is sometime the correct pragmatic approach for a legacy codebase that's in the process of being replaced. Giving them the benefit of the doubt, think about whether the elegant design is really necessary if there's a ground-up rewrite about to happen.

Even if it's demonstrably true that they've been "claiming" a rewrite is "just about to start" for a _long_ time, sometime's that's just as frustrating a thing for management as it os for the coders - management may well honestly have always believed this rewrite was supposed to have started 12-18 months ago, and that it genuinely is only weeks away from starting... Just like they believed last month and six months ago... I've _been_ "that manager" before (and I'm sure I will be again).

> Whenever I propose a design for something, I'm told to do it the fastest way which is usually a bad hack.

And why do you agree?

One of the differences between professionals and other workers is that professionals are experts in how to do their work. If I tell my doctor to just write me a prescription because I said so, she'll just scoff. I can make requests, but she decides what will happen and how.

Especially if you're already likely to quit this job, then you don't have much to lose by insisting on using best practices. Sure, you have to honor their desire to do things reasonably quickly. But you don't have to keep digging the hole deeper if you feel it is professionally negligent to do so.

(comment deleted)
Even doctors understand that sometimes it's necessary to meet unrealistic deadline by doing quick and dirty hacks.

When you or I break our collar bone, the doctor will immobilise it in a sling for 4-8 weeks while it heals.

If you're chasing a motorcycle world championship though, they'll go in and screw it back together with titanium support and get you back to top-level performance in 2 days: http://www.autosport.com/news/report.php/id/108388

Sometimes you need to cut your code open, jam in some temporary scaffolding or duct tape, then stitch it back closed again - promising yourself you'll go back in and take the kludged fix back out when deadlines and circumstances are less critical...

You write this like I don't know that. I of course do, because like most people here I have written a lot of production code.

This person is in a place where they have spent years piling kludge on kludge. They never go back and fix anything, which is why they have such a mess. And here there was no emergency mentioned; he was describing their normal practice. It's duct tape all the way down.

At some point you have to draw the line and say, "No, from now on, we'll treat normal circumstances like normal circumstances, and save the duct tape for real emergencies." I am suggesting he start drawing the line. Either they'll give in or they'll negotiate his exit, and either outcome is good for him. As the Agile people say, "Either change your organization or change your organization."

Welcome to the real world. If you want to write elegant code using the tools of your choice I suggest building your own product or service on your time. The business NEVER cares about tools, languages, or best practices. Expecting the business to value this stuff will cause you to burn out and be unhappy. They employ you to add value. So add value.
The problem is the business thinking he is buying value when he's really getting in debt.
I remember when I got hired to work on old code for an autoshop program. I actually loved it... great job though it could be tedious, but the worst thing was the boss constantly micromanaging me. I couldn't stand it. We'd have meetings about fixing things and new code to be implemented, than he would have me email him [an outline of] everything said in our meeting.

Then he would critique it to exactly what he wanted me to know about what I should have gotten out of the meeting. I'd say I spent about 3 or 4 hours a day coding and the other 4 was pretty much dedicated to putting up with his antics. Every time he would come bother me, I'd lose my focus and spend 10 or 20 minutes just trying to get into that mindset again.

You can read more about that experience here if you are interested: http://www.confessionsoftheprofessions.com/the-opportunity/

Long story short: I ended up applying to other jobs because with $40k of student loan debt and being paid $12/hr, I just wasn't ever going to move out of my mom's house. When I told him I was going to be getting another job, he offered me double my salary to stay. I thought about it and knew that he was going to hold it against me for everything.

Towards the end of my time working there, he did give me a raise for what would last a week and allowed me to work nights, so I could work in silence, as a way to try and lure me to stay and give me the "experience" of making $24/hr. Unfortunately, he also installed spy software on my computer, and questioned me about why I was on YouTube all night (I had a playlist in the background) instead of doing my job. After that, I pretty much told him it wasn't going to work out because of his mistrust of me, and I cut my final 2 weeks short.

Anyways, I ended up getting another job and this one too -- I worked on a "cold client base" that was at least 2 years old -- basically, the company sold contracts in advance and never delivered, so I was hired to help them catch up. Managed to take their "cold client base" from about 140 accounts all the way down to about 32 accounts remaining. It involved some software and collecting data. We worked in Flash. Other companies were working in HTML5.

We had an in-house programmer working on an HTML5-based platform and it was amazing. Unfortunately, I got laid off before I got to learn the new program, but apparently, after 6 months, so did everyone else and the company went out of business. Had they just released that program and pushed it, I'm pretty sure they would have been able to stay in business, but such is life.

I currently work as a web developer for a large media corporation. No regrets and I've definitely earned my salary and raises over the years. If you aren't feeling it anymore, than start looking for a new job and go for it. You have programming knowledge so it is likely you can get a job in many different places. When you go, they'll probably find someone else. We're all replaceable, for the most part.

Go do something you enjoy and get paid to do it. No sense in wasting your life away not doing something you don't really enjoy.

Couple of questions to focus your decision making:

Did they pay for your relocation expenses? If so, is there a clause in your employment contract to pay it back if you leave within a given period of time?

Do you want to stay in your new city?

If you are unhappy enough to leave, then why not bail up the manager who hired you, tell them point-blank that they lied to you and you know that the "round the corner" talk is just window dressing. Demand more money for your pain, etc. You should only do this if you are willing to get fired on the spot. But it is what I would do.

Immediately start looking for a new job. I would not put this one on my CV. Just mark the time as time-off to do a bit of travelling and relocating to your great new city and now that you have settled in, you are looking for work.

Don't worry about it being shitty legacy stuff. I have even worked on mainframe Cobol for a while and although I hated it, I ended up learning about a new industry and then getting a job with one of their competitors. Every silver lining has a cloud.

Relo isn't a problem and I definitely want to stay in this town. I can't really mark it as time off because I already did that a while back, I don't want to end up with a lot of gaps :)

I was thinking I could just apply to other places and be honest with them... But some may also frown upon me saying bad things about my current employer

Not necessarily. If you haven't been there for long (and it's not on your resume) it might not even be necessary to mention them directly. It could take a bit of linguistic technique, but if you frame things in such a way that describes what role you were hired for and what role you were given, I don't think anyone could fault you for being dissatisfied.
I'm looking for a React guy. Remote work is fine as long as you're on USA timezone.
What about remote that will work USA time zone hours? (I work serious question. Considering doing remote next year and wondered if people consider that cos I work better at night time anyway.)
How about someone with no accredited skills or accomplishments?

I'll transcribe your voicemail, I'll answer emails, whatever.

I won't let you down.

(comment deleted)
As a hiring manager, if you tell me the reason you left after such a short time was as you describe in this post, I would have no real issues with it.

I'd be looking for some insinuation that you gave it an honest effort and tried to work with your previous company to make it better, but in the end if you got hired for a certain role or stack and it was clearly not what you were going to be doing there's no fault (in my opinion) in you being dissatisfied.

There are certainly times when people can come across as chasing only the shiny and new tech, which is a bit of a turnoff if I'm trying to build a product, but not a deal breaker either. I don't feel like this is the kind of situation that would make me feel that, you weren't getting what you signed up for.

If a prospective new employer already has concerns about employee retention or that they're also overpromising on their stack, they may pass on you- but I think we'd agree that would be best for everyone in that case.

I would also make it a point to let your manager know, as well as HR during your exit interview, how you felt you got bait and switched. It's entirely possible it was unintentional- in which case they could use it as a way to improve and clarify how they're positioning the role. Or, if they're actually lying about it and already know- they won't really care, but it could put the manager or team on notice with someone who does to get their shit straightened out. It might be a long shot, but it might make it better for the next person.

>I would also make it a point to let your manager know, as well as HR during your exit interview

Do they still do those these days? The places I've left never bothered.

> Don't worry about it being shitty legacy stuff.

This. One of my specialities is unpicking and debugging legacy code bases, often 20+ year old mud balls. It isn't glamorous work, but you do get a few decent war stories out of it to recall in the pub.

My preference is to hire devs who've put in the hours in these environments. I see it as something of a right of passage and indicates to me you've got the experience and self-assurance to work with these gnarly and often fragile code bases (hopefully) without breaking it, fixing bugs and generally trying to make it better.

I'm not suggesting you make a career out of this, though it can be lucrative, but a year or so doing this kind of work does no harm to your CV/resume in my eyes.

Agreed! Seeing it done wrong provides lessons in how to do it right. Probably one of reasons why we read DailyWtf.com.
I've been in a similar situation once [0], though it was really my own fault rather than being duped. Quitting fairly soon (after 7 months, IIRC) was definitely the right thing to do. I did it without arranging for a new job first, which was probably not the smart thing to do.

[0] https://www.snellman.net/blog/archive/2015-09-01-the-most-ob...

(comment deleted)
If you were truly lied to, then at the least you should out the company because this is unacceptable - especially given that they had you move across the country for this. If they don't face any consequences for what they did, then they'll continue to exploit others like they did to you.
It's too small a company to maintain my anonymity. Small enough that it's unlikely to burn any fellow HN readers if that makes it any better
I actually enjoy working on legacy code and improving it. I'm not suggesting you should enjoy it, it's just there's all kinds of engineers. The company should be hiring someone who does enjoy that sort of thing, and I suggest you look for another job that is closer to things you enjoy doing.
Walk away, please. It's clear that you hate your job. Do it now before you regret it anymore.
My expenses are too high to walk away and there's nothing I can do about it for a couple years. Otherwise I would have walked out several times over.
If all you've got are React and Typescript, you may be better off learning how to modernize old code. There's a glut of Javascript-only programmers. What's the old code written in?
Some webforms but the majority is in a much more ancient and niche language I won't name because it's too specific to this company.
Must be Wasabi
It's literally so ancient that we bought the remains of the company that designed the language when they went under
What's the legacy codebase, if I may ask (unless it identifies the company too much)?
Some of it is so obsolete and unique it would probably identify the company :) . The rest is slightly less old, MS webforms.

The webforms stuff isn't much better because the code quality is the worst I've ever seen. Adding features and fixing bugs is a stochastic process because you never know what will break.

Usually fixing a bug will expose an old fix that was done improperly for the original even older bug, forcing you to undo multiple levels of hacks to implement your own. It's nightmarish

Patches all the way down, it seems. I've had to deal with similar codebases. I try to fix what I can, but it always seems to be a neverending process.

Legacy codebases suck, but it doesn't stop newer codebases from sucking just as much. I've learnt that the hard way.

Yes. The codebase is best described as a giant pile of hacks.

It's the culture more than the tech that causes this to happen. Every time I offer to refactor I'm told to fix it the fastest way and that's how we've been doing it for 10+years.

Sounds like it's time to get out then. I don't know how hard that would be as you said you moved cross-country, so you could be anywhere (in the US I'm guessing). Remote work is always handy.
Every time I offer to refactor I'm told to fix it the fastest way and that's how we've been doing it for 10+years.

Ok, as someone with a strong dislike for modern js I still feel sorry about this.

Tough place to be in, and it sounds like you need to extract yourself as quickly as you can mindfully do so.

Get yourself into the right mindset for interviewing and demoing your side projects, line up some interviews, and go. When you've got an offer on the table, make the jump.

Alternatively, if you have several months of living expenses as a cushion in the bank, you could find some freelance clients and then quit.

Focus on the future, stay hopeful, and get out of there. If it's only been a few months, consider not even listing this job on your resume.

All code is legacy code. Use it as a proving ground for learning how to deal with legacy code. Otherwise you will always be bitter and upset no matter where you go. The only way to work on greenfield projects is to start something from scratch on your own.
No, no.
No, no what? Do you have counterexamples where established businesses don't have to deal or interface with legacy code? If so I want to work at this magical enterprise.

According to OP this company has been around for 10+ years. It'd be a miracle if they didn't have legacy code.

Agency work, for one.
Really? Which agency is that?
Ad agency business (not adtech). I work for a digital production agency that caters to ad agencies, doing digital campaigns (vr, mobile games/apps, websites, webgl, anything digital really). My time on a project (code, frontend) rarely exceeds 2 months, and after that I get a fresh new project to work on from scratch. I rarely work with legacy code and usually the tech stack for these projects are quite cutting edge, too.

After working in this business I don't think I'll ever be able to return to a "normal" type of business, although stress can be quite high and often there is overtime to meet a deadline.

1. There's shades of legacy code, 20 years of rot is way different than 5 years. There's also different states of legacy code, and it sounds like this is not in the good state. So being sold on one universe where the real universe is so far off, that's a special case of embitterment that's maybe more justified than lesser lies.

2. I don't necessarily agree with the premise, he's not looking for a greenfields project, he's looking to use the toolset he was sold on during the interview process. There's plenty of established companies that have moved from xyz -> React in the past year or so.

This seems a classic case of being either deceptive or self-deluded from the interviewing side, with classic results. Its foolish, it rarely results in good things, and it's a huge waste of time for everyone when interviewers are not straightforward with candidates. Don't do it, and I would not feel bad for a second leaving a place that pulled that.

Look for a new job while pulling in your current paycheck. You were lied to from the start and you owe them nothing. Most of the new places will no have a problem with "job hopping" if you are honest and say you aren't working on what you were hired for. Relevant xkcd https://xkcd.com/1768/
Damn that's relevant
You're getting some really angry and personal responses in this thread telling you to suck it up and clean up the code yourself as if thats the path all programmers have to take. Thats not true at all, many companies provide good opportunities for employees to grow within their role in a more positive manner. Cleaning up the codebase would make you a sucker. They lied to you and as you describe it continuing to work there sounds like career suicide. Don't do them a favor by putting in the extra hours and effort into cleaning up their mess (its not YOUR mess). Your time is valuable! By lying to you they are literally wasting your LIFE. Think about it that way and any guilt/obligations you have towards management goes away.

You make a mistake by taking the job but what is done is done. Now you know what questions to ask in interviews to make sure this never happens again. So, if you are unhappy put in the hours you are paid for and start looking. Thats the only way to get another job and change your situation. When you find an offer you like put in your notice and say thank you for the opportunity and keep it professional. Don't tell your boss that you're going to quit ahead of time, thats a great way to get fired because they wont want to train you anymore.

I'm in almost the exact same position except possibly worse so as I'm about to be sponsored by the company to stay in Australia on a skilled work visa... So mind numbing and career stifling that I find myself her on HN wayyy more than I probably should be :/ I've mentioned my concerns with the PM and a tech-lead and get told things to the tune of 'well your other colleagues didn't have a problem...' Been here a month now. Currently trying to build up the courage to write something to the boss but I'm not sure if that's a good idea.
I'd go to your boss and respectfully say what you've said here regarding your interview and intentions. "Sir/ma'am I was hired to do job X and I find myself doing job Y. Is job X still a realistic goal here? If so, when do I start? [a date should be the response]. If not, I'll start looking for job X. I don't want to burn the company, so I'll continue to work hard here until I find the job, and I'll keep you posted on the progress."

Some folks might say "no way dude, they'll can you" but I doubt it. I think most bosses would appreciate the honesty. And if they do you wrong, you still have your integrity and that's better than one more paycheck.

You skill will not rot if the code base is old and bad, your attitude does. It's just not your conform zone, it's ok to avoid it, but you will learn a lot if you don't. Spend some time to understand the business logic of the legacy code by doing code review, debugging...etc. and see if you can improve it by back porting the new technology, there's always room for that.
"..hope I don't get fired for underperforming?..."

What kind of passive language and thinking is that?

Everything is legacy once it is written.

Imagine you, the trailblazer, only having to write new code and not having to maintain the crap you wrote.

The actual problem here is your attitude and way of seeing things. Legacy? Sucks?

Fucking write a better version and show some initiative instead of just hoping of being granted the opportunity to work on "new shit".

Millenials these days.

Was with you until you got a little too aggressive. There is a better way to say what you're saying.
Aggressive perhaps. More effective? Maybe
I wasn't hired to work with old junk. if I would have known I never would have taken the job. I also don't have enough money to walk away or risk standing up to management.

The code isn't just old, it's very badly written and has zero documentation.

"The code isn't just old, it's very badly written and has zero documentation"

- Says everyone

Now you learned 2 valuable lessons:

- There's a lot of shitty code that you sometimes have to deal with

- Never put yourself into a state of dependency on a single income source, unless you wish to have the emotions you are feeling now

And I'll add: strive to never create such code yourself. You are 100% correct that everyone says old code is badly written and has zero documentation. So is the code we're writing today. Once you realize that you'll have become enlightened and will be a better programmer for the rest of your years.
I find it impossible to replace a legacy system without first understanding the legacy system. It's easy to say "X is old" or "X sucks at Y" but keep in mind that applications have a strong survivor bias. Ask yourself, "what does X do that is awesome" or "how has X lived this long" and you'll find a lot of hidden scars and requirements.

Start documenting those requirements and create a plan to map those to technologies that you prefer. Understanding how to successfully migrate platforms is a learned skill, and it's going to become useful again when React is no longer en vogue.

Yes. Thats what the college-lecturer tells you. But in the real world you should not stay longer than necessary in a company which lied so hard into your face.
Always several sides to a story and during interviews everyone is on their best behavior. I have yet to be in an interview where I get the full and complete picture without any embellishments. It's only after you have been on the ground floor for a few months that you see things for what they are.

Also, OP's story is currently colored by how upset he is so I'm sure the interviewers made the job sound more appealing than necessary but I'm sure there is also some revisionist history happening.

It was a lie of omission but I'm not sure if that makes it any better. I was hired to work on a new project but it wasn't disclosed that the project hadn't been started yet and has already been delayed for years
Sounds like said project will never be started. Your employer is probably coasting on a thing they have done once and were successful with.
To some extent hiring is always aspirational: a reason a company wants to add more people is to get better at skills it thinks it lacks.

This applies particularly to aspirational projects that a company "wants" to start. It hits a chicken-and-egg problem of that it needs to hire skills for that project, but can't start on that project until it hires those skills, many people don't want to be hired unless that project is already off the ground, and in the meantime existing projects still need to be maintained...

Certainly it would have been better for the interviewers to more accurately describe how aspirational their goals and not imply that things were more off the ground than they were. It's a bad way to start a relationship by selling goals as reality. It's also a sadly common way for companies to start relationships.

If you want to try to contribute change, figure out what the roadblocks are to that aspirational project. See if you can find ways to apply your skills to the aspirational project. Sometimes companies forget the bootstrap step in that chicken/egg problem and forget to check if they've added enough resources to start pitching into the new work. Goals continue to be delayed because the company is uncertain and being deliberately conservative about if it has the resources it needs to meet its goals.

Sometimes an aspirational project is looking for a leader to step up, someone with enough passion about the future to get the work started and get prototypes out the door. There's a possibility that can be you, if want to apply for that pressure/responsibility. There's a possibility that in hiring you your managers hope it might be you.

As much as anything, there's a chance here to introspect and figure out if it can be you. Figure out if you can make that pressure/responsibility work for you, if you can make the work/life balance you need, if you can find a way to balance work's existing responsibilities on you (help maintain current systems) with potential new responsibilities (help lead new project). In some companies you might be very well rewarded if you can strike that balance, if you can lead the company onward to meet its goals while helping it survive with its existing needs. It's up to you to assess if the rewards are worth the risks. Your company might be one of the very many that aren't that loyal to its employees and you would be better off elsewhere, but that's something you probably need to judge for yourself.

I guess I'm rambling, but there are ways to make your situation work, if you are looking for them. It's as much on you to discover if you have that capability as it is for the company to solve its own paths to its goals. Starting that conversation with a lie of omission might be an indication of bad faith and disloyalty from the company immediately off the bat... or it might be a sign from the company that it really wants someone/anyone, and that someone could be you, to step up to bat and try to knock something/anything over the plate. It's rare that a company wants a new hire to strike out. Maybe if you can hit a home run you might be rewarded for it, and it might be worth swinging for the fences. Have the conversations you need to figure out if it's worth the pain of swinging for the fences versus playing it safe and bunting until you get the next job offer.

Have you ever moved from an uncomfortable position and regret it later?
I think the basic truth to work off of here is: "Shit got real."

Yes, you can step away, in the figurative and literal sense. In many possible worlds this may even be the best plan, if you have no real agency over the code. And you got lied to. It'd hardly be the first time someone has been convinced that the work would be cooler than it is.

But -- you also have to decide if this is an opportunity in disguise. Stories of folks who gradually build ownership over the creaky "legacy" codebase and polish it up with Sisyphean refactoring, until it shames the "rewrite", are out there, and they're real.

On the other hand, fixing the legacy code may be one of the hardest things you can do in software architecture. There's no sense of joyous freedom to it, just correcting of old mistakes. But if you did that, and published documentation to evidence what you did and how, lots of folks would want you - and not necessarily for the task of fixing their own crusty code.

So there is an opportunity here, if you can find a way to sneak it through the management, which has surely decided on the balance sheet that the code is a "deprecated asset" and will not want to hear about new ideas. In fact, to maintain it you don't want to present anything as a "new" - you have the much harder task of justifying every small change as an opportunity to improve the debuggability - to get the callstack down from 20 deep to 19 deep, to remove a superfluous parameter, to improve turnaround times, to reduce the code size by a few lines, or something similarly miniscule, but which might add up over time into real understanding.

> Stories of folks who gradually build ownership over the creaky "legacy" codebase and polish it up with Sisyphean refactoring, until it shames the "rewrite", are out there, and they're real.

Never seen it in practice. Is this a real thing?

Mastering legacy code is a core SW engineering skill. Learn how to do it if only because it makes new code you write less likely to end up in that state.
Sounds like someone likes 'collecting' programmers from different languages and technologies and giving them jobs =] Learn it love it or leave it, you're still making money right now so....
I have a theory that the company is for sale and the owners don't want their ancient stack to show up on Google search in job descriptions.

If it's not that you guess is as good as mine :)

If you were lied to, that is reason enough for leaving. If they lie about the role from the start, they will lie about other things.
Have you ever had an employer that didn't lie at least a bit ?
get the things that matter in writing. anything that is not in writing is a bona-fide lie.