|
|
|
|
|
by WalterBright
2757 days ago
|
|
My experience, which of course is anecdotal, is that the advantage is it's easy to change the algorithms and data structures. I've maintained C and C++ code bases for decades, and I've found that the first algorithm I tried has stayed there in the code. It gets tweaked, optimized, refactored, but it's the same algorithm and data structure. With D, when I developed the Warp preprocessor, https://github.com/facebookarchive/warp I continually tried different algorithms & data structures to see which was faster. One reason it's easier is that in C/C++ the . is used for value field access, while -> for pointer field access. In D, . is used for both. So you can easily switch between a value and a pointer to the value by changing little code. |
|
Yes, this is a great feature. Rust also does this, and I attribute substantial portion of ease of refactoring Rust to this feature.