New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using UPERCASE_STYLE for constants? #1152
Comments
If only we could have them naked ... I often use And About Good point about not knowing where to look for constants, it bugs me too. Maybe we should keep them all in a single file? |
From all these maybe
Also, there is this thing... should it be |
I think |
I'll have to change the "r" in r48 to v48. In a bunch of places... |
True. Version numbers do tend to stay low while revision numbers grow until a versioned release is ready. Moving that to a version number would be |
maybe with semver ? http://semver.org/ it tries to formalize how to use version. close to linux version system it is from mojomdo a github guy. |
That's way too complex for my little brain... :/ |
Since three has historically been marked with revisions and not versions, |
Sounds good. |
cool :) |
We can do like it's done in three.dart. All the constants would sit in the main Three.js file. |
Yup, could be. Sidenote: I'm really curious about Dart performance, it would be very interesting to have some of our stress tests ported to Three.dart and compare them with JS ones. |
Well, I have the feeling is going to take a while before we can compare stress tests... There is quite a bit to port ;) Also, I think Dart will be interesting whenever a browser can execute it natively. Right now files like this don't look too promising imho. Still, I'm also curious to see the performance this compiled javascript can get. |
Oh, it's not native yet? I somehow got impression it was already native in some version of Chrome [1]. Then no, compiled to JS it's practically useless. Even about native I don't have very high expectations, our bottlenecks are mostly JS to WebGL boundaries not raw JS performance. Could make a difference for stuff like physics though. Edit: [1] here is the best I could find (Dartium, Chrome with native DartVM, prebuilt Linux and Mac binaries, seems nobody managed to build Windows executable yet, also not sure if WebGL works there at all): |
@alteredq more official: http://www.dartlang.org/dartium/ |
✅ THREE.REVISION is already implemented As for the rest:
|
So @chandlerprall was suggesting having a version variable somewhere in the API that a plugin or something that sits on top can use. He was suggesting
THREE.version
. The idea sounded good to me but the naming didn't feel right. If it's a constant it should be upercaseTHREE.VERSION
. @chandlerprall then pointed out that maybe should beTHREE.Version
as that's how we're handling the constants in other places.That made me think that probably this needs reconsideration. Right now there is no difference between
CubeReflectionMapping
andRepeatWrapping
. Even if the first one is a method and the second a constant. Also, they're poluting the root of the namespace and it makes it hard to know where these constants can be used and also which file to look for (when messing with the code).So what about changing
THREE.CubeReflectionMapping
toTHREE.Texture.CubeReflectionMapping
THREE.RepeatWrapping
toTHREE.Texture.REPEAT_WRAPPING
, ... ?The text was updated successfully, but these errors were encountered: