February 11, 2023
>
> What attracts me to D, is the inability to program outside of a class in C#. I think they are trying to find ways to make this happen, but I wouldn't hold my breath.

programming outside of a class is overrated though in my opinion. i've never seen a usecase for it in an object oriented language. Of course Kotlin can do this, which is good, but you can just create utility classes (i.e. `static class` in C#, `final class` in Java with a private ctor, or Kotlin `object`.)
February 11, 2023
On Saturday, 11 February 2023 at 02:15:37 UTC, thebluepandabear wrote:
>> That's not entirely correct.
>>
>> I don't use any Apple hardware products. Never have, and never will.
>>
>> I use Swift on Linux only.
>>
>> There are of course some library features of Swift tied to Apple products. But I have no need for those library features.
>>
>> As a standalone language, Swift can (IMO) already out compete D.
>
> Swift on Linux? Interesting...
>
> what is the use case?

.. something to play with when not programming in C#.

But its not a 'play' language. It's a seriously well designed language.

Swift is also available on Windows.
February 11, 2023
On Saturday, 11 February 2023 at 02:18:48 UTC, thebluepandabear wrote:
>>
>> What attracts me to D, is the inability to program outside of a class in C#. I think they are trying to find ways to make this happen, but I wouldn't hold my breath.
>
> programming outside of a class is overrated though in my opinion. i've never seen a usecase for it in an object oriented language. Of course Kotlin can do this, which is good, but you can just create utility classes (i.e. `static class` in C#, `final class` in Java with a private ctor, or Kotlin `object`.)

Yes, it's overrated, I agree, especially with C# static classes.

still... in Swift, you can do hello world, just like this:

print("Hello World!");

Of course in C# dotnet 5, you can use top-level statements now:

using System;
Console.WriteLine("Hello World!");

(but that's just syntactic sugar .. the class, main etc. is actually generated behind the scenes.) I don't use top-level statements though, as find them completely pointless (and annoying) in C#.

The shortest syntax in D, for hello workd - as far as I know, is:

import std.stdio;

void main()
{
    writeln("Hello World!");
}

February 11, 2023
On Saturday, 11 February 2023 at 02:17:09 UTC, thebluepandabear wrote:
>> I'm not an advocate of any style in particular. I'm happy to use any style that is clear to understand and use, suitable, and can provide reasonable guarantees around memory safety and correctness.
>>
>> But a language that claims to support OOP but doesn't even have type privacy, is a bit of joke IMO.
>
> agreed, the current behaviour of `private` is inexcusable, and it's something newcomers need to be warned about.

that wasn't my first 'shock' when I came to D.

My first shock, was that 'public' was default!

New comers should know that before they even begin their first line in D.

For a language that claims to supprot OOP, and does public by default, and no way to declare type private... I mean... wow!
February 11, 2023
> For a language that claims to supprot OOP, and does public by default, and no way to declare type private... I mean... wow!

agree, it should definitely be `private` by default... if `private` was implemented properly lmao
February 13, 2023

On Friday, 10 February 2023 at 21:52:02 UTC, ProtectAndHide wrote:

>

Well in Swift, there is no problem .. at all.

Why is it a problem in D then? (and I mean technically).

What about the increment operator ++ ?

February 13, 2023
On Monday, 13 February 2023 at 07:19:49 UTC, Kagamin wrote:
> On Friday, 10 February 2023 at 21:52:02 UTC, ProtectAndHide wrote:
>> Well in Swift, there is no problem .. at all.
>>
>> Why is it a problem in D then? (and I mean technically).
>
> What about the increment operator `++` ?

Remember, that a one of the design goals of Swift was to NOT continue the 'continuity with C'. This is a very, very, very different goal to D.

Personally, I've never liked ++ and -- (and I have for many years, wrote them out the way Swift now requires.).

So for me, Swift does exactly what I want here ;-)

Chris Lattner outlines the reasons for removing it in Swift 3.0 here:

https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md

February 13, 2023
On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote:
> Chris Lattner outlines the reasons for removing it in Swift 3.0 here:
>
> https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md

So your complaint is that you agree with Chris Lattner and disagree with others?
February 13, 2023
On Monday, 13 February 2023 at 09:14:18 UTC, Kagamin wrote:
> On Monday, 13 February 2023 at 08:22:06 UTC, ProtectAndHide wrote:
>> Chris Lattner outlines the reasons for removing it in Swift 3.0 here:
>>
>> https://github.com/apple/swift-evolution/blob/main/proposals/0004-remove-pre-post-inc-decrement.md
>
> So your complaint is that you agree with Chris Lattner and disagree with others?

I was just responding to your comment about '++'.

What is your point? That I should not complain about not being able to 'declare' type private? (in a language that says it support OOP).

My request is not odd. What is odd, is the complete and utter rejection of it ;-)
February 14, 2023
My point is you know you're just picky.