A Beginner's Guide to D/Before We Begin.../Short Introduction to D

From Wikibooks, open books for an open world
Jump to navigation Jump to search

D is a language following in the footsteps of the C-language family. It has the same general syntax, so anyone familiar with C, C++, Java or C# should be able to easily pick up the language. You should see the language comparison page for more details.

Since this page is about a short introduction to D, why not start with the all-famous Hello World.

import std.stdio;
void main()
  writefln("Hello World!");

For the experienced C programmer, the import and writefln should look strange. We will discuss them in later chapters.