To be fair, that is how the Java mode Shader examples do things
...I'll submit a pull request there