The D programming language is a natively compiled, systems programming language. In many respects, D is very similar to C++: it shares C++'s runtime performance, low-level access, abstractions, and most of its syntax. It also improves on C++ in many areas, for example in its expressiveness, compilation speed, and grammatical simplicity. That isn't to say that D is a perfect language. D still has relatively poor tool chain support, and some language features still need some TLC. However, on the whole, D is a very balanced language that will feel familiar to anyone that has done any programming in a modern C-style language (i.e. C++, C#, or Java).
Code::Blocks is a free, open source, cross platform IDE that is easy to use, and features the same look-and-feel as Visual Studio. While Code::Blocks advertises itself as a C++ IDE, it natively supports D projects.
This article will describe how to install the DMD compiler as well as the Code::Blocks IDE.
Step 1 - Installing DMD
DMD is the Digital Mars D compiler. Digital Mars is a small software company owned by Walter Bright, who invented the D programming language, so the DMD compiler can be seen as the reference implementation for other D compilers. It is also the first (and only) thing you'll need to get started with D programming.
Download the Windows Installer (direct link to file)
(If the link doesn't work, head to the download page, and select the Windows one-click installer for D language version 2).
Once the download has finished, run it, and follow the instructions.
When you are asked what component you want to install, only select D2. You don't need anything else (however, feel free to install the other components if you know you want to). Click "Next" once you have select the component you want.

Note that when prompted for the directory to install D to, you may enter another directory, but this guide will assume that you have installed to the default (C:\D). If you do select another directory, be sure to take this into account whenever C:\D is mentioned.
Once you have selected the directory, the installer will download the necessary files, and continue to install DMD.
At this stage you should have a fully functioning D2 compiler, and you could start doing some D coding now if you so desired. However, writing code in notepad, and compiling via the command prompt isn't very fun; what we need is an IDE.
Step 2 - Installing Code::Blocks
To install Code::Blocks, head to their download page, and select the Windows setup download. Note that you do not need the "mingw" version as that is for C++ -- the regular (smaller) download will suffice. As per usual, once the download has finished, run it, and follow the instructions.
IMPORTANT: When asked what components to install, ensure that you select the D lexer. This is not included in the standard install! Again, feel free to install whatever other components you think you might want to use, but this is the only change that is required.

Hit "Next", select your install directory (it doesn't matter where) and hit "Next" again. Finally, once the install is complete it will ask if you want to run Code::Blocks now. Click "Yes".
Step 3 - Your First D Program
When Code::Blocks starts up, it will pop up with a window titled "Compilers auto-detection". From the list select "Digital Mars D Compiler" (NOT "Digital Mars Compiler"), click "Set as default" then click "OK". Next, the annoying "Tip of the day" window will pop up. Close it. You will then be asked about file associations. Select "No, leave everything as it is", and click "OK". Close the scripting console.
Code::Blocks is now ready for use. Click the "Create a new project" in the middle of the screen. You will be presented with an array of project templates to choose from. Find the one called "D application", select it, then click the "Go" button at the top-right. This will take you to the D project wizard, click "Next" on the first page. The next page will ask for your project's name and folder. For the name, you can type anything you like; I went with "Test". For the folder, again, put it wherever you like; your home folder is as good a place as any. Click "Next". You are now given some configuration options. Ensure that the Digital Mars D Compiler is selected, and everything else should be left as it is. Click "Finish".
You are now ready to start coding. From the "Management" pane, expand the "D Sources" folder, and double-click "hello.d". You will be presented with some very ugly, non-idiomatic D2 code. This is what I get:
version(Tango) extern(C) int printf(char *, ...);
int main(char[][] args)
{
printf("hello world\n");
printf("args.length = %d\n", args.length);
for (int i = 0; i < args.length; i++)
printf("args[%d] = '%s'\n", i, cast(char *)args[i]);
return 0;
}
What an ugly mess! Obviously the guys at Code::Blocks haven't updated their sample code for D2 yet!
That's not all they haven't updated. If you try to compiler this code (by hitting
the button), you'll get an error message:
"Test - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?!
This is because Code::Blocks is looking in C:\dmd for the DMD compiler, but it's not there. To fix this, open up the "Settings" menu and select "Compiler and debugger...". Ensure that the selected compiler is the "Digital Mars D Compiler" and head to the "Toolchain executables" tab. In the installation directory text box, enter "C:\D\dmd2\windows\bin", and click "OK".
Now, try to compile again (by hitting
the button). If the sample code is the same as above, then you'll get some compile error messages about printf not being defined. Let's replace that code with some more idiomatic D2 code. Remove the sample code, and use the following instead:
import std.stdio;
void main()
{
writeln("Hello, world!");
}
That's more like it! Compiling now should produce no errors, and if you run the code you should see the console pop up with the words "Hello, world!" displayed. Congratulations, you have written your first D program!