COLLADA2GLTF icon indicating copy to clipboard operation
COLLADA2GLTF copied to clipboard

Enforcing const methods?

Open ziriax opened this issue 6 years ago • 1 comments

In the spirit of functional programming and easy reasoning about code, I'm a big fan of marking as much as possible with const.

I noticed that almost none of the GLTF methods are const. For example, TransformMatrix::isIdentity() is non-const, although it clearly must be. This means that in my own classes, when I have a const TransformMatrix variable, I now either have to make a copy, or mark it non-const.

What is your opinion about const?

Thanks, Peter Verswyvelen

ziriax avatar Mar 03 '18 07:03 ziriax

I think typically best practice is to make things const wherever they can be. I was more focused on getting the 2.0 converter done than making a perfect API, but I think especially if we are interested in splitting out the C++ glTF code as a library that this would be good to tighten up.

lasalvavida avatar Mar 04 '18 23:03 lasalvavida