0

Which is the best book and what are the best tools for C programming in Windows 7?

Would using C in any way hinder me when it comes to using the Windows API as opposed to using C++ or C#? I would like to use C, because it seems to me that object-oriented programming is bad for performance and the abstraction seems only counter-productive if the right people are doing the programming. I will mostly do GUIs and background services that do a lot of networking, possibly at OSI Layer 2, and public key + cascaded symmetric key cryptograpy.

Also, the core of the programs (excluding any that deal directly with OSI Layer 2) should be portable to Android.

nlovric
  • 109
  • 1
  • 1
  • 1
    Best tool for C programming on Windows without a doubt: [Microsoft Visual Studio](http://www.microsoft.com/visualstudio). As for the rest of your question: good luck with that. – PersonalNexus Feb 02 '12 at 20:41
  • 4
    You're restricting yourself from using any language remotely supporting a paradigm (C++ for example is quite multi-paradigm: a lot of C++ code, including significant parts of the highly acclaimed Boost library, is "object-oriented" only in that is puts some functions into `struct`s), on the grounds of *performance* and some people not getting their heads around OOP? –  Feb 02 '12 at 20:42
  • 3
    If the question wasn't about Windows programming, I'd suspect you were [Linus Torvalds trolling us](http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918)... – yannis Feb 02 '12 at 20:46
  • Ummm... I have a C program included into Debian and Ubuntu, and another into Sunfreeware. LOL – nlovric Feb 02 '12 at 20:58
  • @PersonalNexus - You know that Visual Studio 2010 still doesn't have a lot of the features of C99 right? [See here](http://connect.microsoft.com/VisualStudio/feedback/details/526116/c99-support). VS is much more suited to C++ development than C. – Jetti Feb 02 '12 at 21:02
  • Hi nlovric, you're asking a number of different things at the same time: can you focus one problem at a time and ask about them separately? –  Feb 02 '12 at 21:24

1 Answers1

3

Given that the entire Win 32 API is exposed primarily as C functions, there' no hinderance to using C, other than maybe the lack of libraries.

The best book to start with is probably still Programming Windows by Charles Petzold. It's showing its age, but the basics haven't changed, and all the new stuff can be learned best through MSDN's online reference - which is where you should go once you've gotten started anyway.

The best environment for C under windows is usually Visual Studio. You can use the express c++ version if you don't want to pay for the bigger versions. Just use the /TC switch to compile as C code rather than C++. It does lack some of the newer C features, but it's a solid compiler that works well with Windows.

As to your editorial on C vs C++ programming, it "seems to me" like you're jumping the gun in assuming any performance gains / losses between object-oriented and procedural programming.

Eclipse
  • 239
  • 1
  • 3
  • What about the Portland Group PGI C / C++ ([PGI Workstation](http://www.pgroup.com/products/pgiworkstation.htm), [PGI Accelerator Compilers](http://www.pgroup.com/resources/accel.htm)); would that be better? It supports C-99. – nlovric Feb 02 '12 at 21:31
  • PellesC is another choice. – Gary Willoughby Feb 02 '12 at 22:03