What are the major differences between Windows Server 2008, 2008 SP2 and 2008 R2?
Are the code bases for these OSes different?
If I'm developing applications for any one of these three, should I be worried that it might not work on the other two?
Windows Server 2008 and Windows Server 2008 SP2 are the same operating system, just at a different service pack level (Windows Server 2008 started at the SP1 level because it was released quite a bit after Windows Vista and SP1 was already out).
Windows Server 2008 R2 is the server release of Windows 7, so it's version 6.1 of the O.S.; it introduces quite a lot of new features, because it's actually a new release of the system. This is a good place to start: http://www.microsoft.com/windowsserver2008/en/us/whats-new.aspx.
There are also differences at the GUI level, because WS2008R2 uses the same new GUI introduced with Windows 7 (new taskbar, etc.).
Depending on what kind of applications you're developing, they may or may not encounter problems on different O.S. releases; you should definitely check MSDN.
The single most important point: Windows Server 2008 R2 exists only for 64-bit platforms, there's no x86 version anymore.
Ok simple way of looking at it:
Windows Vista SP1 = Windows Server 2008
Windows Vista SP2 = Windows Server 2008 SP2
Windows 7 = Windows Server 2008 R2
Okay, its a bit confusing, Windows Server 2008 is based on the WindowsNT 6.0 service pack 1 kernel. Because of this the first service pack was Service pack 2 (Windows Server 2008 SP2). Windows Server 2008 R2 is also based on the WindowsNT 6.1 Kernel (It is akin to Windows 7 much like Server 2008 is akin to Vista) with some expanded features and capabilities.
Since the kernel is the same unless your doing something fairly exotic it should be fine, remember to consult the MSDN for better info. The biggest issue I could see you running into is the ability for R2 to run without a GUI interface at all. This is probably going to be a minority of cases, it is not the default for it, default is just like any other Windows Server, I'm not sure how many will be using the ability.
THe only thing I have encountered thusfar is that Window Server 2008 R2 is much more secure than regular Windows Server 2008. For instance, I develop for SharePoint, Of which a known issue is that it "forget" to enable Local launch / activation for the IIS Wamreg COM component. In Windows Server 2008 you could just open op de Component Services window and enable all accoutns needed. In Windows Server 2008 R2 you need to go into the registry first and take ownership of the IIS WamReg registry key first before being able to change to security settings.
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.