One of my responsibilities as a CMS physicist is developing C++ and python code using the framework, CMSSW. The coding standards are very high for CMSSW, with strict checking and treating warnings as errors, so even the slightest lapse in safety causes compile errors. I just came across a build error because I tried to pass a const instance of class as an argument to a method and using a non const method of that class, giving the error message:
error: passing ‘const PixelMatchSParameters’ as ‘this’ argument of ‘float PixelMatchSParameters::sPhi1B()’ discards qualifiers
It had been a while since I’d seen this error, so I had to look it up and when it did, and I realised the problem a smile spread across my face. There’s something beautiful about how strongly cast C is, and how strict C++ forces you to be when passing around objects. When the code is clean and safe it’s something I can be proud of, and that’s one of the reasons I love C++. (On the other hand there are times when C++ makes me want to pull my hair out, but they are often the result of poorly documented code, or working with someone else’s perverse design choices.)
I’ve been developing in C and C++ for about a decade now, but so far I have not created my own standalone project from scratch before without building upon some other framework. Perhaps it’s time I did.