# C++ redistributable



## GSquadron (Dec 11, 2011)

Sometimes when i install games, at the end they require two other components:
directX update and C++ 2005 redistributable.
Now the question is: This C++ 2005 means that the game was written in MSVC 2005?


----------



## CrackerJack (Dec 11, 2011)

No not necessary, I believe it's just used for a few framework components. Guessing for example system info/specs... Just guessing


----------



## GSquadron (Dec 11, 2011)

But whatever programming language it would be, for example C# you would need
another component .net framework 4.0?!
So if it is only 2 components i think it was made in C++
and that is very weird cuz i tested the same program in C# and C++ and the result
was better in C#, instead of low machine code C++
This is like directX 9 with 11, where 11 runs faster than 9. So after all there is no need at all
to program in C++, making companies even weirder why they choose C++ instead of C#
Anyone found anything?


----------



## W1zzard (Dec 11, 2011)

no reason not to use an older visual studio version for game development. it's not like you're going to use any of the updated mfc components or .net. i know a few people who still use visual studio 6.0 and produce better stuff than most developers out there with the latest shiny ide.

if you do any serious graphics programming then c++ is the way to go. you want full control over memory allocations and not some .net garbage collector that may or may not do what you want. also direct access to directx and other apis is a big plus for the pros

also historically all game developers are experts at c++, why would they want to learn a new .net language that makes their life difficult and slower?


----------



## GSquadron (Dec 11, 2011)

oh well, i tried C# and don't really think c++ is that big.
Also, the question of the thread is:


> This C++ 2005 means that the game was written in MSVC 2005?


----------



## Kreij (Dec 11, 2011)

The C++ redistributables are a collection of libraries that are needed to run a C++ program on a computer that does not have Visual C++ installed.
There is no reason you have to link to specific versions of the library (unless earlier libraries do not contain the functions you want). You can even link to mutiple versions of libraries, but that is not highly recommended unless you are aware of the potential problems you could encounter.
So you could technically be using VS2008 or VS2010 and be linking to the 2005 libraries for whatever reason.

It's the same with C# and frameworks. You can compile against any compatible framework (2.0, 3.5, 4.0) as long as the libraries contain what you need. Depending upon what you compile against will determine what framework is required on the computer running the app, just like with the redistibutables.

So in answer to your question, it is _likely_ that the game was written using VS2005, but it is not a requirement for using the libraries.


----------



## W1zzard (Dec 11, 2011)

you can also compile c++ statically with the libraries embedded in the program code, so the runtime is not needed (gpuz does that for example)


----------



## W1zzard (Dec 11, 2011)

Aleksander Dishnica said:


> and don't really think c   is that big.



99% or more of all exe files on any system are written in c/c++


----------



## GSquadron (Dec 11, 2011)

So you mean, no matter what programming language you know,
just learn C++ or you will lose your time?

BTW i have like 120 C# .exe files in my computer and don't really think you are right
unless you know that my system has 1200 C++ exes


----------



## Kreij (Dec 11, 2011)

What W!zz is saying is that C# is basically a wrapper around libraries that were originall written in C or C++ in order to enforce things like type-safety (which C++ does not enforce, and why you have to tell a C# program to use unsafe code to compile code that uses "unsafe" calls or statements).
C# can do a lot, but to really get into the guts of the computer, you have to use platform invoke (pInvoke) to get to the native functions (written in C/C++) which C# does not expose directly in it's APIs. pInvoke does not require the unsafe compiler flag to be set.

If you are forced to do a LOT of pInvoking to get what you want, you are better off just using C++ as it natively calls the underlying Win32 libraries. This is almost always the case with games, and why game studios almost exclusively use C++.

Continuing ... C++ is far superior for access to DirectX due to their being "natively" the same. Microsoft released a Managed DirectX, but bailed on it in favor of XNA.
XNA is a fine platform to create games with, as it bridged the gap between PCs and XBoxes, but as a developer, if the complete guts of your 3D engine are written in C++, it makes almost no sense to try to bridge XNA with a C++ engine. You would be much better off, and have a much easier time, if you just write the game in C++.

As far as what MS uses to create the million executables you get with  Windows install, I have no idea. I would imagine there is a mix with the majority being C++, but the DLLs that come with Windows are probably all written in C++.


----------



## W1zzard (Dec 11, 2011)

Aleksander Dishnica said:


> unless you know that my system has 1200 C++   exes



how many exe files in c:\windows and the folders below?



Aleksander Dishnica said:


> just learn C ++  or you will lose your time?



certain applications like simple stuff or prototypes are much faster to write in .net. 

and i say that as c++ expert / c# beginner



Kreij said:


> As far as what MS uses to create the million executables you get with Windows install



all c++. 
well, some could be written as standard c code without objects, but i count those as c++ for simplicity. they are still compiled with the visual c++ compiler and written using visual studio as IDE


----------



## W1zzard (Dec 11, 2011)

for the record, there is no "best" language. 

best could be: use the language you are good at, that provides maximized productivity for your time, that makes you a ton of money, that works on most systems of your clients, that most of your peers know, that is free/cheapest, that offers the best development environment etc etc


----------



## Kreij (Dec 11, 2011)

I had heard that MS was using C# for some things in Windows, but I cannot find any references to what ... it could simply be prototyping stuff with the final releases of the executables being done in C++.

Having worked in both C++ and C# a lot, I prefer C# for writing business apps and database apps as it is far quicker given that C# was designed for RAD coding.
C# is a lot easier to learn as it's not as esoteric as C++, but it makes you jump through hoops to get to the nuts and bolts of your hardware by accessing native libraries.

Anyway, if someone was looking at entering the field of game programmiing and development, you are going to have to know C++. Why they even bother teaching any other languages at the game design technical universities is beyond me (the first programming class our boy had at ITT was using VB.  )


----------



## xbonez (Dec 12, 2011)

Indeed C# is beautiful and incredibly simple to pick up, but there are certain advantages C++ has over C# which are too large for the industry to ignore.

For one, C++ is cross-platform. Sure, you can run C# programs on Unix and Unix-like systems, but they generally require you to jump through hoops, install non-standardised implementations of the .NET Framework etc. In the case of C++, as long as you have gcc (installed natively on Macs and most Linux distributables), you can execute your C++ code.

Secondly, speed. I worked for an investment banking firm for a year and while most of our business logic was implemented in .NET, the most time and speed critical components were always implemented in C++. The actual process of buying and selling assets (where every millisecond counts) was carried out by C++. There are many reasons a C# applications cannot not compete with a C++ application in terms of speed. One of them is the fact that C# code compiles to an intermediate bytecode.


----------



## ArchStupid (Dec 12, 2011)

The reason why some programs are faster in Java / C# is because of the Just In Time Compiler (JIT), which offers at least 'some' code optimization in basically all scenarios, while C++ relies almost solely on the user to perform equivalent optimizations. (at least while working with ISO/ANSI C++ specifications)

When it comes to serious optimization - especially hardware and graphics, C++ is miles ahead of anything that C# or Java can do.

C# and Java aren't made to compete with C++, but to evolve the programming market towards a more centralized approach. That's the reason why C# and Java programmers are at a higher demand in the market currently. (As far as what I gathered in my experience, anyway.)


----------

