2 ms·
95% of the code I work on is D. D fits lots of purposes (more than C++), but I'm only going to talk about scripting. The minimalistic approach for the C++ sta
by Ace17 12y ago
95% of the code I work on is D.
D fits lots of purposes (more than C++), but I'm only going to talk about scripting.
The minimalistic approach for the C++ standard library makes C++ inappropriate to replace, for example, Bash scripts. In C++, you can't do any operation on the file system (erase a directory, get file size, list files, create pipes, ..) in a portable way. You can't create processes in a portable way.
The D standard library (aka Phobos) doesn't suffer these limitations. Which means you can write very high-level code using only a few (readable) lines.
By adding a shebang "#!/usr/bin/env rdmd" at the beginning of your D programs, you can execute them without prior explicit compilation, like: ./myProgram.d
I've been porting all my Bash scripts to D. The code runs incredibly faster, and now I can have structs again!