> am I often looking at the wrong codebases?
I don’t think you are. I have a couple of decades in the industry, in which I’ve had the honour to see quite a lot of code from many different organisations through one of my roles in Enterprise Architecture in the Danish public sector. In my completely anecdotal experience it takes quite a lot of dedication to the CI part of the development process to achieve clean code bases, and it’s often not something that’s going to be very beneficial in the short term. Over time, I think that most good programmers eventually ends up in a “readable code is good code” mantra, but it’s not an easy path and a lot of the “meta” philosophies that we teach programmers from their first day in programming are sort or counter-productive to writing clean code.
Having gotten into programming around the millennium I’m obviously mostly familiar with the OOP side of things, but many of the things I was taught in regards to OOP is still things I see CS students being taught when I do my side gig as an external examiner. Where I’m from we tend to start learning OOP with a classic “bird -> duck, something that flies, some bird that walks” sort of thing so students can put in “fly”, “swim”, “walk” and “say something” methods. Which is great, in theory, because in the real world (again very anecdotal) people tend to build polymorphism and inheritance in ways that eventually almost always seem to end up with code basis having been better off just writing a duck, a chicken and a ostrich instead of nesting them under a bird class. Don’t get me wrong, I love having basic classes to inherit from in any sort of data-modelling so it’s not like I’m aboard the “I hate all OOP” bus, my point is rather that we still teach students something that often turns out not to produce clean code. Often it’ll take a long time for some of those students to get to a point where they become critical of “academic” programming and many frankly never learn how to write clean code.
In non-OSS you can dictate a lot of things that you can’t with open source without breaking a lot of the concepts. I don’t necessarily think it’s wrong to demand that open source organisations make it a requirement that the only way you can build things for them is if you use their template projects in a technology they want to govern. But that goes against the principle of technology agnostics, so many will rightly not do that. If you don’t, however, take control on how code is supposed to be written, then it’s going to be written in a multitude of ways and I think it’s very hard to avoid it becoming messy over time.
Now, if you have a single project and not an organisation, and maybe you even have changing custodians, then you’re likely going to end up with not only different ways of contributing but also different governing philosophies over time. Which is very democratic, and probably unavoidable, but it’s also very prone to leave you with a code base that isn’t easy to read because it’s not actually written by a single set of “clean code” principles but multiple.
Or in short, no, writing clean readable code is hard.