| 06-26-2006, 04:23 AM | #1 |
I've seen in people sig's "say Yes/no to BJ" or whatever it is. But what IS BJ anyways? I know it starts off certain things in JASS, but that's about it. |
| 06-26-2006, 04:26 AM | #2 |
BJ functions are just wrappers of natives that Blizzard threw in there for GUI (or so it was presumed). There are few cases if at all you would want to use BJ functions. Here is an exmaple: Code:
function helloWorldBJ takes string s, integer i returns nothing
call helloWorld(i,s)
endfunctionOne case where you might use BJ functions are when creating floating text because it does it all for you in a neat little package which makes reading your code a little bit easier. As you can tell, it is much more efficient to just call the native and sometimes, the BJ functions even leak! |
| 06-26-2006, 04:31 AM | #3 |
Thx. Just wondering. So sometimes its good to use BJ, and other times it's not? |
| 06-26-2006, 06:51 AM | #4 |
Basically the only decent BJs are for the most part PolledWait and BJDebugMsg, with the last one only being for debugging, and just easier to write. Natives are faster. They also often give more functionality. Most BJs are completely useless and just swap over the order (some don't even do that). Don't use them. |
| 06-26-2006, 06:59 AM | #5 |
PolledWait leaks =) |
| 06-26-2006, 07:13 AM | #6 |
Doesn't nullify the timer, true. Very minor leak though (does Vex's optimiser fix that?). |
| 06-26-2006, 07:47 AM | #7 |
I use BJs and all that shit until I'm sure everything works, then I optimize tthe code with natives etc... :D |
| 06-26-2006, 08:01 AM | #8 |
That's a silly way to do it for most functions, as most BJs take longer to write out, make less sense, and do exactly the same thing. |
| 06-26-2006, 10:03 AM | #9 |
Actually... TriggerRegisterAnyUnitEventBJ() is a good one too. That's one I toss around all of the time just to save lines of code. Also I use the CountPlayersInForce() BJ as well out of convenience. I also use MultiboardSetItemValueBJ() since the alternative of coding it out is just a waste of space. To be quite fair, in actual mapmaking using one or two won't destroy your map. It's good to try to be as efficient as possible, but for me, as long as it runs and doesn't lag it's efficient enough in a WC3 map. |
| 06-26-2006, 12:32 PM | #10 | |
Quote:
JASS:function Echo takes string msg returns nothing call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,msg) endfunction Almost all the BJ functions that make a little sense leak something so u'll have to rewrite the functions anyway :) |
| 06-26-2006, 12:39 PM | #11 |
@ Captain Griffen: Polled wait leaks a timer being not nullified. @ iNfraNe: Oh that is actually very good and I am using this since about 2 years. |
| 06-26-2006, 12:48 PM | #12 | ||||
How about you read first, then critise? Quote:
Quote:
Quote:
Quote:
|
| 06-26-2006, 12:54 PM | #13 |
You always get so defensive, Griff. It's ok, we're not questioning your judgement or your jass skills, we're just making out own comments and stating our own opinions. That's why we're on a forum in the first place. :P |
| 06-26-2006, 01:00 PM | #14 |
I'm here to learn |
| 06-26-2006, 04:18 PM | #15 |
I'm here to spam. And I think we all know what BJ ought to stand for. |
