3 ms·
I think it depends. In the context of a complex mathematical formula, where you have many intermediate results with very abstract meanings, I think it's more c
by skohan 7y ago
I think it depends. In the context of a complex mathematical formula, where you have many intermediate results with very abstract meanings, I think it's more clear to use a single character name than to try to be descriptive with something like: `productOfLuminanceAndDotProductOfSurfaceNormalAndLightDirectionDividedByScatteringConstant`.
I think there are a lot of advantages to abiding by styling conventions and using linters to set a baseline, but there are always exceptions to the rule.
- onion2k 7y ago* productOfLuminanceAndDotProductOfSurfaceNormalAndLightDirectionDividedByScatteringConstant* Note that the id-length rule also allows you to limit the maximum length of a variable name. This is why.
- skohan 7y agoI understand that, but what in your mind would be a good replacement to name such a complex, abstract value? A long acronym perhaps? I don't see how that's any more clear or less arbitrary than a single character name.
- wa1987 7y agoAgreed. I'd much prefer something along these lines as opposed to using an overly long name: ` /* product of luminance and dot product of surface normal and light direction divided by scattering constant */ const prod = ... `