4 ms·
> I wouldn't be so sure, as mature and reliable codebases use the hackish unhygienic preprocessor macros every day :-) Isn't it funny how the most mature softw
by spijdar 5y ago
> I wouldn't be so sure, as mature and reliable codebases use the hackish unhygienic preprocessor macros every day :-)
Isn't it funny how the most mature software (and often by extension, "reliable" e.g. have been in use the longest with the most bugs beaten out by years of hacks and patches) seem so far away from "best practices"?
I've always wondered about the root of this. Are programmers trudging along using "brute force" more effective, or is it just pure survivor bias on projects/products that people didn't give up on?
- nicwilson 5y agoProbably because best practice and changes at a faster rate than coding standards for old codebases. I suspect this observation exhibits some survivorship bias as well, then again you get things like OpenSSL...
- tzs 5y agoIt's probably useful to distinguish between two kinds of "best practices". One kind is things dealing directly with the underlying thing you are trying to accomplish with a program. Say it is a program doing some sort of physics or engineering calculation that at some point needs to add a bunch of floating point numbers. Best practice might include using something like Kahan summation [1] to reduce the error. I'd expect to see that kind of best practice in both mature programs and new programs because it is something that directly relates to what the program actually is trying to do. The other kind of "best practices" are those concerning the environment and practice of programming itself. Many of those seem designed to deal with the case where there is a lot of turnover in who is working on the software. People join a project, work on it for a year or two, and then move off to something else. You adopt these best practices so that new people will be productive faster so you can get useful work out of them before they leave. So these best practices tend to change as fad and fashion come and go. The mature software that has been in use for a very long time I think is more likely to have a much higher percentage of its work done by people who have been working on it long term, and have a lower turnover, and when someone new does come on they stay longer. They don't need to have their best practices match the fad and fashion best practices used by the shorter term projects. [1] https://en.wikipedia.org/wiki/Kahan_summation_algorithm https://en.wikipedia.org/wiki/Kahan_summation_algorithm