D code length vs other languages

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Dec 6 09:58:28 UTC 2019


On Friday, 6 December 2019 at 05:44:31 UTC, Jab wrote:
> provide. Some of the C++ code examples have variables defined 
> at the start in old C-style. With multiple variables just being 
> declared on 7+ more lines. The examples weren't intended to be 
> used a means to measure number of lines of code.

Yes, I think there are too many tasks in Rosetta as well. Many of 
the code examples states that it is translated from the C example.

That clearly makes a lot of the code "unnatural" for any given 
language. Probably the D code too.

C++ is more verbose than D. In part because the C++ std lib 
requires more syntax and also because C++ code often use explicit 
namespaces. C++ is gradually getting less verbose by newer 
features like for-each, lambdas and constexpr.



More information about the Digitalmars-d mailing list