Difference between revisions of "Tutorials"
(→Common Idioms) |
(Added two more interactive tutorials to list) |
||
(58 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
+ | == Videos Tutorials == | ||
+ | * [[Videos#Tutorials | Video tutorials]] | ||
+ | |||
+ | == Interactive Tutorials == | ||
+ | * [https://tour.dlang.org DLang Tour] (basics fully available in 6 languages plus 7 work in progress languages as of July 2020) | ||
+ | * [https://www.educative.io/courses/programming-in-d-ultimate-guide Programming in D: The Ultimate Guide for Software Engineers] | ||
+ | * [https://www.educative.io/courses/advanced-programming-techniques-in-d Programming in D: Advanced Programming Techniques in D] | ||
+ | * [https://business.teachsector.com/courses/dforpython Programming Language D, the Best Programming Language, for Former Python Developers] | ||
+ | |||
+ | |||
+ | |||
== Best Practices == | == Best Practices == | ||
* [[Order of import statements]] | * [[Order of import statements]] | ||
Line 7: | Line 18: | ||
Although D inherited much of its syntax from C and C++, the new features that it introduces lead to some common idioms that are unique to D. | Although D inherited much of its syntax from C and C++, the new features that it introduces lead to some common idioms that are unique to D. | ||
+ | See also category [[:Category:CommonIdiom|CommonIdiom]]. | ||
* [[Initializing variables]] | * [[Initializing variables]] | ||
* [[Declaring constants]] | * [[Declaring constants]] | ||
* [[Looping over integers]] | * [[Looping over integers]] | ||
− | * [[Unittest]] | + | * [[Unittest#Placement|Unittest placement]] |
+ | ** [[Unittest#Unittest-specific imports and helper functions|Imports and helper functions only present when compiling with -unittest]] | ||
+ | * [[Commenting out code]] | ||
+ | * [[Dense multidimensional arrays|Declaring dense multidimensional arrays]] | ||
* [[Voldemort types]] | * [[Voldemort types]] | ||
+ | |||
+ | == Design Patterns == | ||
+ | |||
+ | * [[Instantiator Function Pattern]] - Instantiating classes and structs with minimal redundancy. | ||
+ | * [[Compile-time Command Pattern]] - Store function and arguments to be invoked later. | ||
+ | * [[Higher Order Range Pattern]] - Transform a range before passing it to a function/object. | ||
+ | * [[Mixin Macros Pattern]] - Mixins + Compile-Time Magic | ||
+ | * [[Low-Lock Singleton Pattern]] - Singletons without double-checked locking | ||
== How To == | == How To == | ||
− | * [[Compiling_and_linking_with_DMD_on_Windows| | + | See also category [[:Category:HowTo|HowTo]]. |
+ | * [[Bind D to C]] | ||
+ | * [[Compiling_and_linking_with_DMD_on_Windows|Compile and link with DMD on Windows]] | ||
+ | * [[Linking_With_Unilink|Link with the Unilink linker on Windows instead of Optlink]] | ||
+ | * [[Convert header files with SED]] | ||
+ | * [[Defining custom print format specifiers|Define custom print format specifiers]] | ||
* [[Function literals]] | * [[Function literals]] | ||
− | * [[ | + | * [[Implicit conversions in user types|Implicitly convert a user-defined type to a builtin type]] |
+ | * [[Output locale character (MBS) to console]] | ||
+ | * [[Promote D Projects]] | ||
* [[Regular expressions]] | * [[Regular expressions]] | ||
* [[Runtime type information (RTTI)]] | * [[Runtime type information (RTTI)]] | ||
− | |||
− | |||
* [[Run D in a CGI (web) environment]] | * [[Run D in a CGI (web) environment]] | ||
− | |||
* [[Tame OPTLINK]] | * [[Tame OPTLINK]] | ||
− | * [[Run unit tests]] | + | * [[Unittest|Run unit tests]] |
+ | * [[Using NASM with D]] | ||
+ | * [[Read table data from file|Split file into multidimensional dynamic string array]] | ||
+ | * [[Porting 32 Bit Code to 64 Bits]] | ||
+ | * [[Converting C .h Files to D Modules]] | ||
+ | * [[Instantiating Class Objects Elsewhere Than the GC Heap]] | ||
+ | * [[Timing Code]] | ||
+ | * [[Extending Unit Tests]] | ||
+ | * [[Running DMD From The Command Prompt]] | ||
+ | * [[Perf]] | ||
+ | * [[Floating Point Gotchas]] | ||
+ | * [[LDC+Dub+Vibe.d on SmartOS 64bit]] | ||
+ | * [[Call D from Ruby using FFI]] | ||
+ | * [[Programming in D tutorial on Embedded Linux ARM devices]] | ||
+ | * [[D on esp32/esp8266(llvm-xtensa+ldc) and how to get started]] | ||
+ | |||
+ | === Microsoft Windows === | ||
+ | * [[D for Win32]] | ||
+ | * [[Win32 DLLs in D]] | ||
+ | * [[COM Programming]] | ||
+ | * [[Using UTF on Windows]] | ||
+ | |||
+ | [[Category:Tutorials]]. |
Latest revision as of 14:02, 29 October 2022
Contents
Videos Tutorials
Interactive Tutorials
- DLang Tour (basics fully available in 6 languages plus 7 work in progress languages as of July 2020)
- Programming in D: The Ultimate Guide for Software Engineers
- Programming in D: Advanced Programming Techniques in D
- Programming Language D, the Best Programming Language, for Former Python Developers
Best Practices
- Order of import statements
- Portability and performance
- Conventional module name for importing all modules in a package
Common Idioms
Although D inherited much of its syntax from C and C++, the new features that it introduces lead to some common idioms that are unique to D. See also category CommonIdiom.
- Initializing variables
- Declaring constants
- Looping over integers
- Unittest placement
- Commenting out code
- Declaring dense multidimensional arrays
- Voldemort types
Design Patterns
- Instantiator Function Pattern - Instantiating classes and structs with minimal redundancy.
- Compile-time Command Pattern - Store function and arguments to be invoked later.
- Higher Order Range Pattern - Transform a range before passing it to a function/object.
- Mixin Macros Pattern - Mixins + Compile-Time Magic
- Low-Lock Singleton Pattern - Singletons without double-checked locking
How To
See also category HowTo.
- Bind D to C
- Compile and link with DMD on Windows
- Link with the Unilink linker on Windows instead of Optlink
- Convert header files with SED
- Define custom print format specifiers
- Function literals
- Implicitly convert a user-defined type to a builtin type
- Output locale character (MBS) to console
- Promote D Projects
- Regular expressions
- Runtime type information (RTTI)
- Run D in a CGI (web) environment
- Tame OPTLINK
- Run unit tests
- Using NASM with D
- Split file into multidimensional dynamic string array
- Porting 32 Bit Code to 64 Bits
- Converting C .h Files to D Modules
- Instantiating Class Objects Elsewhere Than the GC Heap
- Timing Code
- Extending Unit Tests
- Running DMD From The Command Prompt
- Perf
- Floating Point Gotchas
- LDC+Dub+Vibe.d on SmartOS 64bit
- Call D from Ruby using FFI
- Programming in D tutorial on Embedded Linux ARM devices
- D on esp32/esp8266(llvm-xtensa+ldc) and how to get started