For the following I'm going to assume that when you say "32 bit" you're really saying x86, and when you say "64 bit" you're really saying "x86-64" or something equivalent.
64 bit generally allocates more memory to objects (Where it's 4 bytes in 32, it's 8 bytes in 64) |
The way this statement is phrased, it's false at several levels.
Targeting x86-64 doesn't necessarily double the size of all objects. First, Windows compilers didn't scale the size of their types, so sizeof(int) == 4 on both Win32 and Win64. Second, the programmer may request from the compiler a specific number of bits for a given variable, rather than implementation-defined int, long, etc.
It is true that
pointers will be larger, but whether this translates to significantly more memory usage depends on the particular application.
32 bit has the ability to be cross platform, whereas 64 bit cannot |
Targeting x86 means that the compiler generates code that runs on x86 processors, and likewise for x86-64, so this statement is a bit absurd. What you meant to say is that an x86 executable for Windows can also be run on x86-64 installations of Windows (other operating systems don't do this that I'm aware, at least by default).
This is true, but depending on how the application has been written, targeting one or the other may be as simple as flipping a switch on the compiler.
if you want backwards compatibility you'll have to write two versions of the same program |
Nah. There may be some parts that can't be written independently of the platform, but if the whole program has to be written twice, you're doing something wrong.
I thought the grand goal was to make a single executable that works from a targeted platform and up. |
I would prefer an executable that takes advantage of all the features of my very expensive CPU, rather than one that will run on architectures that don't yet exist. Compilers will not suddenly vanish. We can always rebuild.
Besides the extra-large address space, x86-64 includes various SIMD instruction sets, which x86 processors may not include. A vectorizing compiler can simply generate instructions for those sets without having to insert branches for alternate code paths. x86-64 also has more registers, which some applications can benefit from. In other words, some applications will see a performance improvement simply by being compiled for x86-64.
x86-64 has been around for ten years. The number of x86 OS instances in the wild drops every day. If you want maximum compatibility, it's best to write code that can be retargeted easily (this, by the way, is probably a sensible strategy in general) and build for both platforms. If you don't particularly care, just target x86-64; it's the way of the future.