Prefix on all of ALFA's functions?
Moderators: ALFA Administrators, Staff - Technical
Prefix on all of ALFA's functions?
Cipher has started adding a "ALFA_" prefix to all of the ACR functions. What do you guys think of this? I type out function names in the sidebar list pretty often, so I'm not a big fan of having to type 5 extra characters plus a shift. Not too big of a deal to me, though.
The upsides are pretty obvious, pretty much prevents any function name conflicts. Though honestly I don't see those being an issue for the ACR as a whole, since we won't use anything 3rd-party without looking over it and changing a few things. I think its more of an issue for server scripters, who might import more 3rd-party scripts to use and not know how to debug them if a naming conflict occurs (seen this in ALFA1 a few times, usually precedes a "Ronan can you help me with this script?" request in chat).
The upsides are pretty obvious, pretty much prevents any function name conflicts. Though honestly I don't see those being an issue for the ACR as a whole, since we won't use anything 3rd-party without looking over it and changing a few things. I think its more of an issue for server scripters, who might import more 3rd-party scripts to use and not know how to debug them if a naming conflict occurs (seen this in ALFA1 a few times, usually precedes a "Ronan can you help me with this script?" request in chat).
- ç i p h é r
- Retired
- Posts: 2904
- Joined: Fri Oct 21, 2005 4:12 pm
- Location: US Central (GMT - 6)
About the function lookup, I just tried it on my end and I see results where the search string matches any part of the function name.
Eg: function ALFA_SampleTestFunction()
Typing "Test" or "SampleTest" in the function lookup text box in the toolset would bring up ALFA_SampleTestFunction. As far as I know, it's always worked this way.
Eg: function ALFA_SampleTestFunction()
Typing "Test" or "SampleTest" in the function lookup text box in the toolset would bring up ALFA_SampleTestFunction. As far as I know, it's always worked this way.
- ç i p h é r
- Retired
- Posts: 2904
- Joined: Fri Oct 21, 2005 4:12 pm
- Location: US Central (GMT - 6)
- ç i p h é r
- Retired
- Posts: 2904
- Joined: Fri Oct 21, 2005 4:12 pm
- Location: US Central (GMT - 6)
Any chance we can put these at the end of the alphabet? If they are HAK scripts, it won't matter, but anything going into ACR really needs to be out of the builder's way.Nerine wrote:If it is just for core rules then I'd say ACR_ would be better than ALFA_ plus it'd probably be good to prefix that to ALL core rule objects - not just functions.
PC: Bot (WD)
Code: Select all
----- ----- ----- -----
/ \ / \ / \ / \
/ RIP \ / RIP \ / RIP \ / RIP \ /
| | | | | | | | |
*| * * |* *| * * |* *| * * |* *| * * |* *|
_)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_//(/|_)(__)/\\_(
If said functions aren't being used, they'll be marked with an underscore for "private", and get pushed out of the way. If they are something that is used from whatever include files the builder is using, he probably won't want them out of the way.Fionn wrote:Any chance we can put these at the end of the alphabet? If they are HAK scripts, it won't matter, but anything going into ACR really needs to be out of the builder's way.
Though I still prefer no prefix for public functions, I do like ACR_ over ALFA_. Its more descriptively global, and shorter.
- ç i p h é r
- Retired
- Posts: 2904
- Joined: Fri Oct 21, 2005 4:12 pm
- Location: US Central (GMT - 6)
Heh, I already have reworked most of my stuff to ACR_, actually... Just need to commit it. I think it works to better distinguish any server-specific stuff from the ACR, since ALFA is a bit more ambiguous in that sense. Plus, all the files are named acr_ (though in NWN2 we'll get 32 byte filenames, so the shortness is less of an issue).