I'm okay with a comment on the constant, but not where it is used. Sometimes numbers come from external calculations that are not done in the code. This is common for many formulas in math, science, finance, and graphics.
I've had comments before referring to the code used to calculate the constant. I did this when it was too costly to calculate each time.
One feature I can't wait for more languages to implement, is compile time code execution. Then such costly functions could be visibly coded, but also not have to run each time the program is opened.
I think I read that scala has it? Personally I'm pretty excited for JAI (though that might not be released for a few years), but that may be mostly suited for game-development rather than general programming and software.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm okay with a comment on the constant, but not where it is used. Sometimes numbers come from external calculations that are not done in the code. This is common for many formulas in math, science, finance, and graphics.
I've had comments before referring to the code used to calculate the constant. I did this when it was too costly to calculate each time.
One feature I can't wait for more languages to implement, is compile time code execution. Then such costly functions could be visibly coded, but also not have to run each time the program is opened.
Does anything other than C++ offer this now?
I've usually resorted to a pre-build step that modifies source files.
I think I read that scala has it? Personally I'm pretty excited for JAI (though that might not be released for a few years), but that may be mostly suited for game-development rather than general programming and software.