by saidinesh5 · 1y ago · 0 comments
With C++ you have the third option where the compiler makes sure that the "people will do the right thing" with the private keyword - assuming they're not doing some weird pointer math to access the private members..
Of course, you'll have to deal with ABI stability now but it's all tradeoffs for what your requirements are.
It comes down to a cost benefit thing - is the cost of poorer readability worth it for mitigating the risk of people doing the wrong thing? My experience says no, other people's experience says yes. Probably we are working on different problems and with different teams.