Canardia Posted November 30, 2009 Share Posted November 30, 2009 When using vec3, the coordinates should be noted with small letters (x,y,z), like GLSL does, and also NASA. When using Vec3, the coordinates should be noted with capital letters (X,Y,Z), like in the C/C++ headers, or Panda3D (although it's a pure C++ API, so it uses getX() and setX() instead). I find it a bit confusing, and hard to port code between LUA and C/C++, when LUA uses Vec3.x, and not vec3.x or Vec3.X. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Josh Posted November 30, 2009 Share Posted November 30, 2009 I think lower-case vec3() feels nicer, but what is the rule that makes it so? All other commands are capitalized. Should math constructors be lower-case? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Canardia Posted November 30, 2009 Author Share Posted November 30, 2009 I think it's more a general programming language convention, where either everything is lowercase, or everything starting with a capital letter (and in the middle also, seperating words). Sometimes there are also lowercase beginning letters, and then capital letters in the middle, but that's very ugly, like in Java and JavaScript. Normally in C everything is lowercase, and underscore is used as word seperator, but as nobody has a pure C compiler anymore, but a C/C++ compiler, and C has also developed a bit (to C99, which is almost like C++), where I think it's OK to use commands starting with capital letters, just like in C++, where it is the standard. I would use in LUA the same convention as in the C headers, which means everything starts with capital letters, and has them also as word seperators. It would mean that Vec3.X should be used. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
DaDonik Posted December 1, 2009 Share Posted December 1, 2009 Let Vec3 be as it is. It's not a bad idea that every engine command starts capitalized. Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Marcus Posted December 2, 2009 Share Posted December 2, 2009 Please keep all commands either all lowercase or all uppercase. Quote Link to comment Share on other sites More sharing options...
Josh Posted December 2, 2009 Share Posted December 2, 2009 The jury has spoken. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.