Jump to page: 1 29  
Page
Thread overview
December 11
A few things that have annoyed me about writing D lately:

https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
December 11
On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
> A few things that have annoyed me about writing D lately:
>
> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/

I agree about template lambdas. But is something that misses really an error ?
December 11
On Tuesday, 11 December 2018 at 11:08:29 UTC, user1234 wrote:
> On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
>> A few things that have annoyed me about writing D lately:
>>
>> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
>
> I agree about template lambdas. But is something that misses really an error ?

It's debatable. I thought it was funny that it was an oversight given the fact that D had lambdas to avoid the problems that C++ used to have, then went and made the "same" mistake again.
December 11
On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
> A few things that have annoyed me about writing D lately:
>
> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/

Really great article. I like the "UFCS for templates" idea.
12 years in and I still don't know what @property is for!


> . The way to do eponymous templates right is to (obviously renaming the feature) follow D’s own lead here and use either this or This to refer to itself.

Brilliant.
December 11
On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
> A few things that have annoyed me about writing D lately:
>
> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/

Nice!

I like the eponymous templates idea, though it might get confusing with doubly nested eponymous templates and with mixin templates injecting constructors ( https://run.dlang.io/is/UYakit )

We really do need to figure out what to do with @property

> Returning a reference

Wow, thats f*ck'n stupid! https://run.dlang.io/is/SAplYw

> Variables can’t be ref

not _quite true, foreach variables can be.




December 11
On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
> A few things that have annoyed me about writing D lately:
>
> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/

If @property worked for a thing to return a delegate, it would be useful.

But noooo, we got worked up over syntax and forgot about semantics :(
December 11
On Tuesday, 11 December 2018 at 12:52:20 UTC, Adam D. Ruppe wrote:
> On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
>> A few things that have annoyed me about writing D lately:
>>
>> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
>
> If @property worked for a thing to return a delegate, it would be useful.
>
> But noooo, we got worked up over syntax and forgot about semantics :(

@property is useful for setters. Now, IMHO setters are a code stink anyway but sometimes they're the way to go. I have no idea what it's supposed to do for getters (nor am I interested in learning or retaining that information) and never slap the attribute on.
December 11
On Tuesday, 11 December 2018 at 12:51:56 UTC, Nicholas Wilson wrote:
> On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
>> A few things that have annoyed me about writing D lately:
>>
>> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
>
> Nice!

Thanks!

>
> I like the eponymous templates idea, though it might get confusing with doubly nested eponymous templates

I'd say it would refer to the innermost template.

> and with mixin templates injecting constructors ( https://run.dlang.io/is/UYakit )

I'd say it wouldn't work in mixin templates - is there such a thing as an eponymous mixin template now?

> We really do need to figure out what to do with @property
>
>> Returning a reference
>
> Wow, thats f*ck'n stupid! https://run.dlang.io/is/SAplYw

You're telling me - how do you think I found out? ;)

>> Variables can’t be ref
>
> not _quite true, foreach variables can be.

That's true and a weird edge case.
December 11
On Tuesday, 11 December 2018 at 12:57:03 UTC, Atila Neves wrote:
> On Tuesday, 11 December 2018 at 12:52:20 UTC, Adam D. Ruppe wrote:
>> On Tuesday, 11 December 2018 at 10:45:39 UTC, Atila Neves wrote:
>>> A few things that have annoyed me about writing D lately:
>>>
>>> https://atilanevesoncode.wordpress.com/2018/12/11/what-d-got-wrong/
>>
>> If @property worked for a thing to return a delegate, it would be useful.
>>
>> But noooo, we got worked up over syntax and forgot about semantics :(
>
> @property is useful for setters. Now, IMHO setters are a code stink anyway but sometimes they're the way to go. I have no idea what it's supposed to do for getters (nor am I interested in learning or retaining that information) and never slap the attribute on.

Well, one can use it for optics :)


@property
{
    int x()
    {
        return this._x;
    }

    void x(int value)
    {
        this._x = value;
    }
}
December 11
On Tuesday, 11 December 2018 at 13:08:18 UTC, 0xEAB wrote:
>
> Well, one can use it for optics :)
>
>
> @property
> {
>     int x()
>     {
>         return this._x;
>     }
>
>     void x(int value)
>     {
>         this._x = value;
>     }
> }

One could say getters and particularly setters don't really deserve a nicer way to write them. It's a code stink, it deserve a long ugly name.  (10 years ago I would be in the other camp)
« First   ‹ Prev
1 2 3 4 5 6 7 8 9