Damn C++ and damn D!

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Feb 5 09:24:50 PST 2012


On 2/5/12 10:25 AM, Jose Armando Garcia wrote:
> On Sun, Feb 5, 2012 at 2:13 PM, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org>  wrote:
>> On 2/5/12 9:57 AM, Jose Armando Garcia wrote:
>>>
>>> On Sun, Feb 5, 2012 at 1:44 PM, Timon Gehr<timon.gehr at gmx.ch>    wrote:
>>>>
>>>> immutable variable = (boolean_condition) ? {
>>>>     // initialize based on boolean_condition being true
>>>> }():{
>>>>     // initialize based on boolean_condition being false
>>>> }();
>>>>
>>>>
>>>
>>> Cool, now I want some syntactic sugar ;). I write this all the time!
>>
>>
>> Make it a function.
>>
>
> I agree that in theory that you can do all this stuff in D but the
> reality is that developers are lazy and end up fighting the language.
> It is probably true that in a well structure/abstracted program this
> is not a problem but the reality is that a lot programs don't start
> this way.

I agree with the general argument but I find it disconnected from the 
case in point. It's not "all this stuff", it's one little local thing, 
and I'd find it tenuous to claim that such a small difference in syntax 
actually matters for anything.

> I listen a very enlightening talk by Gilad Bracha the other
> day: https://www.youtube.com/watch?v=-IavVtOE_Fg. I still not ready to
> completely agree with him but I do see his point about a language
> getting out a programers way...

I'll watch this, thanks.


Andrei


More information about the Digitalmars-d mailing list