An ordered set of instructions. It reads input, follows rules, and produces output.
Workspace
D
systems programming native tools and C-family productivity
Definition first
What D means
D is a programming language for writing exact instructions, often used for systems programming native tools and C-family productivity. Start with one mental model: input goes through steps and becomes output.
main.dRun dmd main.d && ./mainHabit Use strong types and keep memory choices visibleA value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
D compiler is the place that actually runs code from main.d.
First readable code
Program output
entry point output syntax writelnwriteln(42);
Output 42Language lineage
D family tree
See where D comes from, which languages feel close, and what to learn next.
Zero base path
Question bank
Search before practice
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
D practice 1
D question 1. Choose the statement that matches printing a value.
D practice 2
D question 2. Choose the statement that matches naming a value.
D practice 3
D question 3. Choose the statement that matches reusable function.
D practice 4
D question 4. Choose the statement that matches basic collection.
D practice 5
D question 5. Choose the statement that matches printing a value.
D practice 6
D question 6. Choose the statement that matches naming a value.
D practice 7
D question 7. Choose the statement that matches reusable function.
D practice 8
D question 8. Choose the statement that matches basic collection.
D practice 9
D question 9. Choose the statement that matches printing a value.
D practice 10
D question 10. Choose the statement that matches naming a value.
D practice 11
D question 11. Choose the statement that matches reusable function.
D practice 12
D question 12. Choose the statement that matches basic collection.
D practice 13
D question 13. Choose the statement that matches printing a value.
D practice 14
D question 14. Choose the statement that matches naming a value.
D practice 15
D question 15. Choose the statement that matches reusable function.
D practice 16
D question 16. Choose the statement that matches basic collection.
D practice 17
D question 17. Choose the statement that matches printing a value.
D practice 18
D question 18. Choose the statement that matches naming a value.
Multiple choice
D practice 1
D question 1. Choose the statement that matches printing a value.
writeln(42);
Reference
Patterns for main.d
dmd main.d && ./mainentry point output syntax writeln
Program output
writeln(42);
- Run the smallest file first
- Print one known value
- Check the output before adding more code
variables assignment types int
Values and names
int total = 42; writeln(total);
- Give values readable names
- Keep one idea per line while learning
- Trace the value before changing it
function collection Array
Functions and collections
int add(int a, int b) {
return a + b;
}
int[] scores = [40, 2];
writeln(scores.length);- Keep functions small
- Return useful values
- Use the common collection before reaching for frameworks