- Joined
- Nov 11, 2006
- Messages
- 7,591
Out of curiosity, which do you prefer more?
Option A:
(just examples)
Option B:
I'm just curious. I can't really tell myself. As for efficiency, the first option is 1 extra function call/set, but it is sort of negligible if you prefer the API that way. It is kinda annoying to type the brackets, but it seems to make sense. The second option is the traditional JASS method, where you just make the "source" string the first parameter.
Thanks.
FAQ: (Frequently Anticipated Questions)
Option A:
JASS:
call String["Hello"].find("ell")
call String["Hello"].toUpperCase()
set someStr = String[someStringVariable].trim()
(just examples)
Option B:
JASS:
call String.find("Hello", "ell")
call String.toUpperCase("Hello")
set someStr = String.trim(someStringVariable)
I'm just curious. I can't really tell myself. As for efficiency, the first option is 1 extra function call/set, but it is sort of negligible if you prefer the API that way. It is kinda annoying to type the brackets, but it seems to make sense. The second option is the traditional JASS method, where you just make the "source" string the first parameter.
Thanks.
FAQ: (Frequently Anticipated Questions)
- What about Wurst stdlib?
It is already awesome enough as it is. I'm just curious about it from a vJASS standpoint.