Menu

Is it bad to use the API?

2002-12-17
2012-09-26
  • Nobody/Anonymous

    Using the API commands instead of pure C/C++ code will slow down my program?

     
    • Nobody/Anonymous

      Windows put out the win32API that is a simple MFC. Windows programs are slow by design, Gates has built an OS API ... his.

      C++ can be very fast, the right compiler, and less trash code you write. C is the first, C++ started as a pre-compiler type tool back in the mid 1970's. Now C++, it is a full language that in maybe another 5 years, will leave its C past out in the cold.

      i did not login:
      j@ck_

       
    • Nobody/Anonymous

      So if i want to have a fast program i should use fprintf instead of WriteFile , etc?

       
    • Nobody/Anonymous

      <Using the API commands instead of pure C/C++ code will slow down my program?>

      You're asking about adding a muffler or foglights or new tires to make the car go faster.. if your tires were shredded to begin with, new tires might help it go smoother and a little faster..

      If you want fast code you should use win32asm.. which uses the win32api as well, but still your app has to contend with other apps and resource hogs running on your system, so your question is kinda irrelevant. It depends on what the program is intended for. If you want it to go really fast, write it using opengl or directx fullscreen and disable all background processes so your machine is tied up by your one program >)~  how to do that i gots no idea

      There isn't much of a difference when using straight C(fprintf) or C++, not enough clock cycles to notice a difference. The main thing is how much overhead you don't mind putting up with.

      - drarem

       
    • Nobody/Anonymous

      MFC and the API are not the same. MFC is a shitty wrapper around the API.

      Kip

       
    • Neo

      Neo - 2002-12-17

      I think in many cases, using WIN32 API is faster and efficient than using C/C++ code (or run-time routines).

      For example, fopen opens a file. Do you know what it does on its way to the file? It evertually calls the appropriate OS routine! On Windows platform, it calls CreateFile!

      So bear in mind, C/C++ is a programming language, it has to use the infrastructure offered by OS it is targeting at.

      (Not sure if I have made myself clear...)

       
    • Nobody/Anonymous

      No, it's not bad to use the Win32API. :-) But if you want cross-platform portability, you might want to consider using wxWindows and others cross-platform GUI and libraries.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.