Why do you continue to use D?

Paulo Pinto pjmlp at progtools.org
Tue Jun 9 13:06:30 UTC 2020


On Tuesday, 9 June 2020 at 12:05:45 UTC, Dukc wrote:
> On Wednesday, 3 June 2020 at 11:14:13 UTC, aberba wrote:
>> On Wednesday, 3 June 2020 at 11:12:08 UTC, aberba wrote:
>>> What are you?
>>
>> Oops, what about you?
>
> Well, I currently use 2 languages extensively: C# and D. There 
> is not really much contest in which of the two is better when 
> external factors don't push either choice. D code is easier to 
> keep short, easier to modularize and easier to make performant.
>
> Why do I say that D is easier to modularize than C#? Isn't C# 
> suppposed to be a scalable language? A good example is D 
> `x.abs` versus C# `Math.Abs(x)`. In C#, I can only import stuff 
> for the whole file, not just for one function. Also for a 
> static function, C# forces he innermost "module" to be a class, 
> so if I want to split a class in two, I have to change code 
> calling the member functions. In D I can just need to change 
> some imports, since the functions would be module-level.
>

You can achieve that with a mix of partial classes and using 
static, the only downside is a bit more of boilerplate on C# side.




More information about the Digitalmars-d mailing list