D as a prototyping language (for C/C++ projects)

bearophile bearophileHUGS at lycos.com
Tue Feb 26 08:15:48 PST 2013


Craig Dillabaugh:

> I am a novice D programmer and use C++ in my work. One thing I
> find myself doing when I need to implement some non-trivial
> algorithm is that I will originally code it in D and perform
> testing from there to make sure I have the logic right.
> Once I have everything working in D I simply port it over to 
> C++.

I often write the code in D (sometimes I start from Python and 
then I convert it to D), get it right, write down more tests, 
then I slowly lower the level of the D code keeping it correct 
with help of the tests, and then convert it to C.

When the code is quite complex, if I do this I waste some time, 
but it's a known amount of time, while if I follow a more direct 
route, writing the C code directly, I can't tell how much 
debugging time I will need.

Bye,
bearophile


More information about the Digitalmars-d mailing list