tobeyu
August 27th, 2001, 10:37 AM
Question for you API gurus out there. Why would a person opt to use API calls to achieve the same thing as using controls that accomplish the same thing?
For example, why would a person write a chat application using API socket calls instead of simply using the winsock control that ships with VB?
I have heard that when you have API calls in your VB code your app could actually become slower (don't know how much).
I know there are times when calls to the API give your program more functionality and extended properties but why would a person make the effort to "re-invent the wheel"?
???
Thanks in advance,
Tobey
Cakkie
August 28th, 2001, 01:58 AM
Well, about API's being slower, don't count on it, you will gain speed when using API's, besides, most controls use API's themselves.
I think the reasons that we would use API's over controls, is that in some cases, you need absolute control, or the controls available don't give you exactly what you need.
Also, API's are mostly system calls, residing in system dll's that come with the system. Controls however, are ocx's and if you use the standard controls, your app will most certainly work on the target pc. If you are using some 3party (non M$) controls, the chance that the target computer has the controls is smaller, thus, more chance your app doesn't work. Ok, you can distribute them with your app, but I have experienced more than once that this causes problems.
API's on the other hand, offer a wider range of possibilities to do with the libraries delivered by M$, and available on every windows pc.
This is actually simular to the choise between VB and C++, yes it is. Why do porgrammers choose C++ over VB, when the same task can be performed by a VB program, at the same performance (don't mistake me, C++ is faster, but at some area's the difference is at a minimum), but a higher developer cost?
but personally... I use API's for the challenge.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
tobeyu
August 28th, 2001, 08:02 AM
Thanks. That was kind of what I was expecting.