• Welcome to Valhalla Legends Archive.
 

16ms Ping (odd for me)

Started by CrAz3D, July 05, 2004, 04:48 PM

Previous topic - Next topic

BinaryzL

Quote from: Kk)Blaze(kK [Anti-yL] on July 07, 2004, 05:52 PM
What would happen if you sent 0x25 before 0x50?

Why don't you try it..I would assume an IP ban.

MyndFyre

Quote from: LoRd[nK] on July 06, 2004, 03:34 AM
Programming 101: Don't use objects in functions because the object names may need to be changed or removed sometime in the future and in which case you'd have to hunt down the functions that contain the object and change them. Checking objects also takes a much longer time to check than a variable.

That's retarded.  Why even have object-oriented programming then?  (Java pros back me up here!)  My code is nice and clean because I have well-defined interfaces.  My documentation is clear -- my ConfigurationSettings class is responsible for maintaining all configuration information (including connection behavior, plugin settings, and display settings; by supporting several different interfaces) so that I don't need to know how that data is stored and persisted.  The class takes care of loading and saving that data transparently (I've programmed it that way), and so all I need to do is

settings.Username

settings->Username

etc
to access the username.

It's ludicrous to say that it's SOOOO much slower to access a variable through an object than directly.  So what if you use indirect addressing?  What's the problem:

mov       eax, 8402EC22H          ; move the this pointer into the eax register
add        eax, 12H                      ; add the offset of the b_spoof variable
mov       ebx, [eax]
test       ebx, ebx
jz           do_spoof


Most compilers would optimize it immediately to (if you didn't need to worry about several instances of this object):

mov       ebx, [8402EC34H]        ; move the pointer to the b_spoof variable offset of this into the ebx register
test       ebx, ebx
jz           do_spoof


Goodness no!  Three instructions!  Probably the same as if you had just to index into memory.  In fact, exactly the same number of instructions as if you just read directly from memory.

Programming 101: Avoid using global data when possible because down the line if you change the one global data variable name you have to hunt through the program for every occurance of that identifier.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Tuberload

I think he was talking about Visual Basic controls when he said objects, but yes Mydfyre I agree with you completely about object oriented programming. It is amazing what you can do with a little bit of inheritance and splash of polymorphism. Plus the organization and structure of the coding to me is way nicer than a procedural language, and whatever VB6 and below is(?). Another benefit, for me anyways, is that I can actually visualize my program in terms of physical objects. To me it's like putting together a motor when I design my programs.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Eric

QuoteI think he was talking about Visual Basic controls when he said objects
Exactly.

MyndFyre

Quote from: LoRd[nK] on July 07, 2004, 10:19 PM
QuoteI think he was talking about Visual Basic controls when he said objects
Exactly.

Ahh, that makes a little more sense (controls v. objects).  Yes, that is retarded.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Blaze

Quote from: BinaryzL on July 07, 2004, 08:12 PM
Quote from: Kk)Blaze(kK [Anti-yL] on July 07, 2004, 05:52 PM
What would happen if you sent 0x25 before 0x50?

Why don't you try it..I would assume an IP ban.

Damn... Stop being so right!
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

tA-Kane

#21
Quote from: LoRd[nK] on July 06, 2004, 03:34 AMProgramming 101: Don't use objects in functions because the object names may need to be changed or removed sometime in the future and in which case you'd have to hunt down the functions that contain the object and change them. Checking objects also takes a much longer time to check than a variable.
DOUBLE YOU TEE EFF?!?! That's total nonsense...

I normally ignore stupidity, but this takes the cake... you couldn't be much more dead wrong...

"Don't use objects in functions" ... where the freak else would you use an object??

"object names may need to be changed or removed sometime in the future and in which case you'd have to hunt down the functions that contain the object and change them." ... that's PART OF PROGRAMMING...

"Checking objects also takes a much longer time to check than a variable." ... hardly. So instead of having a variable in the register, you have the address of the object in the register (your object). So instead of having to simply check the register, you have to load the data and then check. Whoop-dee-freaking-doo. Might I also mention that an object can have countless more variables than you can have variables in the few registers that most Windows machines have (or just about any machine for that matter), so if you were to have a lot of variables, you'd have to have (at least some of) them on the stack anyways. In this case, you'd STILL have to load the parameter from the stack first, and then check.


If what you say is truly "Programming 101", then there's no wonder there's so many newbie programmers today.


Edit: Ugh, I should read page two before posting my own rant along the exact same lines as already discussed  :\
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Tuberload

Quote from: tA-Kane on July 12, 2004, 08:16 PMobject names may need to be changed or removed sometime in the future and in which case you'd have to hunt down the functions that contain the object and change them." ... that's PART OF PROGRAMMING...

If you use inheritance and polymorphism, and design your program correctly you can greatly reduce the amount of maintenance required on previously developed objects. I rarely have to go back and modify anything in my object library unless I need to add functionality or fix a bug somewhere in the underlying details. That is the beauty of OOP.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Eric

#23
Quote"Don't use objects in functions" ... where the freak else would you use an object??
You declare the object and pass only the needed variable(s) to the function saving memory and CPU overhead, or as discussed in the previous posts, storing the variable(s)/function(s) in a module.

IMO, a function concerning sending a packet to Battle.net should not have to access a visual on a configuration form.

Quote"object names may need to be changed or removed sometime in the future and in which case you'd have to hunt down the functions that contain the object and change them." ... that's PART OF PROGRAMMING...
One of the main goals when programming is cleanlieness.

MyndFyre

Quote from: LoRd[nK] on July 12, 2004, 10:17 PM
One of the main goals when programming is cleanlieness.

While I agree with other things that you said, I have to point it out....

Clean code that doesn't function is no good.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Adron

Quote from: LoRd[nK] on July 12, 2004, 10:17 PM
You declare the object and pass only the needed variable(s) to the function saving memory and CPU overhead, or as discussed in the previous posts, storing the variable(s)/function(s) in a module.

I'd like to point out that passing an object reference to a function will cause less overhead than extracting five different variables from the object and passing them...