New ask Hacker News story: Ask HN: I've realized I'm a bad software engineer and I'm over 30, what's next?

Ask HN: I've realized I'm a bad software engineer and I'm over 30, what's next?
37 by mxmpawn | 39 comments on Hacker News.
Hi folks, I've been working as a software engineer for about 10 years but always in small companies with few or none programmers or as a freelancer. I've been able to always have work on my desk because I'm always moving and talking with people in the industry but some months ago I decided to go to work on a proper medium software company. I'd been assigned a medium complexity task and I've failed to accomplish it, the code was all filled with hardcoded values, wrong structure, difficult to debug bugs and similar things. I've realized I'm not a senior software engineer as I thought and now I don't know what to do next. If you read my resume it'll seem I am a senior but I don't really know where to place me in the "experience" spectrum. I've always managed to solve the problems in front of me but in a "hacky way" and now the issue was totally revealed to me. I'm thinking about looking for semi senior roles but I'm afraid it'll look weird for the company interviewing me to hire a semi senior with +10 years of experience. I've also thought about transitioning to a PM role but I'm not sure if I can be a PM if I'm not able to code things the right way myself. A third option would be to take a break from work and try to learn to write good code but I'm not sure it's possible without working on a company with other people. As you very probably see, I'm quite lost right now so I'd be very grateful if you can advise me what I could do next with my career.