For what it's worth, a lot of production code looks this way. It's not right, it really should be nice and neat and so on. However, I don't see it as a grave sin against the project. Messy code can diverge where needed more easily.
Three different copies of the same code? Yeah, ok. That's ok. One day, when you can, merge them together. You can't merge them together? It's ok. Maybe they shouldn't be merged together.
Is it a barrier to entry for new developers? I feel that any developer who has worked on messy legacy code won't bat an eye. This sounds more like a problem experienced by a young coder fresh out of university.
You definitely can write clean code. Cleanliness can be a priority. There are some surprisingly clean and well-written large codebases out there. However, a lot of people just don't care. They are very smart, capable people who just bang out code that works and don't care to integrate in the proper clean way with the old code.
If you want clean code, an old, large, working C/C++ codebase is not what you want. We often can't spend time cleaning up old code, since there's always more features to implement, bugs to fix, etc. Learn to deal pragmatically with code like that. It's not like that out of malice, or some misguided attempt at writing the largest IOCCC winner. You can work with it. It's just a bit trickier.
I've worked on some of those "old, large, working C/C++ codebases" and the ones that are not clean are the ones where you are terrified of making a small change to fix a bug, especially close to release, because you have absolutely no idea what might break. Two copies of the same code? Great, which one do I fix? Both? How do I test that it worked, I can't even figure out where #2 is activated in the UI?! Is there something a little different about them that I need to watch out for? And test cases for said codebase? Hahahahaha!
Writing clean code is not an academic exercise. It means comprehending it takes longer, writing features takes longer, testing it takes longer. It makes every interaction with the codebase harder.
That might not be quite as bad in a proprietary codebase since you have somewhat more of a captive audience, but in an open source project where you want a long-tail of contributions from many people, that is a serious problem.
Three different copies of the same code? Yeah, ok. That's ok. One day, when you can, merge them together. You can't merge them together? It's ok. Maybe they shouldn't be merged together.
Is it a barrier to entry for new developers? I feel that any developer who has worked on messy legacy code won't bat an eye. This sounds more like a problem experienced by a young coder fresh out of university.
You definitely can write clean code. Cleanliness can be a priority. There are some surprisingly clean and well-written large codebases out there. However, a lot of people just don't care. They are very smart, capable people who just bang out code that works and don't care to integrate in the proper clean way with the old code.
If you want clean code, an old, large, working C/C++ codebase is not what you want. We often can't spend time cleaning up old code, since there's always more features to implement, bugs to fix, etc. Learn to deal pragmatically with code like that. It's not like that out of malice, or some misguided attempt at writing the largest IOCCC winner. You can work with it. It's just a bit trickier.