November 14

On Sunday, 14 November 2021 at 21:13:59 UTC, Dr Machine Code wrote:

>

On Tuesday, 12 October 2021 at 18:59:29 UTC, Imperatorn wrote:

>

On Monday, 11 October 2021 at 15:59:10 UTC, Atila Neves wrote:

>

I'm brainstorming about what I'll talk about at DConf, and during a conversation with Walter I thought it might be cool to talk about:

  • Worst features implemented in a non-toy language
  • Worst features (in your opinion) in D
  • Features you'd like to see in D

Ideas? Examples?

Thanks!

foreach_reverse - worst "feature" mankind has produced

why is it that bad? lol

It's just so ugly 😅

November 15

On Sunday, 14 November 2021 at 23:51:00 UTC, Imperatorn wrote:

>

On Sunday, 14 November 2021 at 21:13:59 UTC, Dr Machine Code wrote:

>

On Tuesday, 12 October 2021 at 18:59:29 UTC, Imperatorn wrote:

>

foreach_reverse - worst "feature" mankind has produced

why is it that bad? lol

It's just so ugly 😅

The keyword isn't pretty, but it's useful, easy to understand, and actually works correctly.

I'm sure you can think of something worse if you really try...

November 15
On 16.10.21 01:12, Walter Bright wrote:
> On 10/12/2021 2:38 PM, Timon Gehr wrote:
>> - non-lexical variable lifetimes (probably not happening)
> 
> It's already implemented for @live.

(Also, I want it based on the types of the involved values, not based on a non-modular function annotation.)
November 15
On Sunday, 14 November 2021 at 23:05:03 UTC, Timon Gehr wrote:
> On 14.11.21 22:54, Dr Machine Code wrote:
>> On Tuesday, 12 October 2021 at 21:38:48 UTC, Timon Gehr wrote:
>>> On 10/11/21 5:59 PM, Atila Neves wrote:
>>>> ...
>>> ...
>>>
>>>> * Features you'd like to see in D
>>>
>>> - built-in tuples/products with standard syntax
...
> I started this:
> https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md
> https://github.com/tgehr/dmd/commits/tuple-syntax
>
> Unfortunately, I was too busy at the time to finish the implementation, and I am not fully satisfied with the proposal. Probably I'd want to add at least static opIndex and static opSlice to it. Another issue is that it slightly expands `alias this` and I am not sure whether that's a direction Walter is willing to invest in at this point.

Just WOW.

What would be needed to get you working on this again?
November 15

On Monday, 15 November 2021 at 00:49:17 UTC, tsbockman wrote:

>

On Sunday, 14 November 2021 at 23:51:00 UTC, Imperatorn wrote:

>

On Sunday, 14 November 2021 at 21:13:59 UTC, Dr Machine Code wrote:

>

On Tuesday, 12 October 2021 at 18:59:29 UTC, Imperatorn wrote:

>

foreach_reverse - worst "feature" mankind has produced

why is it that bad? lol

It's just so ugly 😅

The keyword isn't pretty, but it's useful, easy to understand, and actually works correctly.

I'm sure you can think of something worse if you really try...

Well, obviously :)

It was more of a joke, but it's still pretty cringe to see it

November 15
On 15.11.21 10:29, Imperatorn wrote:
> On Monday, 15 November 2021 at 00:49:17 UTC, tsbockman wrote:
>> On Sunday, 14 November 2021 at 23:51:00 UTC, Imperatorn wrote:
>>> On Sunday, 14 November 2021 at 21:13:59 UTC, Dr Machine Code wrote:
>>>> On Tuesday, 12 October 2021 at 18:59:29 UTC, Imperatorn wrote:
>>>>> foreach_reverse - worst "feature" mankind has produced
>>>>
>>>> why is it that bad? lol
>>>
>>> It's just so ugly 😅
>>
>> The keyword isn't pretty, but it's useful, easy to understand, and actually works correctly.
>>
>> I'm sure you can think of something worse if you really try...
> 
> Well, obviously :)
> 
> It was more of a joke, but it's still pretty cringe to see it

The reason it exists is that reverse iteration over unsigned types is notoriously error prone. I think it's pretty nice to have this built in, knowing that it will be directly transformed into a simple for loop even in debug builds. It also allows easily reversing the order of iteration of any foreach loop, no matter which form. In particular, there is `static foreach_reverse`.
November 15
On Monday, 15 November 2021 at 12:41:51 UTC, Timon Gehr wrote:
> On 15.11.21 10:29, Imperatorn wrote:
>> On Monday, 15 November 2021 at 00:49:17 UTC, tsbockman wrote:
>>> [...]
>> 
>> Well, obviously :)
>> 
>> It was more of a joke, but it's still pretty cringe to see it
>
> The reason it exists is that reverse iteration over unsigned types is notoriously error prone. I think it's pretty nice to have this built in, knowing that it will be directly transformed into a simple for loop even in debug builds. It also allows easily reversing the order of iteration of any foreach loop, no matter which form. In particular, there is `static foreach_reverse`.

What's wrong about retro? Too retro :D
November 15
On Monday, 15 November 2021 at 14:02:42 UTC, Imperatorn wrote:
>
> What's wrong about retro? Too retro :D

std.range.retro is honestly just a bad name. It should have been `reversed`, or maybe `reverser`.
November 15

On 11/15/21 7:41 AM, Timon Gehr wrote:

>

On 15.11.21 10:29, Imperatorn wrote:

>

On Monday, 15 November 2021 at 00:49:17 UTC, tsbockman wrote:

>

On Sunday, 14 November 2021 at 23:51:00 UTC, Imperatorn wrote:

>

On Sunday, 14 November 2021 at 21:13:59 UTC, Dr Machine Code wrote:

>

On Tuesday, 12 October 2021 at 18:59:29 UTC, Imperatorn wrote:

>

foreach_reverse - worst "feature" mankind has produced

why is it that bad? lol

It's just so ugly 😅

The keyword isn't pretty, but it's useful, easy to understand, and actually works correctly.

I'm sure you can think of something worse if you really try...

Well, obviously :)

It was more of a joke, but it's still pretty cringe to see it

The reason it exists is that reverse iteration over unsigned types is notoriously error prone. I think it's pretty nice to have this built in, knowing that it will be directly transformed into a simple for loop even in debug builds. It also allows easily reversing the order of iteration of any foreach loop, no matter which form. In particular, there is static foreach_reverse.

Although it's fallen mostly out of style, the reason I hated foreach_reverse is because it used to be applicable to delegate iteration, but just iterates forward (I've just checked and it's deprecated, but not disabled).

I think I can count on one finger (and you can guess which one) the times I've used foreach_reverse.

-Steve

November 15

On Monday, 11 October 2021 at 15:59:10 UTC, Atila Neves wrote:

>

I'm brainstorming about what I'll talk about at DConf, and during a conversation with Walter I thought it might be cool to talk about:

  • Worst features implemented in a non-toy language
  • Worst features (in your opinion) in D
  • Features you'd like to see in D

Ideas? Examples?

Thanks!

I don't think I've answered yet, even tho I have responded to a couple others.

I don't really have many things to add that others haven't said but I just have this one thing to say:

>
  • Worst features (in your opinion) in D

The way D solves problems is by adding new features (such as attributes etc.) - but what ends up happening is that each problem solved by adding a new feature, introduces a new set of problems; often the old problem isn't even fixed properly either because the new feature is either a) not implemented entirely b) not working as intended - and then we somehow ends up with a new feature to fix the new feature.

It's an endless loop that D has put itself into.

I'm not sure if it can be fixed, nor am I even sure that I could think of a way to fix it.

Which brings me to:

>
  • Features you'd like to see in D

I'd like to see everything currently in D finished, instead of introducing new features.

Sometimes less is more.

19 20 21 22 23 24 25 26 27 28 29 30 31